Slashdot Mirror


What I Hate About Your Programming Language

chromatic writes "Perl programmers like punctuation. Python programmers like indentation. Every programming language has its own syntax, stemming from its philosophy. What I Hate About Your Programming Language examines the issues that shape languages as they grow. It's not advocacy, I promise."

47 of 800 comments (clear)

  1. ASP by (54)T-Dub · · Score: 1, Insightful

    Never learn to program with ASP. The worst programmers I know started with that abomination of a language.

    And of course I'm stuck using it to bring home the bacon
    ~:-\

    --

    "I can not bring myself to believe that if knowledge presents danger, the solution is ignorance" - Isaac Asimov
  2. I hate by AvitarX · · Score: 4, Insightful

    I hate all your programming languages because they arn't just a .wav file of my dictating what I want it to do.

    PS.
    I don't program for a living

    --
    Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
  3. Java and the operator overloading.. by Steveftoth · · Score: 2, Insightful

    He complains that the Java philosophy says 'Operator Overloading is bad,' and still overloads strings. However I think that its the wrong way to look at the concept of operator overloading. Because adding operator overloading to a language is like giving the programmer the ability to change and mutate the language to her desires. In other words, giving a programmer the ability to overload operators, gives them the ability to create their own subset of a language. Similar to macros, operator overloading adds a whole new layer of complexity to what was supposed to be a simpler, easier to understand way of programming.

    1. Re:Java and the operator overloading.. by EvanED · · Score: 5, Insightful

      But, there are MANY times when operator overloading would make things sooo much easier. Which would you rather read:

      complex z1(0,1);
      complex z2(1,0);
      complex z3 = z1+z2;

      or

      complex z1(0,1);
      complex z2(1,0);
      complex z3 = complexMath.Add(z1, z2);
      ?

      (The second is still better than z3=z1.Add(z2) IMHO)

      I'll take the first any day.

    2. Re:Java and the operator overloading.. by 0rbit4l · · Score: 2, Insightful
      Phew, yeah, that overloading just complicates things beyond the point of reason. I mean, wouldn't you rather use this form:

      determinant = (b.multiply(b)).subtract( ((new BigDecimal(4.0)).multiply(a)).multiply(c));

      than this:

      determinant = b*b - 4*a*c;

      Yeah... thank god there's no overloading! (hint: this is just an illustration - I know I can use builtin doubles rather than BigDecimal.) Forbidding operator overloading is just silly. To claim that "java is simple - see, no overloading!" while ignoring the pain it causes is equally silly.

  4. Re:PHP by sethadam1 · · Score: 4, Insightful

    Hate to tell you - but all three of those work in PHP. In fact, lots of good PHP programmers use all three for different kinds of comments -

    // is for instructions

    # is for copyrights

    /* is for
    multiple lines */

  5. Re:He likes JavaScript??? by kervel · · Score: 2, Insightful

    i disagree. he did not complain about the lack about regexes in java, he complained about the fact the interpreter and standard library are one big package.

    also i think he correctly talked about 3 key issues: syntax, usage, and extra features (libraries/tools). what's important about a language besides that ?

  6. Re:Pretty limited scope by Anonymous Coward · · Score: 1, Insightful
    Not only a limited scope but a limited competency to be writing this article. His comparisons are very poor when they rely on his programming ability.

    "It's also worth asking how often the language gets in your way. I once wrote a program to send out update notifications when a web page had changed. My original program was a 10-line shell script running on a Unix box. For various reasons, the final version was several hundred lines of Java running on a Windows machine. Granted, my Java wasn't so hot, but the shell script just glued together existing Unix commands."

    If it takes you over a hundred lines of java code to check for a web page modifiation then you shouldn't be writing java or any other language for that matter.
  7. Re:Pretty limited scope by Anonymous Coward · · Score: 1, Insightful

    He also forgot (V)B... the language that no-one (at least in slashdot) admits to use but that majority of developers use.

  8. But by Timesprout · · Score: 3, Insightful

    As the article points out many languages have a lot of quirks. While the pragmatic programmer is one of my favourite books on coding I dont think learning a new language every year is a particularly useful thing to do. There is a world of difference between just 'learning' a language and gathering the experience over an extended period of time to become truly proficient in it. I already code in serval languages and while I might have a passing interest in reviewing a couple more just to see how they work I really dont want to invest the time required to learn them properly when I dont see them appear in job adverts.

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
  9. Re:At the end of the day... by flippet · · Score: 2, Insightful

    I wish some higher level languages would force the use of comments in code, make it part of the declaration for a class or function.

    Better would be languages which are self-documenting... you don't need to read the comments because the purpose is clear anyway.

    Class or package specifications are an improvement over having to plough through masses of functions; there are bound to be methods of making plain code easier to read in the specification of the language too.

    Phil

    --
    "Cattle Prods solve most of life's little problems."
  10. Re:It's not always technical by Sylver+Dragon · · Score: 2, Insightful

    Actually, I kind of like VB for certain purposes. I am not, nor do I have any wish to be a programmer, but sometimes there are things you just can't do in a batch file, and dammit if VB isn't a nice way to get around this limitation. Not to mention that it looks a bit cleaner, and certainly less scary, to the average end user, than a command prompt. Plus the ability to send windows messages (logoff and the like) can be really damn useful.
    So yes, VB is another MS product, but it can still be a very useful tool if you live in a windows world, and don't want to bother with becomming a programmer.

    --
    Necessity is the mother of invention.
    Laziness is the father.
  11. Re:It's not always technical by aardvarkjoe · · Score: 4, Insightful

    Well, I rather suspect that the main reason why you see a lot more Java bashing is because most CS students used to have to learn C++; now they have to learn Java. Since /. is mostly high schoolers and college kids, you have a whole bunch of people that were forced to learn the language in the last few years. Obviously, you're going to end up with quite a few people that don't like it.

    There's not really all that much bashing of any other non-free stuff (the exception being Microsoft, but that's mostly because they're still beating up on the penguin.) I don't see it as being the primary reason for Java bashing.

    --

    How can we continue to believe in a just universe and freedom to eat crackers if we have no ale?
  12. Re:PHP by sethadam1 · · Score: 2, Insightful

    I think PHP coders generally lack the ego that non-PHP'ers have. Case in point...parent

  13. Re:He likes JavaScript??? by notfancy · · Score: 2, Insightful

    JavaScript is a really nice language. For starters, Waldemar Horwat sure knows his stuff. He seems to give a lot of thought to new features before introducing them (check out the project page) and has managed to write an interpreter that can be configured to accept varying language versions (as in language="JavaScriptXXX"). Then, the whole idea of a prototype-based object-oriented language becoming mainstream should have made the Self team green with envy. It supports very powerful constructs, like dynamically attaching behavior to built-in objects via __prototype.

    Besides, JavaScript inconsistencies between browsers is mainly a DOM issue, not a language one. Chromatic should have blamed the browsers, not the language.

  14. Re:He likes JavaScript??? by moof1138 · · Score: 4, Insightful

    It is easy to rip on an article with the sort of vacuous criticisms you fired off, but you really did not address a single real issue in the article. First off, you make it sound like he is advocating JS, which in reading the article is clearly not the case.

    Secondly, covering your criticisms:

    When he said that working with anonymous structures or structures by reference can be ugly, you interpreted 'ugly' as 'looks like.' But the ugliness in 'my $count = keys %{ $self->{groups}[HACKERS] };' is ugly in more than just looks.

    The poster above already pointed out your gross oversimplifications regarding Java.

    Finally, your point that "there are much worse things to complain about languages, besides syntax, and inappropriate usage," is correct, and the article itself does just that.

    In short, your analysis is overly simplistic, and full of fluff.

    --

    Hyperbole is the worst thing ever.
  15. Reactionary languages by SimHacker · · Score: 3, Insightful
    Many languages weren't designed, they were just reactions to the mistakes of other languages.

    Perl is a reaction to the flaws of many different languages. Unfortunately it reacted by imitating all the worst flaws of all the worst languages. People who think Perl is great are totally ignorant of other languages, and have extremely bad taste. They are desparate about their job security, which is why Perl is the best choice for corporate parasites looking to drum up busy-work to justify their salary.

    PHP is a reaction to Perl, used by amateurs who were burned by Perl, but actually want to get work done, however they don't know any better languages. Perl (mis)taught them that programming languages were extremely difficult to learn. But they couldn't stand Perl, so they switched to PHP because it seemed "simpler", without realizing how much better other programming languages are. So they stick with PHP because they're afraid to learn another programming language, having been traumatized by Perl, and tranquilized by the incredible mediocrity of PHP. PHP was designed to recruit disillusioned Perl programmers.

    C++ is a baroque overreaction to C, whose designers were obviously ignorant about programming language design, learnability, usability, readability and maintainability. So all those lessons had to be (mis)learned again, the hard way. Which brings us to...

    Java is a moderate reaction to C++, that still ignored much about programming language design that C++ designers never bothered to learn (so as not to drive off C++ converts by forcing them to learn new concepts). So if you know C++ but don't know Lisp or any other reasonable language, you think Java is great. Java was designed to recruite disillusioned C++ programmers.

    So PHP is to Perl as Java is to C++. The lesson: You can't fix a badly designed, fatally flawed language by imitating it.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
    1. Re:Reactionary languages by Bendebecker · · Score: 3, Insightful

      I know Lisp, Java, C, C++, PHP, and Prolog. First, I think your view of PHP and Perl is correct but don't ignore that fact that they are very powerful and very useful languages, regardless of their flaws. Just because PHP is simple doesn't take anything away from it, it was meant to be simple. Every language was designed with a use in mind and PHP in that theater has its uses that make it better than other languages. People don't just use PHP becuase "they are afraid to learn other programming languages." Rather most poeple use PHP because it is the best tool for the job.

      As for the rest it just seems that your pissed off that people perfer languages that aren't Ada. C++ is sort of a mess, I'll give you that, but that is mostly because they tried to keep too much of C in it. As for Java, it is a grea language. It is very readable, it is easy to write, it's OOP design (if implementing a good modularized design) makes it very easy to maintain, etc.. The developers didn't ignore programming language design, they made choices as all developers must. They had certian goals for the language in mind and they met those goals. Just because you don't like their design choices doesn't mean they didn't know how to design. You have to make trade offs as well. You can't have your cake and eat it too. I have programmed in Lisp. Java is still great. Java is an object oriented language, Lisp is a functional langauge. They have different design issues for different paradigms. As for readibility, writibility, and maintainability consider this: how many versions of Java re tehre? How many verison sof Lisp are there? Ever try to write a Lisp program that could runb in all implementations of Lisp. How about teh fact that Lisp goes crazy with (). Every try to read a Lisp program with twenty nested function calls? Even writing them and trying toi keep track of all those () are a pain in the ass.

      Go read "Programming Languages" by Kenneth Louden.

      --
      There's a growing sense that even if The Future comes,
      most of us won't be able to afford it.
      -- Lemmy
    2. Re:Reactionary languages by frodmann · · Score: 2, Insightful

      Some very strong comments. It appears that you have dabbled in these languages but not used them for anything serious.

      I use perl and its not because I'm ignorant of other languages. I've built applications using many different languages including functional languages like Haskell, logic languages like Prolog, strongly typed OO languages like Java and C++ and scripting languages like tcl, bash and perl.

      Perl has some extreme strengths, I find it useful from complex shell script and trolling log files for useful information. The wealth of modules available make it extremely easy to perform almost any task in very little programming time.

      I admit that for larger applications I would prefer to use Java as the need for more robust, reliable and maintainable applications become more important than quick development time. Java is great but you definitly need a reasonable IDE like Netbeans or Eclipse to improve your efficiency, otherwise even simple tasks can take some time.

  16. ations by Anonymous Coward · · Score: 1, Insightful
    Perl programmers like punctuation. Python programmers like indentation.

    Visual Basic programmers like masturbation.

    ~~~

  17. Re:It's not always technical by Cynikal · · Score: 2, Insightful

    i'd have to say one of the things i hate the most about VB is the huge runtimes.
    oh how much would i pay for the front end of VB that compiled to a stand alone exe comparable to asm coded executables.

  18. Language is irrelevant by The+Bungi · · Score: 4, Insightful
    As long as you have a good library and support of some type (community or corporate).

    Other than that, the language is just like the favorite couch - it doesn't really matter where you sit, but that one just happens to be more comfortable.

    That's one of the reasons .NET is cool. It provides a unified runtime library that caters to any number of languages, as long as someone has bothered to port them. The end result should always be the same. We joke about COBOL.NET, but the reality is, it's made possible by this - dare I say - revolutionary idea. Soon we'll have Python.NET, Perl.NET, Ruby.NET, PHP.NET, etc, etc.

    You will be assimilated =)

  19. Re:At the end of the day... by xdroop · · Score: 4, Insightful
    Better would be languages which are self-documenting... you don't need to read the comments because the purpose is clear anyway.

    I think that this won't happen, partially for Mr. Kringle's comment above, but mostly because there is a difference between what you do and why you did it (and again from why you didn't do it a different way). You can see function, but you can't necessarilly see the intent of the programmer. There are many times in my programs where a single line (often, less than 10 characters long) will result in several lines of comments explaining why it is done that way. That way, the poor boob who inheirits the job of extending/fixing the program (who is usually me) has a fighting chance of figuring out my intent, not just my procedure.

    --
    you should read everything on the internet as if it had "but I'm probably talking out of my ass" appended to it.
  20. Re:BASIC by sketerpot · · Score: 2, Insightful
    It wasn't so bad because it was nearly dead, rather than a huge thing that gets packaged with most office software and goes wandering around like a zombie of a language that just won't die. Why can't it be replaced by a good language like Python? (I also hear good things about Ruby, and the example programs look pretty clean. I haven't gotten around to learning it yet.) I mean, who wants to keep writing "dim" statements until the end of their days?

    Curse you, Microsoft, for resurrecting Basic.

  21. Redefining a language is essential. by rjh · · Score: 4, Insightful
    Ask any LISP programmer how well they could work if they weren't allowed to redefine the language (redefine it on-the-fly, even). Operator overloading is not bad; it's reckless use of overloading which is bad.

    If you overload + so that it suddenly means "Multiply by 34 and truncate to the nearest prime", that's not the language's fault: that's your own fault for being a damnfool idiot. Just like if you overload + for complex numbers so that it does complex arithmetic, it's not to the language's credit: it's to your credit that you used an appropriate overload.

    Look at LISP, in which pretty much any part of the language can be overloaded. Nobody's ever complained that this linguistic flexibility has harmed LISP; in fact, this linguistic flexibility is almost universally hailed as one of LISP's strengths.

    Parting thought for the overloading-is-bad crowd:

    C overloads, too.

    After all, you can do:
    float pi = 3.14159;
    float e = 2.71828;
    float result_float;
    float result_int;
    int constant = 1;

    // + defined for addition of two floats
    result_float = pi + e;
    // + defined for addition of two ints
    result_int = constant + 0;
    // + defined for addition of a float and an int
    result_float = pi + constant;

    ... I mean, come on. C overloads, so "overloading is evil" is a meme which you really ought to know better than to propagate.

    Overloading isn't evil.

    Stupid overloading is evil.

    And you will never, never, never, succeed in creating a programming language in which it is impossible to do stupid things.
  22. Re:Say What? by los+furtive · · Score: 2, Insightful

    Amen to that! I used to think that tabbing as a form of indent was a major sin, but since most IDEs these days (and every text editor worth its weight in salt) will allow you to adjust tab length/replace tabs with spaces/replace spaces with tabs, I don't see what the big deal is any more, and in fact I think tabs are a better choice.

    --

    I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  23. Re:It's not always technical by pi_rules · · Score: 5, Insightful
    I can safely predict most people here will not give it credit because of it's links to Monopolysoft.


    This is probably true, and I'm as much as an anti-MS guy as you can get really, but I have my reasons for not liking VB. I did a few projects with it in the past year (ASP/VBScript with VB COM components, MTS, etc), so I speak from experience.

    I went into it thinking it would suck, but I quickly found it being okay for gettings things done. "Hey, maybe these guys are onto something I think...". Then the project gets more complex and I realize why I like langauges that are far more strict regarding what you can and cannot do.

    • Lack of short circuiting conditionals really started to eat me up. Mostly because every other language I used (except BASIC) would short-circuit conditionals. All too often I would find myself writing complex loops using short-circuits and then realize later on I had totally blown the algorithm. I wasn't the only one either. I saw experienced VB guys do stuff like: If (objRS IsNotNull AND objRS.RecordCount > 0) Then.... Not much fun when that blows up.

    • Some consistency would be nice. I think Pascal is the only other language I've ever used that would let you declare a function in two different ways. One for returning data and one that didn't. The seperation of Sub and Function is a friggen mess. It's even worse when you realize later on you need to return a boolean out of your Sub and suddenly you have to track down everybody that called it and change the method of which you call it.... even the ones that could care less about it's true/false return. What's wrong with the return type void?

    • No macros or a precompiler. VB didnt' clean up unused objects very well for itself and one point in time, if I recall correctly, which made developers (at least at where I was) make sure they always set objects to Nothing before a failed function would return. That's find and dandy, but I hated repeating the same awkward (due to lack of short-circuiting conditionals) cleanup code in function after function that were nearly identical. Think nearly identical functions with a bit of business logic in them passing data off to a data layer for the real DB access. Each function had maybe 3-4 lines of individual code, sometimes up to 20 though. Every function though was at least 30 lines long, with the same drivel repeated over and over again. How much better it would have been to write:

      If (ErrorState = True) Then
      CLEANUPCOMMONOBJECTS
      End If

      If I had good exception and a good GC I wouldn't have even needed this though.

    • That damned VARIANT type needed for COM. Okay, this is common amonst all COM enabled apps when going across boundaries, but it really stunk if you asked me.

    • Little bugs. If you return a 'decimal' datatype from an ADODB.RecordSet and called IsNumeric() on it would you expect a true or false? Assuming the value in question wasn't Nothing, you'd assume it's true, right? Bzzzzzz!. IsNumeric(CStr(val)) would return true though. All because IsNumeric didn't understand all the possible variant datatypes that you could toss into it. Minor oversight, but it turned up a pretty decent and noticable bug in my code once. Err, wait, that was VBScript, anybody know if that happens in Real VB?


    It's a short list, but it's been a while since I coded in it.

  24. Scheme -vs- Common Lisp by SimHacker · · Score: 3, Insightful
    Scheme is the intersection of all Lisps.

    Common Lisp is the union of all Lisps.

    It's not a matter of one sucking and the other ruling. They're both much better than most other languages. Because missions come in different sizes, it's great having a choice between a light fast sports car and a huge urban assult vehicle.

    Python's design was wisely inspired by Lisp. It's somewhere between Scheme and Common Lisp in complexity, and rates extremely high on the practicality scale (integration, library support, community, portability, footprint, design focus, long term plan, etc). But Python isn't as useful as Lisp for metaprogramming (because it doesn't have a real macro system).

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  25. Delphi.. by jagilbertvt · · Score: 3, Insightful

    What we can conclude from this article is that Delphi roxors :)

  26. Re:He likes JavaScript??? by Moonshadow · · Score: 2, Insightful

    Very true, and very good points.

    I used to -despise- Javascript...then I started hacking on Mozilla/Firebird extensions. Once I realized that it was the provided API (via the browsers) that was crippled, and not the langauge, I really came to love it.

    Of course, I still hate using it in webpages.

  27. OK, Here's My List by avdi · · Score: 5, Insightful
    C
    Let's start this off nice and flameworthy: what is the point of using C anymore? Nearly any valid C program is a valid C++ program, and C++ gives me the option of selectively using much higher-level abstractions than C can support, with little or no overhead, in a much safer and easire-to-debug way than any pure-C approximation. And most of the projects which are coded in C these days shouldn't even be coded in C++; they should be coded in something higher-level like Java or Python.

    C++
    • Manifest typing is so damn verbose! If the compiler's so clever, why can't it do a little type inferencing?
    • Needs Java's inner classes to do typesafe pseudo-closures
    • All C++ compilers suck. This in itself is not the problem; the problem is that all compilers suck differently.
    • Templates are powerful, but ugly
    • C++ code is full of juicy semantic information, which all IDEs uniformly fail to exploit, making coding far more painful than it should be in such a mature language.

    Java

    • In their haste to throw out every frightening piece of "complexity" from C++, the designers managed to throw out all the expressive power as well. The result is a langauge that is so syntactically impoverished that it is actually less readable than C++, the language it sets out to improve upon. See the bloated maintenance nightmares that are used to work around the lack of enums, just as one example.
    • Ironically, by eschewing out C++'s "confusing" features, Java actually manages to be more error-prone than C++. For example, by forcing casts to be used everywhere, Java defers to runtime a whole class of errors that would never make it past the C++ compiler. This makes type errors much harder to track down, hardly a net gain for the novice programmer.

    Perl

    • Doing OO in Perl is like... doing OO in C. Sure, you can do it, but it probably won't work with anyone else's OO code, and you have to do a lot of the compiler's work yourself.
    • Perl isn't as ugly as the Python fanatics claim it is; but there's still a hard limit on how readable it can ever be. Any language where the canonical way to sort an arbitrary list is expressed as @sorted = sort { $a <=> $b } @mylist; has readability issues.
    • Figuring out what chain of braces, sigils, and arrows is needed to properly dereference a deeply nested data structure is a PITA.

    Python
    By far the biggest problem with Python is the user community. There's something about Pythoneers that make them glom onto the language with religious zeal, and then go around telling every one else that their own language of choice isn't elegant enough. Many Python users have the mistaken impression that Python is a carefully worked-out work of modern programming cleanliness like Scheme. In fact, Python was an unremarkable in-house procedural "little language" that, rather than dying the graceful death that most such languages eventually experience, was hyped to a larger audience and has been loaded down with all kinds of trendy features. Unfortunetely, due to it's humble roots, these features have gone in rather awkwardly.
    All this would be fine, in fact, it would be similar to Perl's story, if it weren't for the singular nature of Python apologists. Python is perhaps the only open-source language whose users will proudly and vehemently defend a language flaw as a feature. The best example is the post-facto rationalization of the extra "self" argument to methods, which the Python FAQ helpfully explains was simply an artifact of the way OO was hacked into an originally procedural language. This fact doesn't deter the fanatics however, who will happily tell you that it was an intentional feature and that it somehow makes Python better.
    Other examples of Python's awkward growing pains and the inexplicable attitude of it's users: the fact that Pytho defines private variables as variables whose

    --

    --
    CPAN rules. - Guido van Rossum
  28. To everyone who whines about Python's indentation: by CoughDropAddict · · Score: 3, Insightful
    I can think of only two possible reasons why Python's whitespace-significant block structure would bother people:
    • people are determined to write code that is not indented the way it looks (so that the parser will recognize a different block structure than the indentation implies)
    • people feel warm and fuzzy staring at braces and "begin/end" keywords.

    Someone please explain: why does this feature make you so upset? How could it possibly make your life more difficult to know for a fact that the interpreter sees the blocks the same way you do on the screen?
  29. What does overloading look like in English? by semios · · Score: 2, Insightful
    If operator overloading is defining a new language, then so is writing new functions.

    I disagree. New functions are just that--they're new. They do not override any preconceived notions about what they're supposed to do. Operators, however, do have preconceived notions. Imagine if we applied the same reasoning to English and said, "the conjunctions 'and' and 'or' sometimes behave differently depending on the nouns they're chaining together." All of a sudden the sentence that reads, "Beer and dogs aren't pretty," is not comprehensible unless one refers to the dictionary, where it reads:
    Beer, n.
    1. A fermented liquor made from any malted grain, but
    commonly from barley malt, with hops or some other
    substance to impart a bitter flavor.
    and:
    1. drenched or to steep in moisture; to wet thoroughly;
    to soak; to saturate with water or other liquid;
    to immerse.


    Now the sentence means, Dogs drenched in beer aren't pretty. Significantly different from the first.

    I agree that overloading operators is more powerful for the code writer, but any reading of it will generally suffer, since it relies on knowing every other object's behavior.
  30. Re:Self-documenting? by geckofiend · · Score: 2, Insightful

    After more than a few commerical projects where people don't know the meaning of whitspace (or commnets for that matter) I'll take Python's forced whitespace any day.

  31. okay, fine, I'll explain it by Anonymous Coward · · Score: 1, Insightful

    Here's how I see it:

    Appropriate use of whitespace makes code more readable. I'll give that to Python fans.

    However, the meaning of whitespace is a fuzzy thing. It shouldn't have exact meaning. Whether I happen to use 4 spaces instead of 3 shouldn't affect the syntactic correctness of my code.

    The best analogy I can think of is nonverbal language--gestures, gesticulations, etc. Gestures help in interpreting spoken language, but they are not essential to it. Waving my hands makes it clear I feel strongly about something. However, if I don't feel like waving my hands as much one moment, it doesn't affect the meaning of what I say.

    Similarly, whitespace helps visually clarify what is happening in the code. But it shouldn't be critical to interpreting the code.

    This is all compounded by the fact that whitespace, whether we like it or not, is interpreted by most people as a noncharacter. Things that aren't shouldn't be important to interpreting the things that are.

    There are all sorts of things surrounding this issue that are related to human perception and our ability to keep track of things. Whitespace is something that's just difficult for most people to keep track of. It's very similar to why most people can't can't stand Lisp: parentheses are logically a very elegant way of demarcating computational "sentences", as it were--but perceptually, they're very difficult for humans to keep track of.

    1. Re:okay, fine, I'll explain it by OneEyedApe · · Score: 3, Insightful

      I program in LISP, mostly for fun, and I don't worry that much about parens. A text editor that highlights matching parens and a bit of careful indentation allows me to mostly ignore the vast sea of ( and ).

      --
      Life sucks, but death doesn't put out at all....
      --Thomas J. Kopp
  32. Aww, no C#? I really like that one. by Gldm · · Score: 4, Insightful

    Ok begin flaming me but I love what I've seen of C# so far. I'm not a very experienced programmer, but I was forced through C, C++, MIPS assembly, shellscripts, and Java in college. Since then I've done C# and PHP on my own. So far I like C# the best.

    Why? C is an ancient ugly mess that needs to adapt or die. I'd hate to do more than a 200 line program in it because I'd get lost without objects. "Oh but you can use objects in C by doing blah blah struct blah blah kludge etc." No thanks, it took me years to figure out what the big deal with objects was and how to use them without overusing them, and I'm never going back now for anything serious.

    C++ has objects you say, but they always feel like it's grafted on to C. Granted it works, and it's still reasonably portable, which is C's main advantage these days, but some things are still just ugly. How about an array who's size you don't know until runtime? Welcome back to pointers 101. Sure you can use new and delete instead of malloc and it looks nicer, but alot of things just don't have really elegant solutions, and the standard libraries are too sparse for what modern apps do with modern languages.

    Java... everything you hate about C++ fixed the wrong way! Yay we have big useful libraries now... but they're constantly changing, bitching that what you just used is now "depreciated", doing things you're not allowed to do etc. No I do not want to use something called "vector" to replace a linked list, give me a freaking "linked list" object! Even if it's just a renamed vector at least it doesn't confuse people into thinking I'm going to have calculus and matrices popping out in the next few lines. This may have been the fault of my instructor but he loved crap like this. "Don't use the Stack class, use vector to make your own stack!" Oh and just because I don't want to do something with pointers if I can help it doesn't mean I don't EVER want to use pointers, I'd like to code without a babysitter please. If I screw up at least it's me to blame. Everything must be a class! Umm yeah that's great when I just want a struct with an int and a float so I don't have to write half a dozen methods to implement a "proper" class with private data and constructor and operators and copy... Put up with all this and you're rewarded with 10x slower performance and maybe cross-platform execution on alternate tuesdays when it's raining and the moon is waxing.

    PHP seems nice, though I haven't really written much of anything in it yet. Some things kinda weird me out like how nothing cares if your variable is an int, float, string, etc. It's kinda nifty but extremely unsettling at the same time. At least it's easy to spot variables since they all start with $. I really don't have much else to say about it yet.

    By now everyone's waiting for why I like C#. I like it because it fixes the things I hate about C++ and Java and just seems to make everything work smooth. Want to use pointers? Sure, just put it in an unsafe section for the over paranoid. Want to use objects? It's easy. Want to do threading? We've got this easy to use library for it. How about resize an array? No problem. Arrays remember their own sizes. They can even sort themselves. They can even sort themselves and another array at the same time based on the values in the first array (someone PLEASE show me how to do this with qsort() in C++ elegantly). Networking? Got it. Performance? Eh, about 20% hit from C++ on my machine, less if you use ngen to precompile it. Still too bad? Ok, put your critical sections in C++, C, or even ASM libraries and link them seamlessly. GUI apps? Tons of easy to use stuff there, though it's mostly windows specific. The downside is you don't get the portability of other languages... yet.

    --

    Introducing the new Occam Fusion! Now with sqrt(-1) fewer blades!

    1. Re:Aww, no C#? I really like that one. by Tim · · Score: 3, Insightful

      "C++ has objects you say, but they always feel like it's grafted on to C....some things are still just ugly. How about an array who's size you don't know until runtime? Welcome back to pointers 101."

      Uh...

      std::vector v;
      v.resize(some_value_from_somewhere_else);

      I don't see a pointer anywhere in there.

      --
      Let's try not to let fact interfere with our speculation here, OK?
  33. Re:Pretty limited scope by NetSettler · · Score: 4, Insightful

    I'd have trouble calling C's type system "strong", personally.

    Well, there's strong like Gandhi and there's strong like a bull in a china shop... The term is a bit vague and so I don't begrudge them its use as long as Lisp gets to use another.

    --

    Kent M Pitman
    Philosopher, Technologist, Writer

  34. Re:Pretty limited scope by Tom7 · · Score: 2, Insightful

    Maybe I was also put off by the fact that the author's statement, that "Lisp is very much the lambda calculus".

    Yeah, he pretty much lost all credibility with me there. Basically anyone who's used modern lisp knows that the language has mutated far beyond its initial inspiration by the lambda calculus. And, indeed, anyone who's studied the lambda calculus knows that lisp gets its static scope wrong--and in a language as minimal as the lambda calculus, that's enough to hardly make them related.

    The author seems to name drop functional and logic programming languages to make it seem as if he has programmed in more than just C-derived languages, yet what little he mentions indicates that he doesn't have more than a general knowledge that such languages exist. (Functional languages have no variables??)

  35. Re:Self-documenting? by Bob+Munck · · Score: 3, Insightful
    I haven't used ADA, but I understand that it is somewhat designed for self-documenting code, and that as a result you are hemmed in on all sides by language rules.

    Ada allows you to write what your program does as code. Most other languages make you kind of sneak up sideways on what you want the program to do, tricking the language into doing your desire. Then you have to add comments to say what it is you really wanted. I write quite a few comments in programs to remind myself (and in some circumstances others) what the program does. In Ada, I'll write the code, look at it, realize that it says what it does, and not need to write comments. My best code has no comments, and no need for them. (Except for hypertext pointers to design and requirements documents.)

    I don't understand about the "hemmed in on all sides by language rules." Ada has fewer rules than, for example, Java. That is, the syntax and semantics can be expressed in significantly fewer definition constructs (BNF, VDL, whatever). For me, moving back to Ada after a stint programming in Java or C++ is like coming out of a dark and stuffy room into a nice spring afternoon.

    Python was designed by a guy who is both a computer geek and a math geek.

    So was APL. Ever seen APL? It's essentially encrypted at the source.

  36. Try this some day: by avdi · · Score: 3, Insightful

    Take a hundred-line snippet of Python code. Stick it into a web page. Copy&paste the web page to an email. Post the email to a programming mailing list. Have a lengthy thread about the code, quoting and requoting the original.

    Now, let an intermediate Python programmer try to take the mangled code from the end of that thread and reformat it so that it works as intended. If it were in a language with explicit block syntax, chances are it would run as intended with nothing more than the removal of any quoting prefixes that mail clients have added. And a decent programmer would be able to whip up a script that would automate the transformation from mangled code into nicely indented code. Not so for the Python code.

    The problem is not so much that whitespace is signifigant by default; it's that there is no way to modify this behaviour in order to generate "portable" code which can survive whitespace mangling.

    But frankly, all things considered, whitespace signifigance is by far the least of Python's worries.

    --

    --
    CPAN rules. - Guido van Rossum
  37. Why I Hate VB 6 by Anonymous Coward · · Score: 1, Insightful

    VB6 Error handling is pathetic.

    on error resume next
    if (0/0=5) then Msgbox "Yes, 0/0=5"

    Because the evaluation blows up, the next instruction (yes, the condition!!) executes!
    - - - - -
    Nulls are big trouble...
    Result=Strin & " This won't be concatenated"
    The correct way to fix it is...
    Result=(Strin & "") & " An empty one works??"
    - - - -
    The whole language is inconsistent, illogical, and worst of all, almost downright compatible to GW Basic, and of course QuickBasic.
    - - - -
    VB components/OCX's aren't descendant classes, they're individual objects (ok, OLE descendants). If you already know Kylix or Delphi, you will hate all the inconsistency. At least DAO/ ADO/ ODBCDirect/ Whatever-name has some hirearchy. Even MS Access is somewhat more organized.
    - - - - - -
    Anyway, maybe the real VB virtue is that it's usful with those common "Our client gave one month, last month. Today we tell you you have two days to design and program a working demo".

    MS Access let you do quicker prototypes, altough it's very tricky, and it has some nasty limitations. Reports are much much easier to do than VB's. Of course, with complex databases and more than 8-10 users, you must forget the nice wizards and begin thinking how to avoid LAN congestion.

    Delphi is much better, altough Pascal is very strict and the database part is somewhat more difficult to use.

  38. Re:define "good" by Anonymous Coward · · Score: 1, Insightful

    Corrections:

    - PHP can be used in a non-web application. Why do you think they have GTK linkage? I run PHP cron jobs every day.

    - "PHP just doesn't cut it"? What kind of statement is that?

    - PHP is no less maintainable than Python.

  39. Please define a programming language. by ressu · · Score: 2, Insightful

    What amazed me most in the article was that XSLT was included as a programming language. Even though the definition for programming language is as follows (from WordNet):

    programming language
    n : (computer science) a language designed for programming computers [syn: {programing language}]

    And even if at some level XSLT matches that. I still think that XSLT is not a programming language and in such shouldn't be judged by it's format. eXtensible Stylesheet Language, is by it's name a way to define a style for an XML document, and it's not for programming applications.

    Although, i agree that XML is not the best way of representing applications and XPath itself is quite complex to use for even the simplest queries.

  40. Re:At the end of the day... by RevAaron · · Score: 2, Insightful

    Perhaps that (bad code available everywhere) is part of it... but a big part, perhaps more important, is the environment. Most programmers think an IDE is something that gets in the way, or simply gives you a hotkey for running make. With Smalltalk (or Lisp, Dylan and other languages with a badass IDE), the IDE very much contributes to this self-documenting aspect. Hell, I'd go so far as to say that a well-done IDE is 50% responsible for making a language self-documenting. Most of the rest if a simple language with sensical stylistic traditions.

    But yeah, it certainly doesn't help when people simply download packages written by others which are poorly done. Especially when both the the interface/API is bad and the code is messy, no good.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  41. Re:Self-documenting? by Mooncaller · · Score: 2, Insightful

    I really don't care if no one uses Ada right now. It has got so many advantages over C that it is well worth learning. I use it for my personal coding. I have several projects cooking. Once they are stable ( and documented, even Ada need good documentation!) I will be releasing them GPLed. If the community ignors them because of the language, so be it. I don't care. I want secure maintainable code. The only real problem with Ada is that which is common to all strongly typed languages and that is it is easy to get carried away defining types. As more project leaders come to the conclusion that the most of the problems with modern code can be traced to errors that are a direct result of the characteristics of C/C++, the appeal of Ada will increase. The only other contender is Java but it carries too much baggage.