Slashdot Mirror


Comparing the Size, Speed, and Dependability of Programming Languages

In this blog post, the author plots the results of 19 different benchmark tests across 72 programming languages to create a quantitative comparison between them. The resulting visualizations give insight into how the languages perform across a variety of tasks, and also how some some languages perform in relation to others. "If you drew the benchmark results on an XY chart you could name the four corners. The fast but verbose languages would cluster at the top left. Let's call them system languages. The elegantly concise but sluggish languages would cluster at the bottom right. Let's call them script languages. On the top right you would find the obsolete languages. That is, languages which have since been outclassed by newer languages, unless they offer some quirky attraction that is not captured by the data here. And finally, in the bottom left corner you would find probably nothing, since this is the space of the ideal language, the one which is at the same time fast and short and a joy to use."

491 comments

  1. what about APL by goombah99 · · Score: 2, Insightful

    APL was faster than C and there has never been a more terse language.

    --
    Some drink at the fountain of knowledge. Others just gargle.
    1. Re:what about APL by Anonymous Coward · · Score: 1, Informative

      APL was faster than C

      Citation needed.

      no citation needed. it's matrix driven so it naturally optimizes loops better.

    2. Re:what about APL by Anonymous Coward · · Score: 1

      Generally it's up to the one who makes the claim to provide the evidence, but whatever floats your boat.

    3. Re:what about APL by DavidHumus · · Score: 1

      One language that might be terser is J: see jsoftware.org.

      For instance, Newton's method is written

      N=: 1 : '- u % u d. 1'

      (see http://www.jsoftware.com/jwiki/Essays/Newton's Method)

      However, about the claim of APL being faster than C, this is only true if you're talking about development time (which may be the most important metric). An interpreted language like APL or J might approach the execution speed of C for operations on large arrays but the interpretive overhead will always impose a performance penalty.

    4. Re:what about APL by mdmkolbe · · Score: 4, Informative

      If you would like APL to be on the list, then submit benchmarks for APL to the Shootout (the blog got its data fro there). The Shootout is mainly driven by user submissions. They do have some fairly strict rules about how to submit. However, if you can name an implementation (along with enough guidelines to make installing it easy) and provide a reasonably full set of benchmarks, then the language will generally be added.

      One tip about submitting though: try to make life as easy as possible for the guy who runs it. He doesn't have time to figure out typos or to fix "easy" bugs in some programming language they he may not even know.

    5. Re:what about APL by goombah99 · · Score: 1

      APL has compilers

      --
      Some drink at the fountain of knowledge. Others just gargle.
    6. Re:what about APL by Anonymous Coward · · Score: 0

      It is trendy to say [Citation needed] as some asshats think the wikipedia references are funny and intelligent. So that AC failed...

      It would be too nice if they would put in the effort to put in references for their conflicting position or to back up original poster... But it is so much easier to make snarky comments, eh?

    7. Re:what about APL by Twinbee · · Score: 1

      Is it less verbose in line or character count?

      Or on a word/symbol level, which I would think is more important...

      --
      Why OpalCalc is the best Windows calc
    8. Re:what about APL by Anonymous Coward · · Score: 2, Funny

      But it is so much easier to make snarky comments, eh?

      [citation needed]

    9. Re:what about APL by Anonymous Coward · · Score: 0

      Are you really just complaining about the specific term "citation needed"?

      Is this really just you being pissy about Wikipedia? -- or perhaps it's about you being pissy about a current meme?

      If rbarreira had instead used the phrase "evidence please" would that have kept your "pissy" button un-pushed?

      if there were no such thing as another mindless Slashdot meme where people pat themselves on the back for following the groupthink and saying "citation please" like everybody else, and he still asked for evidence, then that would keep my pissy button unpushed. its not what was done, its how and why it was done. this cant be so hard to understand

    10. Re:what about APL by HiThere · · Score: 1

      Both actually. But this presumes that you're doing something appropriate to the language. I studied it for a month one time, but never felt impelled to go any further. It was designed before GUIs, and at it's peak of popularity was a mainframe end-user language. So no libraries (that I know of) have been written specifically for handling GUIs in APL. This means that you need to depend on Foreign Function Interfaces (FFI). "YUCK!", to quote me. I've never seen one of those that was cleanly implemented. (D to C is close, but only close. There's also Ada to C, which is nearly good. For the rest [of those I've tried to use], "YUCK!".)

      OTOH, I've got to admit that I never tried to use APL's FFI. Or J's. Perhaps they're decent. But that's not the way I'd bet.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    11. Re:what about APL by Anonymous Coward · · Score: 0

      So this is really about you inferring motive into rbarreira 's post, not about what rbarreira actually put into that post.

      In other words, it's about your pissy-ness, not about anything that anyone else actually said.

    12. Re:what about APL by Anonymous Coward · · Score: 0

      FWIW, the word "snarky" and its derivations are another annoying trendy /. meme.

    13. Re:what about APL by jd · · Score: 1

      It's interesting that Occam (I presume they used the KROC implementation, owing to the lack of handy transputers) outperforms C in some situations. Occam is designed to be highly parallel, etc, etc, ad nausium, but it hasn't had nearly the same level of development work and optimization work as C.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    14. Re:what about APL by Hucko · · Score: 2, Interesting

      Snarky et al are ancient words used up to the 60s; their resurgence can only make me hope that we are potentially seeing the return to precise use of language. This would be a fantastic event; a reversal of the trend to the dilution of semantics and language in general.

      Of course my use of 'et al' is symptomatic of this, as is the common use of acronyms for everything... Ah weel, it was a nice idea while it lasted

      --
      Semi-automatic amateur armchair Australian philosopher; conjecture ready at any moment...
    15. Re:what about APL by Deliveranc3 · · Score: 1

      Can't you simply output some CSS2 and do a web based GUI? That seems to be the best solution to a lot of these programming issues.

    16. Re:what about APL by V!NCENT · · Score: 1

      "Generally it's up to the one who makes the claim to provide the evidence, but whatever floats your boat."

      --
      Here be signatures
    17. Re:what about APL by V!NCENT · · Score: 2, Insightful

      Citation needed.

      --
      Here be signatures
    18. Re:what about APL by V!NCENT · · Score: 1

      Dude... /. is a newsified message board. Nerd stuff ok, but if someone is stating the obvious then it can be fscking irritation to get the "Citation needed" whinetrain going by ever freaking statement. Either disprove or shut up because there is thing thing called Google and it can search for you.

      What you basicly saying is: "Google for my lazy ass please, because no reasob given"

      --
      Here be signatures
    19. Re:what about APL by Bastard+of+Subhumani · · Score: 1

      Nobody on Slashdot cared about that until it got trendy to say "citation needed" as though this were Wikipedia and you know it.

      You have reliable proof of that?

      --
      Only three things are certain; death, taxes, and apocryphal quotations - Ben Franklin.
    20. Re:what about APL by DavidHumus · · Score: 2, Insightful

      Some of us have submitted programs in APL, or its younger sibling J, to the shootout (see http://www.mail-archive.com/general@jsoftware.com/msg02859.html). However, since the rules of the shootout specify the algorithm you have to use, you end up writing C programs in APL or J which is no way to take advantage of the power and expressiveness of these languages.

      It's like taking part in a poetry contest where you're only allowed baby-talk.

    21. Re:what about APL by Kazoo+the+Clown · · Score: 1

      APL may have compilers, but it often doesn't need them because the language is so terse that it spends very little time interpreting and most of its time in the core functions shuffling and manipulating arrays. At least that's the case if it's programmed by someone who understands the language and not someone trying to mimic a classic procedural interpreted language like Basic with it.

      Many APL "interpreters" compile each line as they are entered, by converting it from parenthesis notation to RPN (the early STSC APLs for IBM mainframes did this, at any rate), so that it could execute it more quickly at runtime, and numeric data is converted to binary or floating point values. These "interpreters" when editing would decompile the stored RPN and recompile it within the line editor. The resultant "interpreted" execution then becomes simple push-push-call-push-call-push-call, etc.. The interpreted overhead is pretty minimal unless you're needlessly iterating rather than using the array capabilities of the language.

  2. Why is Verbosity Bad? by eldavojohn · · Score: 5, Insightful
    This plots verbosity against slowness making:

    And finally, in the bottom left corner you would find probably nothing, since this is the space of the ideal language, the one which is at the same time fast and short and a joy to use.

    I must ask why the author assumes that verbosity is bad and why lack thereof makes it a "joy to use."

    I think verbosity in moderation is necessary. I have read many an article with developers arguing that they don't need to document their code when their code is self-documenting. Do you make all of your variables and class/function/methods a single character for the sake of verbosity? I hope not. And I would think that reading and maintaining that code would be far less than a joy.

    I don't even need to argue this, according to his graphs we should all be using Regina, Mlton or Stalin (a scheme implementation). But instead languages like Java and Perl and C++ prevail. And I would guess that support and a mediocre range of verbosity are what causes that.

    Great work in these graphs! But in my opinion, verbosity when used in moderation--like a lot things--is far better than either extreme.

    --
    My work here is dung.
    1. Re:Why is Verbosity Bad? by xZgf6xHx2uhoAj9D · · Score: 5, Insightful

      I agree totally about the need for verbosity. I'm a fan of Donald Knuth in this regard.

    2. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      My guess is that the benchmarked code is assumed to have pretty much the same "verbosity density", so code size then directly reflects the ability of the language to express ideas concisely. Example...

      Pascal:
      itemCounts[ProductIdFromName(name)] := itemCounts[ProductIdFromName(name)] + 1;

      C:
      itemCounts[ProductIdFromName(name)]++;

    3. Re:Why is Verbosity Bad? by maxume · · Score: 1

      Counting characters is a lot less interesting than counting symbols. Of course, a language with too many symbols will be more obscure than one that makes somewhat repetitive use of a smaller set of symbols, so the whole thing is still pretty subjective.

      --
      Nerd rage is the funniest rage.
    4. Re:Why is Verbosity Bad? by jbolden · · Score: 4, Insightful

      Look where those languages are on the chart.

      Java mostly against the left wall (i.e. mostly as fast as C). Perl right against the bottom (i.e. very small code).

      It appears to me what this showed was that people like the walls.

    5. Re:Why is Verbosity Bad? by ucblockhead · · Score: 5, Insightful

      The author is not talking about verbosity in bytes. He's talking about verbosity in code points. Talked about in this way, a thirty character variable name is no more verbose than a single character variable name.

      --
      The cake is a pie
    6. Re:Why is Verbosity Bad? by ClosedSource · · Score: 2, Insightful

      Overloading symbols is often a negative aspect. C would be a much easier language to read if "*" had a single meaning.

    7. Re:Why is Verbosity Bad? by A+beautiful+mind · · Score: 4, Funny

      It appears to me what this showed was that people like the walls.

      True enough, but my favourite is Larry Wall.

      --
      It takes a man to suffer ignorance and smile
      Be yourself no matter what they say
    8. Re:Why is Verbosity Bad? by nametaken · · Score: 2, Interesting

      It didn't seem to me like being concise or verbose was a help or hindrance aside from his comment. Per those graphs I could say I want something as fast as Java (how often have you heard that on /.), but a little less verbose... "oh, csharp might be worth a look".

      I found it interesting.

    9. Re:Why is Verbosity Bad? by Twinbee · · Score: 1

      Perhaps Java, C++ and Perl prevail because they're more established. It doesn't mean they're necessarily objectively better.

      The other factor is that although variable names are often useful if they're long, 'verbosity' can/should count the number of 'words' (and symbols?) in the code, which is obviously shorter than a line, and longer than a single character. I hope he's taking this into account.

      --
      Why OpalCalc is the best Windows calc
    10. Re:Why is Verbosity Bad? by lethargic8 · · Score: 2

      Perl prevails?

    11. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 1, Interesting

      Regina(Rexx) is a pretty fast and clear language. My only issue with it is how other functionality has been added such as SQL and network connections as their implementation(or maybe their documentation since there seems to be very little) doesn't seem quite as clear as using, say, PHP or Ruby. If they'd get more than a couple of developers working on the project, it could be easily transformed into something far more useful.

      That said, for 2 years I ran a website entirely off of Regina(or maybe it was ooRexx..basically the same thing) and despite the limitations of the machine it was running on, it performed faster than any other scripted site I ever visited. These days with the heavy AJAX and java implementations, it'd run circles around them.

    12. Re:Why is Verbosity Bad? by mdmkolbe · · Score: 1

      I recall seeing a study that showed that bugs per line of code(*) was fairly constant across languages. (Anyone know what study that was?) Thus the fewer lines of code(*) in your program the fewer bugs. Thus more expressive languages are better.

      At least that's what the study claimed.

      (*) Assuming you don't "cheat" by not breaking your lines where normal programmers would.

    13. Re:Why is Verbosity Bad? by Len · · Score: 1

      There seems to be an assumption in the article that "verbose" means "difficult to write" or "hard to understand". This isn't always true, in my experience. APL, for example, can be used to write programs that are masterpieces of concision, but understanding them is like solving Sudoku puzzles. Which can be fun, but isn't a productive use of a programmer's brainpower.

    14. Re:Why is Verbosity Bad? by tknd · · Score: 3, Insightful

      There's good verbosity and bad verbosity. Let's take for example java's System.out.println. This is bad because it is such a common function that you are bound to use it over and over again but good of course because you know it is not a keyword (it comes from the System.out library). The result is something twice as long as it needs to be and chews up screen space. As a human reader of the source, this becomes cumbersome and harder to read the full program.

      Languages that can allow you to pull in identifiers from other scopes can solve this issue while reducing the bad kind of verbosity. For example in perl there is something called Exporter which allows defined symbols by the source package to be imported into the current scope through syntax like:

      use Some::Package qw( someFunction );

      Now instead of Some::Package::someFunction, for the rest of the file I can just do someFunction since I've already declared I'm importing it at the top. If the reader is interested in knowing where someFunction comes from, searching from the top of the file will reveal the use Some::Package qw( someFunction ); line.

    15. Re:Why is Verbosity Bad? by rah1420 · · Score: 2, Insightful

      (*) Assuming you don't "cheat" by not breaking your lines where normal programmers would.

      And that's why I've often used "ELOC," or Executable lines of code.

      An
      ELOC
      metric
      for
      this
      would
      count
      this
      as
      a
      single
      sentence. :)

      --
      Mit der Dummheit kämpfen Götter selbst vergebens.
    16. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      according to his graphs we should all be using Regina, Mlton or Stalin

      I see the graph pointing me to the religion of Occam.

    17. Re:Why is Verbosity Bad? by bcrowell · · Score: 2, Insightful

      The justice or injustice of your comment depends strongly on what metric they're using for size, and a lot of the replies to your comment have been speculating about what the metric really is. Okay, if you start with the game's FAQ, it looks like there are three different metric they actually computed:

      1. size of the source code, in bytes
      2. "gzip bytes," which they define as follows: "We started with the source-code markup you can see, removed comments, removed duplicate whitespace characters, and then applied minimum GZip compression."
      3. amount of memory used when running

      Obviously these are going to give completely different results. Java will come out looking awful by measure #3, for instance. The difference between #1 and #2 has more to do with the distinction between terseness and expressiveness. You wrote "Do you make all of your variables and class/function/methods a single character for the sake of verbosity? I hope not." If someone did that, it would have a huge effect on #1, but little or no effect on #2. Actually #2 seems to me like a very reasonable measure of expressiveness.

      So now the question is which one the author of the article actually used for his plots. He doesn't say explicitly which one he used. However, he has links to the source code he used to generate the plots, and to the data file he used as input. The data file only has metrics #1 and #3, so it looks like he didn't actually use metric #2, which IMO is the only one that measures expressiveness in the way he obviously intended. If you look through his lisp code, it looks to me like he actually used #1. (See the line that reads "(normalize-accross (normalize-accross data 'cpu) 'size))". My lisp is pretty weak, but I believe he's extracting the columns whose names begin with the strings "cpu" and "size.")

      So it looks to me like he picked the wrong metric, which makes your criticism valid, but that just means he should have picked the right metric.

      Even the right metric, #2, still wouldn't be a perfect proxy for expressiveness, of course. For instance, a language with static typing and no type inference will require the programmer to expend a lot of characters on declarations. However, that's a matter of taste; some people feel safer with static typing.

    18. Re:Why is Verbosity Bad? by johanatan · · Score: 0

      How about a little more variation on word selection? If I read the word 'verbosity' one more time (especially when it is not even the correct word), I think I'll puke.

      Here's a few more you might want to throw in next time:
      [conciseness, terseness, succinctness, expressivity, etc]

      Of course, given your love of 'verbosity', these words may not be your most cherished (but remember to negate where necessary).

    19. Re:Why is Verbosity Bad? by ls671 · · Score: 1

      I disagree with you, I hate trying to find where the heck a given method comes from, not to mention possible name clashing issues.

      Think also about debugging, testing and maintainability once you are done writing your code and you leave the project.

      --
      Everything I write is lies, read between the lines.
    20. Re:Why is Verbosity Bad? by timeOday · · Score: 5, Insightful

      I'm not sure we're sharing a definition of "verbosity. Perhaps the useful definition here is "the inverse of expressiveness." Of course expressiveness is inherently relative to what is important in a given application. For most purposes, assembler is hopelessly verbose, or lacking in expressiveness, since most of what you're writing out is meaningless detail. But for certain other purposes (performance) those details become crucial, so for that application only assembler has the necessary expressiveness. Again, I am not contradicting myself by saying assembler is both lacking in expressiveness and high in expressiveness, it depends on the application. I've heard German is a fantastic language for writing technical legal documents, whereas the Inuit language is supposedly very good for describing cold weather and snow.

    21. Re:Why is Verbosity Bad? by s_p_oneil · · Score: 2, Informative

      verbosity != self-documented

      Ruby example:
      do_something() if some_time 7.days.ago

      To me, this line of Ruby code is perfectly clear and self-documented. It is also about as short as you could make it. If I had to write the same code in Java, it would be long enough that I would feel it required a comment.

    22. Re:Why is Verbosity Bad? by A.Gideon · · Score: 2, Insightful

      There's "verbosity" and there's "verbosity".

      One form - which is I think how the original article used it - is that individual statements accomplish little work. For example, they move a byte into a particular location in contrast to languages which have statements that do things like apply filters to lists' content. These are languages which require verbosity on the part of the author to accomplish work.

      These are more work to write because one must break tasks down further. They're also more work to read because the reader must assimilate a greater number of statements to grasp the work being performed from a higher level perspective.

      Another form of verbosity is intended to provide additional context for subsequent readers of code. APL can provide the counter-example of this, where code can be so terse that the original intent is lost.

      Too many still forget that the time of the reader of the code is more valuable that the time of the writer in most cases, for the simple reason that there's one writer but many readers (including the writer him/herself a few days/weeks/months/years later *grin*). Making code that's easier to read is important for maintenance and extension.

      That kind of verbosity is a Good Thing.

    23. Re:Why is Verbosity Bad? by zacronos · · Score: 1

      I don't even need to argue this, according to his graphs we should all be using Regina, Mlton or Stalin (a scheme implementation).

      Not saying I disagree with your post as a whole, but if you had RTFA instead of just glancing at the graphs, you would have noticed the author mentions

      The bottom left three languages, Cmucl, Regina and Stalin are outliers. These languages do not have enough benchmark implementations in the database to generate fully fleshed stars.

    24. Re:Why is Verbosity Bad? by A.Gideon · · Score: 1

      In general, I agree with the disagreement. The ability to replace Some::Package::someFunction() with someFunction() saves the writer time, but it costs time later. The reader needs to do more work to determine from where the function comes, for example.

      And since there are typically many readers but only one [original] writer, the time of the reader is more valuable.

      The points about name clashes and such are also good.

      On the other hand, what happens when some maintainer wants to replace Some::Package::someFunction() with Some::Other::Package::someFunction()? Multiple points in the code to be changed vs. one point? Recall that each change adds a potential bug.

      A compromise:
            $f = Some::Package->new();
            $f->someFunction();

      might make sense if someFunction() is used repeatedly. But even this is imperfect, in that the new() may be sufficiently distant from the ->someFunction() that it's not a lot better than "use" in terms of readability. But at least it avoids namespace conflicts.

      Engineering: The Art of Tradeoffs.

    25. Re:Why is Verbosity Bad? by Limerent+Oil · · Score: 1

      Mod parent up. Very well put.

    26. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      No language is going to stop you from using long and verbose variable names and put lengthy comments. However a language should *not* force you to be redundant and overly verbose. This is what it is about.

    27. Re:Why is Verbosity Bad? by s_p_oneil · · Score: 1

      Woops, my less-than symbol disappeared (even in plain text mode).

    28. Re:Why is Verbosity Bad? by K.+S.+Kyosuke · · Score: 2, Insightful

      Why should I mod up a statement like "verbosity is the inverse of expressivenes" when I disagree? And I don't think I am the only one unless "expressiveness" means something completely different than I thought. Unfortunately, there seems to be no formal definition, but I like the approach outlined in Felleisen's On the Expressive Power of Programming Languages.

      For example, I consider Scheme more expressive than, e.g., COBOL (at least the older standards, haven't seen the newer ones), since COBOL has no notion of lexical closures, first-class functions etc. On the other hand, Bourne shell does not have these notions either, yet shell scripts tend to be quite compact when applied to tasks for which shell is a suitable tool. Scheme actually has to go out of its way if you want to write equivalent scripts of comparable length in it, which is why projects like scsh have emerged. I find it really difficult to correlate expressiveness and verbosity in any simple way.

      --
      Ezekiel 23:20
    29. Re:Why is Verbosity Bad? by K.+S.+Kyosuke · · Score: 1

      I disagree with you, I hate trying to find where the heck a given method comes from, not to mention possible name clashing issues.

      Think also about debugging, testing and maintainability once you are done writing your code and you leave the project.

      That does not make any sense. "Pulling" objects from modules into the current namespace is well handled in modern languages that sport this feature (Haskell, Python, even Perl, as you san see). If you have problems with shadowing, you either have a lousy compiler or you're unable to use it. Your compiler can tell for every name where it comes from. Your editor or IDE can resolve the same and show you (in a tool tip, for example). If they can't, they deserve some fixing.

      --
      Ezekiel 23:20
    30. Re:Why is Verbosity Bad? by KasperMeerts · · Score: 1

      If you have a problem seeing the difference between a multiplication and a pointer dereference, you really shouldn't be programming in C.

      --
      As long as there are slaughterhouses, there will be battlefields.
    31. Re:Why is Verbosity Bad? by cryptoluddite · · Score: 3, Informative

      2. "gzip bytes," which they define as follows: "We started with the source-code markup you can see, removed comments, removed duplicate whitespace characters, and then applied minimum GZip compression." ... actually #2 seems to me like a very reasonable measure of expressiveness

      I'm not so sure about that. For instance, their preprocessing effectively gives Python free blocks, by removing repeated spaces but not removing { and } from other languages. What they should do is:

      1. remove all comments

      That's it. You don't need to remove whitespace at all... gzip will compress 10 spaces to roughly the same as 1 space, if it's regular, but reducing 4, 8, 12 runs of spaces to 1 will affect the compression. You don't need to rename variables, because AReallyLongVariable used a dozen times will be amortized away if it is used often... it won't affect the gzip size much more than calling it 'a1'. They should also use maximum compression (that's the point of compressing it in the first place, to reduce it to the essential structure)... they should use 7zip or rar. So IMO their preprocessing of the source is creating a misleading metric.

    32. Re:Why is Verbosity Bad? by bcrowell · · Score: 4, Informative

      whereas the Inuit language is supposedly very good for describing cold weather and snow.

      That's a myth.

    33. Re:Why is Verbosity Bad? by ChrisMaple · · Score: 3, Insightful

      One thing in C that many people complain about is that it's too easy to get in trouble with pointers. Part of this problem is due to the way that pointers are declared often looks different from the way pointers are used, particularly if pointers and array indexes are freely interchanged. The confusion is due to a poorly chosen system of expression.

      --
      Contribute to civilization: ari.aynrand.org/donate
    34. Re:Why is Verbosity Bad? by bcrowell · · Score: 3, Informative

      The author is not talking about verbosity in bytes. He's talking about verbosity in code points. Talked about in this way, a thirty character variable name is no more verbose than a single character variable name.

      That's incorrect. He is talking about verbosity in bytes. Take a look at his source code and the data file he used, which are linked to from TFA.

    35. Re:Why is Verbosity Bad? by PPH · · Score: 1

      Because the subcontractor charges based on lines of code delivered and some PHB is getting his panties in a bunch over the fees?

      --
      Have gnu, will travel.
    36. Re:Why is Verbosity Bad? by harry666t · · Score: 1

      What would be an ELOC count for a single Python expression that would span fifty lines?

    37. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      Seems fitting as the quote

      I dunno, I dream in Perl sometimes... -- Larry Wall in

    38. Re:Why is Verbosity Bad? by ArcadeNut · · Score: 4, Insightful

      verbosity != self-documented

      Ruby example:
      do_something() if some_time 7.days.ago

      To me, this line of Ruby code is perfectly clear and self-documented. It is also about as short as you could make it. If I had to write the same code in Java, it would be long enough that I would feel it required a comment.

      This is where so many programers go wrong. The code is self documenting in the respect that you know it's checking the age of something to see if it was 7 days ago, but you have no idea WHY it's checking that. Why not 6 days ago? What if it's 8 days ago?

      Comments should say WHAT and WHY you are doing something not HOW you are doing it. The HOW is the code itself. If someone was to look at that code, do they know what your intent was? Were you looking for something that was exactly 7 days old, or something 7 days old or older.

      --
      Visit the Arcade Restoration Workshop @ http://www.arcaderestoration.com
    39. Re:Why is Verbosity Bad? by BikeHelmet · · Score: 1

      I'm a fan of verbose variable and method names, but simplistic symbol usage.

      I find languages like C have far too many unnecessary symbols. Stuff like <<, >>, ->, ::, etc. could all be replaced by dots, plusses, etc., and the compiler could figure it all out. Apparently there's even a few IDEs (like QT Creator) that can automatically do it to make it easier on programmers more familiar with other languages.

      Code should be readable.

      function plotResults(int[] Results)
      {
      if(verifyLength(Results))
        {
        resultsGraph.reset();
        resultsGraph.plot(Results);
        }
      }

      Most languages can be coded in such a way, but I do find excessive amounts of symbols(C/C++) or keywords(Java) does cloud the cleanliness of the code a bit. And I myself am not in the "Genius OS coder" developer bracket, so having to remember what extra symbols C requires actually distracts me from the design of the program.

      I do better in languages with less symbols. Javascript is my best language (I've completed whole 5000 line projects without a single error; once I'm done writing it, it works as predicted), and Java is next best. With Java I usually have a few errors per 1000 lines, always caught the next day when I look through my code with a clear head, unless it's UI code. (I have trouble debugging swing crap :P )

      And C... oh hell, you don't want me writing C. I can debug it and spot errors just fine, but I can't write code that compiles for the life of me. I always forget something, which causes the compiler to spit out error messages all day long, or at least until someone bails me out by telling me what I forgot.

      I guess our minds all work different. Although mine is very technical and doesn't have a problem understanding what the code is doing, it wants the code in a specific style if possible, and it doesn't want to write styles it doesn't like. (mostly C)

      One last note - I recently overheard someone ranting about the usage of indenting in Python. All my code is properly indented, so it would be trivial to remove the {} brackets from my Java code, if Java supported it. Yet more evidence of what languages work for my mind. ;)

    40. Re:Why is Verbosity Bad? by KangKong · · Score: 4, Informative
    41. Re:Why is Verbosity Bad? by s_p_oneil · · Score: 1

      Your post is off-topic relative to the point I was making (and to the point I was refuting). That one line of Ruby code by itself would not need a comment explaining WHY. It would be part of a small function or code block that would need a comment explaining WHY. That comment would not be specific to this one line of code, which is why your argument seems off-topic to me.

      My point was that if you needed 10 lines of code (perhaps in C) to make a simple check like that, you would need an additional comment to explain WHAT those lines were doing. If you needed 100 (perhaps in assembler), you would need comments for each logical block you broke it up into, and then another to encapsulate the whole thing. The larger a block of code must be to do something, the more likely you are to need additional comments just to explain WHAT the code is doing. It goes without saying that those extra lines of code make it easier for bugs to slip in, and make the program harder to maintain. If the language you're using requires such verbosity everywhere, then it becomes a more expensive program to write and maintain (sometimes it is necessary, but sometimes it is not).

      The argument that more verbose code is self-documenting and thus easier to read is complete BS. It would also be complete BS to say that shorter is always better. A lot of people have written extremely short Perl programs that they themselves had a hard time reading a short time later. For short code to be "better", it has to be clean enough to be easy for any programmer to figure out quickly. However, code cleanliness and readability was not one of the inputs for these graphs. That is why Perl looks better than both Python and Ruby on these graphs despite the fact that most programmers can't stand Perl (and for valid reasons).

    42. Re:Why is Verbosity Bad? by MichaelSmith · · Score: 1

      If you get into that much trouble with pointers in C it is unlikely you will have something which compiles or runs, so I don't see the problem.

      I am much more concerned about things which appear to work when they are not.

    43. Re:Why is Verbosity Bad? by MichaelSmith · · Score: 1

      Code metrics where I work exclude comments, which I think is stupid. Managers say to me "but the comments don't do anything", but I don't agree.

    44. Re:Why is Verbosity Bad? by MichaelSmith · · Score: 1

      One last note - I recently overheard someone ranting about the usage of indenting in Python. All my code is properly indented, so it would be trivial to remove the {} brackets from my Java code, if Java supported it. Yet more evidence of what languages work for my mind. ;)

      Python programmers always seem to point to the IDEs which they use, which enforce indenting style. Where I work we often edit the code from wherever we are, using whatever tool is available, and we have hundreds of megabytes of the stuff in C and Ada. I would hate to think how that would work in Python.

      One particular issue we have is how code is refactored. Big blocks of code might be moved into a function or put inside an if statement. The indenting is usually stuffed up in the process. I suppose one advantage in python is that doing that would more than likely break the code entirely. But I don't want to be the guy trying to fix a system on site with vi in a dos window with a hundred million dollars hanging on the outcome of a test in the middle of the night in nigeria with no idea where my blocks start and end.

    45. Re:Why is Verbosity Bad? by ClosedSource · · Score: 1

      If you think that multiplication and pointer dereferencing are the only things in C that use a '*', perhaps you should follow your own advice.

    46. Re:Why is Verbosity Bad? by BikeHelmet · · Score: 1

      Big blocks of code might be moved into a function or put inside an if statement. The indenting is usually stuffed up in the process.

      You raise an interesting point. Although from what I know of Python programmers, most would probably just create indentThis.py to solve that problem. ;)

      To be honest, that's more of an IDE issue than a language issue. In Python, indenting is important. In C, throwing a ; on the end of everything is important. The IDE should be correcting it to make your life easier, when it's obvious what you're doing. Your usage scenario demands it, but the IDE doesn't do it, so that part of the language's style becomes annoying.

      I was initially spoiled by having Comment/Uncomment buttons. You select some lines, click the button, and slashes get added. They make it extremely easy to comment away parts of code, but not other parts. I find /**/ quite sloppy by comparison, since there's no easy way to comment inside of comments, so that if uncommented, part is still commented. (Useful for, for example... lines left in to speed up debugging, but only required if the method is rewritten later on)

      I also got used to pressing Tab to indent whatever is selected, and pressing Backspace to un-indent it. (applies only when multiple lines are selected) Only delete actually deletes.

      Most IDEs either have none of those, or just the Tabbing, so I too am annoyed when indentation or commenting aren't easily manipulatable. But I fault the IDE for not suiting the language, rather than faulting the language. And if I am forced to use some shitty IDE because that's what is available, then I probably would pick a better supported language, even if it's not a better language...

    47. Re:Why is Verbosity Bad? by Lunzo · · Score: 1

      The Larry Wall fortunes on /. are always good. I'm happy to say I'm a fan of the Wall.

    48. Re:Why is Verbosity Bad? by Limerent+Oil · · Score: 1

      I find it really difficult to correlate expressiveness and verbosity in any simple way.

      The original question asked was: Why is verbosity bad? My answer was to define verbosity as the inverse of expressiveness, with the implicit assumption that greater expressiveness is better. I think that you intuitively also make this assumption when you speak positively of the "compactness" (expressiveness?) of shell scripts when applied to suitable tasks.

      Let's say you are given two scripts that accomplish exactly the same task. One script has 10 LOC, and the other has 100 LOC (ignoring all comments, whitespace, etc). Which script would you say is more verbose? And which would you say is more expressive?

    49. Re:Why is Verbosity Bad? by dpilot · · Score: 4, Insightful

      Vermont ski areas have more words for "snow" than the Inuit.

      But they all mean "ice".

      --
      The living have better things to do than to continue hating the dead.
    50. Re:Why is Verbosity Bad? by UnknownSoldier · · Score: 1

      Yeah @ to deference a pointer probably would of been a better choice. (At least you could search for them then :)

      Hindsight is 20/20.

    51. Re:Why is Verbosity Bad? by jackb_guppy · · Score: 1

      In both cases the 100 LOC.

      Languages that overly allow for "cuteness" makes maintenance costly.

      Example: a[i++] += b[j++]
      It is a waste of space and compiler time. Makes reading a requirement of knowing every sequence of processing rule.

      Now: a[i] += b[j]
                  i++
                  j++
      Is a lot more descripted and easier for the next person to read and understand. Also generally "cheaper" for the compiler and most time smaller final code.

    52. Re:Why is Verbosity Bad? by SleepingWaterBear · · Score: 1

      One particular issue we have is how code is refactored. Big blocks of code might be moved into a function or put inside an if statement. The indenting is usually stuffed up in the process. I suppose one advantage in python is that doing that would more than likely break the code entirely. But I don't want to be the guy trying to fix a system on site with vi in a dos window with a hundred million dollars hanging on the outcome of a test in the middle of the night in nigeria with no idea where my blocks start and end.

      In python, improperly indented code rarely runs, and personally, I'm perfectly ok with a system that forces you to keep the code indented properly. Your guy using vi in a dos window is going to leave you with code that is going to be a real nuisance for the next guy who comes along if he's ok with totally botched indentation.

      More to the point, if you have a hundred million dollars hanging on your test, and your only IDE is vi under dos, you're doing something wrong that has absolutely nothing to do with your choice of programming language. Actually, I'm being unkind, once you learn how to use it, vi is pretty effective. For a real challenge, try programming with just cat, or better still, using nothing but bash IO redirection.

    53. Re:Why is Verbosity Bad? by diablovision · · Score: 1

      Oh my god, help me, I forgot how to write utility methods!

      --
      120 characters isn't enough to explain it.
    54. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      It's not the length of the identifier that matters, it's the ability to chunk it. I'd argue println is a poor identifier because the word "print" doesn't really belong in an I/O interface (it's too specific) and it contains a pretty arbitrary abbreviation "ln" whereas Java libraries tend towards full word pascalCase. In C# this function is called WriteLine which I think is a better choice despite being longer.

      On the whole if your program contains many "println" statements then you're doing something wrong. This is true even for console applications and for logging since you should be working with a higher level abstraction if possible.

    55. Re:Why is Verbosity Bad? by Tablizer · · Score: 1

      I have read many an article with developers arguing that they don't need to document their code when their code is self-documenting.

      The self-documenting claim is bull. Self-describing variable names are often too long to read easy. Thus, it makes sense to create an abbreviation and then describe the long-form in comments. Also, comment blocks of code as if it was a newspaper headline. We don't want to read every line of text to know what the article is about. Headlines are a good thing.
           

    56. Re:Why is Verbosity Bad? by KasperMeerts · · Score: 1

      Uh, nope, that really are the only uses for an '*'.

      --
      As long as there are slaughterhouses, there will be battlefields.
    57. Re:Why is Verbosity Bad? by TheTurtlesMoves · · Score: 1

      In eclipse I would use Refactor to change a name/type. Or a regex type thing...

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    58. Re:Why is Verbosity Bad? by YourExperiment · · Score: 1

      tl;dr

    59. Re:Why is Verbosity Bad? by byrtolet · · Score: 1

      Example: a[i++] += b[j++]

      One usualy writes

      *a++ += *b++;

    60. Re:Why is Verbosity Bad? by Philip_the_physicist · · Score: 1
      When I first learnt Java (1.4) I was taught that javac's support for inlining functions was more or less non-existent Instead I used a hack-together pre-processor to deal with this sort of thing, but eventually abandoned it because it was never much good and it didn't work with my university's automated marking script.

      I have no idea if javac can inline properly, but if not, the overhead of an extra method call on every println (and every other similar function) would be a rather bad thing.

    61. Re:Why is Verbosity Bad? by creationer · · Score: 1

      Definition of verbosity: containing more words than necessary; also : impaired by wordiness. Therefore "verbosity in moderation" is somewhat of a contradiction.

    62. Re:Why is Verbosity Bad? by hesaigo999ca · · Score: 1

      I totally agree, aside from naming the functions and variables with a clue, to let the next guy know what they are for, there should only be comments fro explaining the business rules (such as why 7 days...because 7 days represents a full week...for delivery?)

    63. Re:Why is Verbosity Bad? by Phantom+of+the+Opera · · Score: 1

      This is where so many programers go wrong. The code is self documenting in the respect that you know it's checking the age of something to see if it was 7 days ago, but you have no idea WHY it's checking that. Why not 6 days ago? What if it's 8 days ago?

      Comments should say WHAT and WHY you are doing something not HOW you are doing it. The HOW is the code itself. If someone was to look at that code, do they know what your intent was? Were you looking for something that was exactly 7 days old, or something 7 days old or older.

      This is such an excellent point. The ultimate example of this was //add 1 to x
      x++;

      I kid you not. That comment is a weed. A comment explaining 'why' something doesn't go out of date as quickly as a comment explaining implementation detail.

    64. Re:Why is Verbosity Bad? by Bastard+of+Subhumani · · Score: 1

      My answer was to define verbosity as the inverse of expressiveness

      But it isn't.

      --
      Only three things are certain; death, taxes, and apocryphal quotations - Ben Franklin.
    65. Re:Why is Verbosity Bad? by ThePhilips · · Score: 2, Informative

      I recall seeing a study that showed that bugs per line of code(*) was fairly constant across languages. (Anyone know what study that was?) Thus the fewer lines of code(*) in your program the fewer bugs. Thus more expressive languages are better.

      I do not remember the source of the study, but you got it wrong anyway.

      The result of study was that amount of bugs per [effective] line of code depends solely on programmer. Different languages have different code density, yet programmer makes literally same amount of bugs regardless of language.

      I have seen apparently perfect one-line Perl programs - which had 3+ bugs in them. If the same person wrote it say in Java, then it would have been say 25 lines of code, but very highly likely number of bugs remained the same.

      --
      All hope abandon ye who enter here.
    66. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      You're quoting Wikipedia as a debunking-the-myth source?!

    67. Re:Why is Verbosity Bad? by SCHecklerX · · Score: 1

      My favorite, if I had to be pushed against one, is Larry's daughter.

    68. Re:Why is Verbosity Bad? by diablovision · · Score: 1

      Javac does essentially no optimization, while the dynamic compiler in the VM does a hell of a lot. Besides, the overhead of a method call is almost nothing compared to the overhead of constructing the StringBuffer, appending contents, building a String, and actually doing the IO. Why would you waste your time with a pre-processor?

      --
      120 characters isn't enough to explain it.
    69. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      Actually, the parent is more correct. The description of the size measurement is linked in the article: it is measured by gzip-bytes, not source code bytes. This means that long identifiers and keywords do not significantly increase the size measurement, since common substrings compress well. Complex structure, on the other hand, compresses poorly, which makes gzip-bytes a good measurement of source code complexity rather than sheer verbosity.

    70. Re:Why is Verbosity Bad? by GuerreroDelInterfaz · · Score: 1

      Well, I did not know that. Thanks for the info.

      But something like that do happens in other languages. For instance "shrimp" in English or "crevette" in French corresponds with much more varieties in Spanish: camarrÃn, quisquilla, gamba, gambÃn, langostinos, carabineros and much more that I don't know because I don't like seafood. And in Walloon there are as well many names for "mud". So the argument seems sound although the example is wrong.

      And about verbosity, I really don't know how this could be a bad thing nowadays. I mean, does anybody still *writes* code? I certainly don't. I just copy&paste/search&replace and little else. Source size is not a problem either. The only problem I see with it can make code difficult to read on a small screen because code can get hidden on the right side. Readable code is what matters.

    71. Re:Why is Verbosity Bad? by Kazoo+the+Clown · · Score: 1

      Comments should say WHAT and WHY you are doing something not HOW you are doing it. The HOW is the code itself. If someone was to look at that code, do they know what your intent was? Were you looking for something that was exactly 7 days old, or something 7 days old or older.

      Comments LIE. CODE never lies...

    72. Re:Why is Verbosity Bad? by Philip_the_physicist · · Score: 1

      Mainly because the time taken to write a few lines of python was repaid in almost no time, since I could automatically call it. All it did was replace shortcuts with boilerplate, so SETUP_CIN(/name/) created a scanner called name, and a few other similar shortcuts, as well as expanding simple macros. Some of these cannot be placed in a function because the scoping would be wrong, and although it was originally written because I was too lazy to copy/paste boilerplate code between files or type it out each time, it actually turned out to be quite convenient.

    73. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      7.days.ago is a Rails-ism anyway, IIRC. (I got off the Ruby bandwagon when I realized it was so slow. I mean, if a Java implementation is faster than the C one, it really does suck.)

    74. Re:Why is Verbosity Bad? by QuestionsNotAnswers · · Score: 1

      Any long-time snow-sports participant ends up with a large vocab of words for various types of snow.

      Here is a list of 182 words for snow -- and the list doesn't contain many words I use with friends, so I would guess there are *a lot* more.

      --
      Happy moony
    75. Re:Why is Verbosity Bad? by Chrisq · · Score: 1

      One can say, write or otherwise annunciate that excessive verbosity can negatively affect or impact the efficiency, ease of use, and supportability of a programming language or idiom. The mechanism of the aforementioned affect is the distracting quality of the spurious constructs, which means the purpose of the code is not immediately obvious. Also authorship of verbose constructs gives a greater opportunity for error and requires more rote learning of syntax.

      In other words what you are trying to do gets lost in the syntax.

    76. Re:Why is Verbosity Bad? by some+guy+I+know · · Score: 1

      *a++ += *b++;

      Not when a and b are arrays.
      Also, the lack of semicolons in his/her example indicate that his/her example language might not be C/C++/D/Objective C, etc., but some other language (I know not which).

      --
      Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
    77. Re:Why is Verbosity Bad? by some+guy+I+know · · Score: 1

      Pascal:
      itemCounts[ProductIdFromName(name)] := itemCounts[ProductIdFromName(name)] + 1;

      Or

      Inc(itemCounts[ProductIdFromName(name)])

      (possibly followed by ";", depending on context).

      --
      Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
    78. Re:Why is Verbosity Bad? by dpilot · · Score: 1

      I see your list only had 3 forms of "granular", perhaps one of my favorite euphanisims.

      And as skiing goes, ice isn't necessarily all bad. If you're after speed, for instance. Plus it opens up your window of appreciation.

      --
      The living have better things to do than to continue hating the dead.
    79. Re:Why is Verbosity Bad? by daemonburrito · · Score: 1

      So the argument seems sound although the example is wrong.

      It is a very interesting point. Depending on what you mean by "the argument", it's not sound. Popular culture is way behind the science on this.

      Check out Pinker's "The Language Instinct": http://www.amazon.com/Language-Instinct-Steven-Pinker/dp/0060976519. Whether or not you accept his whole thesis, it's undeniable that the "Sapir-Whorf Hypothesis" is dead and has been for 75 years.

      I find this long-lived and pervasive myth totally fascinating... It's a nexus of so many cultural issues; like BEV, native-only laws, exoticism, Esperanto, and the very notion of "improving" human language.

    80. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      Not true. A "*" immediately following a "/" indicates the beginning of a comment.
      --
      A. Pedantic Dick

    81. Re:Why is Verbosity Bad? by l0b0 · · Score: 1

      I always found token count to be much more useful than SLOC. Many tokens = lots of thinking necessary to "get" what's going on.

    82. Re:Why is Verbosity Bad? by rah1420 · · Score: 1

      I believe the answer would be "one."

      --
      Mit der Dummheit kämpfen Götter selbst vergebens.
    83. Re:Why is Verbosity Bad? by ekhben · · Score: 1

      It's more general than that, I believe. When I went to University, we were taught a variety of languages, including MIPS assembler, Modula 2, and C. People who had trouble with pointers had trouble with them in all of those languages: the concept itself is difficult for some people to understand.

      Fortunately most OO languages nowadays don't let you get confused *in that way*. Objects are references and have one set of rules. Primitives are values and have another set of rules. You can't treat one as if it were the other. You just have to worry about either the delicacies of reference counting or the corner cases of garbage collection (nulling/non-nulling weak references, scope management for performance, generational collection -- if you're in CS, and looking for a thesis topic, there's plenty of room left in GC!)

      (And hey, you can sneak "infant mortality" into your thesis topic!)

    84. Re:Why is Verbosity Bad? by Anonymous Coward · · Score: 0

      So the argument seems sound although the example is wrong.

      It is a very interesting point. Depending on what you mean by "the argument", it's not sound. Popular culture is way behind the science on this.

      Check out Pinker's "The Language Instinct": http://www.amazon.com/Language-Instinct-Steven-Pinker/dp/0060976519. Whether or not you accept his whole thesis, it's undeniable that the "Sapir-Whorf Hypothesis" is dead and has been for 75 years.

      I find this long-lived and pervasive myth totally fascinating... It's a nexus of so many cultural issues; like BEV, native-only laws, exoticism, Esperanto, and the very notion of "improving" human language.

      Although it's not my domain, I know Pinker's (and Chomsky's) work and I don't disagree. Sorry if I was not clear enough but what I meant was actually the contrary that you seem to have understood. That is, if in Spanish there are many names for shrimps, it's because there are lots of different shrimps in Spanish waters and Spanish people eat a lot of shrimps. Likewise for the Walloon example. And, of course I was referring just to vocabulary, not to grammar and such.

      As for the programming languages argument that I think was sound I mean that it's best if a programming language is designed to reflect better the environment that it's supposed to handle. That's the reason why I don't mind changing or even learning another language if it's more suited for the task at hand.

    85. Re:Why is Verbosity Bad? by GuerreroDelInterfaz · · Score: 1

      So the argument seems sound although the example is wrong.

      It is a very interesting point. Depending on what you mean by "the argument", it's not sound. Popular culture is way behind the science on this.

      Check out Pinker's "The Language Instinct": http://www.amazon.com/Language-Instinct-Steven-Pinker/dp/0060976519. Whether or not you accept his whole thesis, it's undeniable that the "Sapir-Whorf Hypothesis" is dead and has been for 75 years.

      I find this long-lived and pervasive myth totally fascinating... It's a nexus of so many cultural issues; like BEV, native-only laws, exoticism, Esperanto, and the very notion of "improving" human language.

      Although it's not my domain, I know Pinker's (and Chomsky's) work and I don't disagree. Sorry if I was not clear enough but what I meant was actually the contrary that you seem to have understood. That is, if in Spanish there are many names for shrimps, it's because there are lots of different shrimps in Spanish waters and Spanish people eat a lot of shrimps. Likewise for the Walloon example. And, of course, I was referring just to vocabulary, not to grammar and such.

      As for the programming languages argument that I think was sound I mean that it's best if a programming language is designed to reflect better the environment that it's supposed to handle. That's the reason why I don't mind changing or even learning another language if it's more suited for the task at hand.

      And sorry about the anonymous post. I just switched browsers so I'm still clumsy.

    86. Re:Why is Verbosity Bad? by daemonburrito · · Score: 1

      Neat! Sorry about the misunderstanding, it was my fault.

      I agree about different programming languages having different strengths in different domains. Of course, the issue gets more complicated when considering languages like LISP and metaprogramming. As an aside, I also think that good programmers should not only know several languages, but several paradigms (at least two: one descendant of Algol, and one descendant of LISP).

      All that said, I thought TFA's analysis was pretty close to my experience; the "narrow" stars were for the languages I expected. My only problem with TFA was that unlike all the other languages examined, only the Javascript analysis was not broken down by implementation (unless I just didn't see it). As long as the misfeatures are avoided, Javascript is really expressive and powerful; I can't wait until someone builds an implementation with tail recursion optimization.

  3. What? APL is not in the chart! by AliasMarlowe · · Score: 1

    It would have been right in the corner for conciseness. One-line programs are fairly standard, but can accomplish quite a lot.

    --
    Those who can make you believe absurdities can make you commit atrocities. - Voltaire
  4. Related site... by viyh · · Score: 4, Informative

    This site is awesome. It's very simple. They have over code in over 1200 different languages that spits out the lyrics to the "99 bottles of beer on the wall" song. Check out the perl example (yes, it really does work): http://99-bottles-of-beer.net/language-perl-737.html

    --
    "I have never let my schooling interfere with my education." --Mark Twain
    1. Re:Related site... by alvinrod · · Score: 4, Insightful

      What's so special about it? It looks just like a regular perl program to me. /ducks

    2. Re:Related site... by RenHoek · · Score: 1, Insightful

      I think that any language that allows such obfuscation is NOT a good language. A programming language should be brief, powerful but still readable in all circumstances.

    3. Re:Related site... by viyh · · Score: 4, Insightful

      Perl is all of the above; it is what you want it to be. That's the beauty of it. It can be a completely obfuscated ASCII art drawing or it can be a very concise, to-the-point one-liner or anything in between. It's the Swiss army chainsaw.

      --
      "I have never let my schooling interfere with my education." --Mark Twain
    4. Re:Related site... by CastrTroy · · Score: 3, Insightful

      Run Javascript through an obfuscator, and see how readable it is. "readable in all circumstances" can't possibly exist. Anybody could make unreadable code in any language.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    5. Re:Related site... by Anonymous Coward · · Score: 5, Interesting

      Show me a language impossible to write ugly code in, and I'll show you a language which is unnecessarily restrictive.

      If you can't recognize the beauty in near infinite flexibility and the associated amount of power provided, you're not qualified to participate in such a discussion. Come back when you've gotten to know some actual talented programmers. One way to identify those programmers is that they don't blame their tools for their own incompetence.

    6. Re:Related site... by Anonymous Coward · · Score: 1, Insightful

      One way to identify those programmers is that they don't blame their tools for their own incompetence.

      I was with you until you said this. I've heard "it's a poor workman who blames his tools" too often. It's a worse one who can't tell good tools from bad.

    7. Re:Related site... by Lars512 · · Score: 1

      I've heard the expression "a poor craftsman blames his tools", and to some extent that's true. But let's not pretend that the tools have no effect on how we tackle problems. I'd prefer a language which restricted my thinking in beneficial ways to one which left me entirely my own devices.

    8. Re:Related site... by The_Noid · · Score: 1

      The problems never show when you look at your own code. The problems show when you are forced to look at someone else's code. Code barfed out by people that are not talented programmers. Once that happens you'll wish the language they used was more "limiting".

    9. Re:Related site... by Philip_the_physicist · · Score: 1

      I have come across plenty of clear and readable Perl code. The language itself is not a problem, it is more the programmers who use it, and their common tendency to try to be clever and mash all of their code into executable line noise or something which can be mistaken for BF at first glance.

    10. Re:Related site... by Anonymous Coward · · Score: 0

      Show me a language impossible to write ugly code in, and I'll show you a language which is unnecessarily restrictive.

      (Common) Lisp. It's impossible to write ugly code it in because all code just looks the same (at least from a few metres away). It also lets you do much, much more than, say, Java. Metaobject protocol, anyone?

    11. Re:Related site... by jgtg32a · · Score: 1

      Maybe I'm reading the chart wrong but it appears that Perl is faster than Python, which I'm surprised about I was under the impression that Python was a bit faster

    12. Re:Related site... by ThePhilips · · Score: 2, Insightful

      I'd prefer a language which restricted my thinking in beneficial ways to one which left me entirely my own devices.

      "Restricted [...] thinking"? So instead of doing more with the same tool, you want to do less?? and buy more other tools to do the rest???

      Honestly, I see "restricted thinkng" applicable only to developer who are not mature yet or are refusing on improving themselves. Just like guilds of past v. industry of today. In past there were skillful craftsmen - now we have some random folks off the street who simply punch a button for the 8 hours with lunch break.

      I hope that llama-isation of software development would happen after my retirement....

      --
      All hope abandon ye who enter here.
    13. Re:Related site... by ThePhilips · · Score: 1

      Code barfed out by people that are not talented programmers.

      You haven't seen what such people do with more "limiting" languages....

      Crappiness of code doesn't depend on language - it depends on who wrote it.

      --
      All hope abandon ye who enter here.
    14. Re:Related site... by matt20102 · · Score: 1

      I wouldn't call a perl "one-liner" something that's to-the-point. On the contrary- perl programmers that I've met seem to think that using linebreaks and comments cause cancer...

      I worked for a company which has a 30-second rule in programming: if a particular piece of functionality (method, function, etc.) took more than 30 seconds for another programmer to understand, then it had to be re-written. This contributes to readability, if not to the ego of the guy who wrote the code. Many programmers seem to be proud of their ability to obfuscate code (well, I can understand it. Can't you?). Perl seem to top this list, followed closely by c++.

  5. Scala by Laz10 · · Score: 3, Interesting

    I am surprised how they manage to get scala to perform so much worse than pure java.

    Scala compiles to pure java .class files and uses static typing and the makes claim that the bytecodes are almost identical.

    I wonder if the benchmarks are executed in the same environment.
    http://shootout.alioth.debian.org/ has a Gentoo label behind the java benchmarks, but not the Scala one.

    1. Re:Scala by jbolden · · Score: 4, Insightful

      Functional languages in practice often implement nlog n algorithms in quadratic time or memory. One of those in a bench mark is devastating. We really understand how to optimize imperative languages well, we don't have the same level of knowledge / experience regarding functional.

      I agree this is a pity, but there doesn't seem to be any easy solution. Hopefully this gets fixed over the next generation.

    2. Re:Scala by kipton · · Score: 3, Interesting

      I am surprised how they manage to get scala to perform so much worse than pure java.

      Scala does generate optimized Java byte code. Pretty much any Java code can be directly ported to Scala with nearly identical performance.

      The Scala benchmarks perform worsethan Java's, on average, for two main reasons. The first is that some of the tasks have been implemented using higher level code (think memory allocation and closure generation), trading conciseness for performance. The second is that the Scala benchmarks haven't been tuned and tweaked to the extent that the Java ones have.

      Then there are a couple benchmarks where Scala's performance is hugely worse than Java. This seems to be because the Java benchmark was implemented using optimized native libraries (big integers as I recall) or using a better algorithm. Again, Scala could achieve equivalent performance in principle, but someone needs to invest the time to update the benchmark implementations.

    3. Re:Scala by DoofusOfDeath · · Score: 1

      Functional languages in practice often implement nlog n algorithms in quadratic time or memory

      We should probably distinguish between pure and impure functional languages.

      Impure languages like SML and (I think) MLTON can modify arrays in-place, eliminating one of the major causes of slowness when implementing certain algorithms in a pure functional language.

    4. Re:Scala by DetpackJump · · Score: 3, Insightful

      I was curious about that too, so I'm looking at the code. The Java implementation seems to be importing a non-java library, jgmplib. Anyone know what is going on here?

    5. Re:Scala by Ichoran · · Score: 1

      I am surprised that the benchmarks perform so much worse *without* being significantly more compact. If you're going to write compact functional code, you have to accept a bit (or a lot) of overhead. But there's no reason a Scala program should be both longer and slower than a Java one except through inattention.

    6. Re:Scala by jbolden · · Score: 1

      With the impure languages optimization becomes much much easier. On the other hand many of the advantages of functional go out the window. One global variable not in a monad and suddenly the compiler and runtime can't freely reorder executions.

    7. Re:Scala by DoofusOfDeath · · Score: 2, Informative

      With the impure languages optimization becomes much much easier.

      Funny you should say that. I'm just starting my dissertation work on parallelizing purely functional languages. (Yes, I know that topic was nearly beaten to death in the 1990's and earlier.)

      But anyway, optimizing the *parallelization* of a functional language can be a lot easier (in some ways) when the language *is* pure. At least, according to my background reading so far.

    8. Re:Scala by Richard+W.M.+Jones · · Score: 1

      What a load of nonsense. There are super-efficient functional languages like OCaml, SML, F# and others in the ML family, which can beat C if tweaked, and even used in a functional style still get near to C's speed.

      Parallelizing pure functional languages is also far simpler, and that really matters too.

      This isn't "next generation", this is compilers that we use regularly right now. In real world, commercial programming.

    9. Re:Scala by iluvcapra · · Score: 1

      We really understand how to optimize imperative languages well, we don't have the same level of knowledge / experience regarding functional.

      On the other hand, I was surprised at how many of the languages in the "optimal" corner were compiled Schemes, even if, in practice, Scheme is so pure that it's hard to use for real projects...

      --
      Don't blame me, I voted for Baltar.
    10. Re:Scala by shutdown+-p+now · · Score: 1

      I am surprised how they manage to get scala to perform so much worse than pure java.

      I haven't looked at their code, but I do have some suspicions.

      Scala allows and promotes some programming techniques that, while possible in Java, are too cumbersome to be used in practice - such as first-class functions and the associated FP patterns. However, JVM is not optimized for such things, so using them might lead to a significant performance penalty.

      To give a single example: a Java for-loop over a collection is noticeably faster than using generalized map/filter/fold. However, when coding in Scala, you are more likely to use the latter.

    11. Re:Scala by Anonymous Coward · · Score: 0

      There are 3 things that jump to mind about this.

      The Scala compiler produces code which is difficult for the JVM/JIT to improve. Something like lots of short lived objects or just crummy algorithms could do it. I suspect it's the short lived objects since it's a functional language, and it would be easy for a functional language compiler to preserve not recognize when in place changes to an object are ok, rather than creating a new object.

      Another thing to think about is that the JVM/JIT was built with the Java language in mind. Java doesn't behave like a functional language in most places. Garbage Collection and it's handling of strings are exceptions to this. JVM/JIT does expect certain types of byte code patterns to be thrown at it.

      There's also the actual source implementations of the benchmarks to consider. At that level there are way too many things to consider that may play into the differences.

    12. Re:Scala by jbolden · · Score: 1

      Interesting I can see how parallelization is so much easier that this would happen.

    13. Re:Scala by jbolden · · Score: 1

      It was nice to see. I'm thinking maybe, we have a lot of experience optimizing LISPs. So the Scheme stuff caries over. They are sort of an exception. Not sure why that doesn't carry over to the rest of functional languages.

    14. Re:Scala by jbolden · · Score: 1

      I'm familiar with the ML family. ML isn't pure and where it doesn't fall into these traps it does it quite often by being C like. If ML were beating C regularly it would be doing better on benchmarks.

      Parallelizing pure functional languages is also far simpler, and that really matters too.

      No for these benchmarks it doesn't. For other benchmarks which allowed you to use multiple CPUs and give developers a fixed time it would matter.

    15. Re:Scala by Anonymous Coward · · Score: 0

      huh? what? nlog(n) is nlogn despite the language, if it's not, it's a different algorithm. If some retard implements it in O(n^2), he should learn the language. Besides, Scala can be programmed imperatively, completely negating these imaginary downsides. Besides, tail-recursion should improve it to boot.

      Mod parent down.

    16. Re:Scala by Anonymous Coward · · Score: 0

      How on earth did this get +5 Insightful? Oh, right; most slashdot readers can't grok FP and are always on the lookout for people to blame FP as cover for their inability to grok it.

      Languages (functional or otherwise) don't implement algorithms, programmers do.

      Turning an O(n.log(n)) problem into an O(n^2) (or worse) problem is usually caused by the programmer trying to use lists (which are O(n) for random access) as if they were arrays (which are O(1) for random access).

      The irony is that FP languages tend to be a natural fit for most O(n.log(n)) algorithms, as these are naturally implemented using recursive subdivision, and recursion is the backbone of FP languages. Show me an O(n.log(n)) algorithm which has been turned into an O(n^2.log(n)) problem by inappropriate use of lists, and I'll show you an O(n.log(n)) version which uses the language correctly rather than pretending it's C with different syntax.

    17. Re:Scala by Anonymous Coward · · Score: 0

      Would you care to give an example of this?
      I am extremely curious.

    18. Re:Scala by TheTurtlesMoves · · Score: 1

      Its a benchmark. Thats it. Was the scala writen by a scala coder or a C programmer. Is the C writen by a ... etc. There are so many things to consider that it should all be taken with salt. It will taste better that way.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    19. Re:Scala by jbolden · · Score: 1

      Then go on the ghc mailing list and educate the people who write the compiler for Haskell and let them know, they are are getting nailed by several of these problems.

    20. Re:Scala by jbolden · · Score: 1

      Sieve of Eratosthenes is a good example because it has been solved but the discussion of the flaws in older solutions are quite subtle.
      http://www.haskell.org/pipermail/haskell-cafe/2007-February/022666.html

    21. Re:Scala by Anonymous Coward · · Score: 0

      Thanks for that reference. I enjoyed Melissa O'Neill's paper!

  6. Java by Allicorn · · Score: 2, Funny

    Oh but Java is a plodding, stumbling, lumbering, slug of slowness. All thoroughly indoctrinated Slashdotters know that already. No need to RTFA...

    --
    OMG!!! Ponies!!!
    1. Re:Java by Timmmm · · Score: 2, Interesting

      "Oh but Java is a plodding, stumbling, lumbering, slug of slowness."

      Java does well in these kinds of synthetic tests because it doesn't have to invoke the garbage collector. All the *real life* java programs I use are significantly slower than roughly equivalent C++ programs. E.g. compare NetBeans to Visual Studio, or Azereus to uTorrent. I tried Eclipse once but it was unusably slow.

      Find me a speedy desktop Java program and I'll change my mind about it.

    2. Re:Java by TomRK1089 · · Score: 1

      Eclipse for me is speedy but greedy. If you're willing to let it suck up RAM it'll run perfectly fine.

    3. Re:Java by RzUpAnmsCwrds · · Score: 1

      E.g. compare NetBeans to Visual Studio

      Bad example, because new versions of Visual Studio are mostly written in managed code (.NET).

      Java performs quite well in practice. In reality, the big problem with Java is that the UI libraries (e.g. Swing) have historically been very slow. Swing has gotten a lot faster lately, though, so this isn't as big of a deal anymore.

    4. Re:Java by TheTurtlesMoves · · Score: 1

      bloatware in any language is bloatware. On low mem machines (read 1 gig) i don't use eclipse anymore. But yes it works fine with 2gig+.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    5. Re:Java by TheTurtlesMoves · · Score: 1

      Another problem with java is that every first year student writes a GUI in *bad* swing and then makes it an applet. Bad GUIs are always slow and I have never found a "great" widget toolkit.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    6. Re:Java by Philip_the_physicist · · Score: 1
      The other problem which makes Java slow in the real world is some of the brain-dead decisions my library coders.

      For example, there is a constructor for BigInteger which takes a long as its parameter, but for some reason the developers decided that this should be private. Instead, to create a BigInteger from an int, you need to cast to Integer (automatically), then to String, and then construct the BigInteger, which would have to use Long.parseLong on the string to get the long to use in the constructor. This creates two redundant objects and invokes several method calls, whereas allowing public access tot eh constructor would have allowed using a single cast and one method call.

      Another common source of frustration is the Java crypto libraries, but I am not so familiar with them.

    7. Re:Java by double_ooh · · Score: 1

      Or, you could skip all of that and use the static BigInteger.valueOf(long val) method that returns a brand new BigInteger without all of the hassle.

  7. The perfect language exists, you ignorant clod! by tomhudson · · Score: 5, Funny

    And finally, in the bottom left corner you would find probably nothing, since this is the space of the ideal language, the one which is at the same time fast and short and a joy to use."

    Plain ASCII. The shorter and faster it is, the more joy it is to use.

    What can compare to the joy and speed of, for example, the command "Go fuck yourself!"

    Even shorter and faster syntax: the command "F.U.!"

    And for conciseness of comments - "SHIT!" and "oops!" and "WTF???"

    Looping constructs: "Sit on it and rotate!"

    If-else constructs: "Dat so? F.U. 2!"

    foreach: "You, your mamma, and the horse you rode into town on!"

    Exit statements : Just fuck off!"

    c-style assertions: "Eat shit and DIE!"

    #defines: "#define YOU One dumb motherfucka"

    conditional #includes "#ifdef YO_MAMMA"

    real-time peremption: "I OWN you, beotch!"

    1. Re:The perfect language exists, you ignorant clod! by BorgCopyeditor · · Score: 1

      Looping constructs: "Sit on it and rotate!"

      Or the syntactic sugar shorthand: "Sit and spin!"

      --
      Shop as usual. And avoid panic buying.
    2. Re:The perfect language exists, you ignorant clod! by Anonymous Coward · · Score: 0

      eat my shit, bro

    3. Re:The perfect language exists, you ignorant clod! by Anonymous Coward · · Score: 0

      Java == C# you retard, it's not a fuck you

    4. Re:The perfect language exists, you ignorant clod! by Anonymous Coward · · Score: 0

      That might just be the funniest thing I have ever read on slashdot.

    5. Re:The perfect language exists, you ignorant clod! by KangKong · · Score: 2, Informative
    6. Re:The perfect language exists, you ignorant clod! by Anonymous Coward · · Score: 0

      Clearly the ideal language is Unix shell scripts!

      "./benchmark"

      How concise is that, bitch?
      And it was written in C and compiled, so it's faster than everything, too.

    7. Re:The perfect language exists, you ignorant clod! by tomhudson · · Score: 1

      "That might just be the funniest thing I have ever read on slashdot. "

      Thanks, but I think I was in better form when I wrote this -> http://linux.slashdot.org/comments.pl?sid=148847&cid=12478032

    8. Re:The perfect language exists, you ignorant clod! by tomhudson · · Score: 1

      Certainly a lot more readable than some of the perl I've seen ... :-)

  8. Re:javascript for example by gardyloo · · Score: 1

    I have both fsdn.com and slashdot.org blocked, and can *still* read the comments. Apparently there's a conservation of Javascript thing going on . . ..

  9. Where are the old standards? by Anonymous Coward · · Score: 0

    I'm a bit rusty on my languages too, but what about ML, Haskell and other pure functional languages? Scheme?

    And what about the old standards? Fortran, Cobol and Common Lisp still do a lot of the world's work. C/C++, while a member of the family, doesn't encapsulate them.

    I guess expressiveness gets at the idea that programmer hours are more important than compiler or runtime hours for most applications, but the link isn't real clear. And maintainability--probably the most important characteristic of any language long term--isn't covered very well either.

    1. Re:Where are the old standards? by mdmkolbe · · Score: 2, Informative

      ML, Haskell, Scheme, Fortran and Common Lisp are on the list. You probably didn't notice them because they are listed by their implementation name (e.g. mlton/O'Caml, GHC, Stalin/Gambit/Ikarus/Chicken, G95, SBCL/CMUCL, etc.). The Shootout front page lists which implementations implement which languages.

    2. Re:Where are the old standards? by HiThere · · Score: 1

      cmucl is a Common Lisp. And I think he's got a Scheme dialect there too.

      What's really strange is that gcc is considered as ONE compiler.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
  10. Pet peeve by QuoteMstr · · Score: 5, Insightful

    Programming languages don't have attributes like size and speed: implementations of these languages do. Take Common Lisp for example: SBCL is blazing fast, while CLISP is rather pudgy (albeit smaller). Any conforming Common Lisp program will run on both. Or consider Python --- IronPython and CPython have different performance characteristics. (I'm too lazy to link these now.)

    Point being, describing a programming language as "fast" makes about as much senese as describing a natural, human language as "smart".

    1. Re:Pet peeve by kurt555gs · · Score: 1

      C++ will never archive the speed of a good Assembly program.

      --
      * Carthago Delenda Est *
    2. Re:Pet peeve by DoofusOfDeath · · Score: 1

      Point being, describing a programming language as "fast" makes about as much senese as describing a natural, human language as "smart".

      Yeah, will if human language isn't smart, just what language DO you suggest we use???

      Goddam Vorons... troll ever fucking thread they read.

    3. Re:Pet peeve by sunderland56 · · Score: 1

      The article does confuse a language with it's implementation. GCC, for instance, is NOT a language!

    4. Re:Pet peeve by Anonymous Coward · · Score: 0

      What is your point ? did you believe that a C++ programmer would be shy to drop down to assembly when needed ? because they do.
      Ton of multimedia lib such as codecs are written with assembly bits. Like the fastest software-only H264 decoder.

      C++ programmers do not believe in the silver bullet. Dumb shits like Rubyists do.

    5. Re:Pet peeve by Murdoch5 · · Score: 0

      True, but it's not practical to use Assembler for much any more, maybe a short uC program but other then that, there is not alot of use for it.

    6. Re:Pet peeve by Anonymous Coward · · Score: 4, Insightful

      A badly-written Assembler program will never achieve the speed of a reasonably-written C++ program. And most people cannot write good Assembler code.

    7. Re:Pet peeve by Twinbee · · Score: 1

      I don't agree. The concise and almost 'joyful' programming languages like Ruby *lend* themselves to generally running slower for the reason that it's much harder to create a fast compiler for them than the others. It's still possible, but much, much harder to do so.

      --
      Why OpalCalc is the best Windows calc
    8. Re:Pet peeve by ultrabot · · Score: 1

      What is your point ? did you believe that a C++ programmer would be shy to drop down to assembly when needed ? because they do.
      Ton of multimedia lib such as codecs are written with assembly bits. Like the fastest software-only H264 decoder.

      C++ programmers do not believe in the silver bullet. Dumb shits like Rubyists do.

      From the article:

      On the plus side, both versions of Python can claim many of the smallest programs in the collection. Ruby (8, 1) might also compete for titles, but unfortunately its performance is so bad its star falls off the performance chart.

      Now, I understand the kinship ruby community feels with smalltalk... Squeak performance sucks too, albeit not as badly as ruby.

      --
      Save your wrists today - switch to Dvorak
    9. Re:Pet peeve by moon3 · · Score: 1

      You've probably never heard of Intel's Optimizing C++ compiler.

      Hell, C++ is the true production language running everything from Gears of War, Counter Strike to Mozilla, Internet Explorer, Flash, VLC and high-end production web servers like YouTube etc. Depending on how you use it, but it can be as easy as Basic yet powerful and fast as assembler. Take no substitute.

    10. Re:Pet peeve by someone1234 · · Score: 2, Informative

      I thought it compares implementations.
      If you look harder, you'll see multiple different implementations of the same language.

      --
      Patents Drive Free Software as Hurricanes Drive Construction Industry
    11. Re:Pet peeve by Anonymous Coward · · Score: 1, Informative

      I'd say that for a bytecode interpreted, turtles-all-the-way-down language, Squeak smalltalk performance is stellar (things are relative). Remember that Squeak manages to be faster than Ruby while implementing MOST of its core features in itself. It doesn't use lots of C code like Ruby do. Ruby has lots of core classes, like Array, FULLY implemented in C.

      So Ruby is quite the crappy language. Slower than Squeak while having core stuff written in C.

    12. Re:Pet peeve by Anonymous Coward · · Score: 0

      I would not want to compete with the latest compilers (of any strongly and statically typed language) with my leet assembly skills..

    13. Re:Pet peeve by Anonymous Coward · · Score: 1, Informative

      A good compiler probably knows a lot of optimization's that many assembler programmers don't know or don't really want to use, because the code would look too cryptic / too difficult to understand afterwards or bloated, although it's faster. The compiler knows, how to feed the pipelines of the CPU the right way, I doubt that all assembler programmers know that.

      Besides that if someone programmed a whole OS in assembler, I assume it would take a long time, until it's done, it would be full of bugs and take an eternity to remove those without incorporating new ones.

      Many performance problems in C++ are probably due to bad programming anyway, like people not noticing, when (copy-)constructors are unnessarily called very often and all that stuff, because if you do it right, it's can be extremely fast.
      Besides that usually only a fraction of code is performance-relevant anyway, and so it doesn't make sense to optimize everything for speed, but only those parts that really consume time, e.g. because they are called so often. That's what profilers are for.
      ( The most important optimization is to pick the right algorithm and datastructures for the right task anyway. )

    14. Re:Pet peeve by ls671 · · Score: 1

      I though IE was ran by VB, VB scripts, active-X and what not, thanks for bringing me up to date.

      --
      Everything I write is lies, read between the lines.
    15. Re:Pet peeve by ls671 · · Score: 1

      I don't know, I am not sure of this, but if it is much harder to create a fast compiler for them than the others, wouldn't it be also much harder to to create a framework for unit testing?

      --
      Everything I write is lies, read between the lines.
    16. Re:Pet peeve by Anonymous Coward · · Score: 0

      What you're saying is true, up to a point. The more sophisticated language specifications are more demanding on their implementations - the faster Lisp environment can still only be so fast. To put it another way, a fiendishly clever implementation of Ruby will still not be as fast as a fiendishly clever implementation of C, just because the Ruby runtime is _expected_ to do more.

    17. Re:Pet peeve by bcmm · · Score: 1

      What the hell is "Internet Explorer"?

      --
      # cat /dev/mem | strings | grep -i llama
      Damn, my RAM is full of llamas.
    18. Re:Pet peeve by jilles · · Score: 3, Insightful

      Yes of course you are right. And more recently we actually have languages with coherent and consistent behavior across implementations (somewhat of a novelty, just look at C implementations). There's several Ruby interpreters that run the Rails framework now. The fastest one (or so it is claimed often) is JRuby, which runs on top of the Java virtual machine, which has has quite many implementations on a wide variety of hardware optimized for running on e.g. embedded hardware or on CPUs with thousands of cores and impressive levels of compatibility given these differences. So saying language X is faster than language Y is a quite meaningless statement these days. Faster on what, and under what conditions and at what required level of stability, and with what kind of benchmark? Most C programs are fast, except they have all but 1 core on the CPU idling because threading and concurrency are very hard to bolt on to a C program. Which is why some performance critical messaging servers are done in languages like Erlang.

      Most C programmers believe it is the closest thing to native aside from assembler. Probably correct if you ignore 40 years of progress in the hardware world but downright naive in light of modern day X86 processors. Technically x86 is not a native instruction set anymore but a virtual machine language that happens to have an in hardware translation to the 'real' instruction set. Like all such translations, it comes at a cost of lost flexibility, and indeed performance. But it is worth avoiding having to rewrite all those pesky compilers. So rather than shatter the assumptions C programmers make, they actually support them by sacrificing transistors. The only real difference between Java and C execution model (aside from better defined semantics in Java) is that Java does the translation in software, at run-time, taking into account performance characteristics of both the running program and the underlying hardware. That in a nutshell is why the LLVM project exists to do the same for C programs (and indeed many other languages, including Java).

      Of course you have to take into account the levels of abstraction and indirection provided in application frameworks as well. Those come at a cost and that cost is typically high in scripting languages (but you get so much in return). Java is often unfairly compared to C. I say unfairly here because it is usually a comparison of application frameworks rather than the language implementation. Java is in 'laboratory' conditions quite fast, even comparable to C and applies all the same performance optimizations (and then some). Except, nobody programs Java that way (except some dude at work who managed to produce the suckiest Java class ever, different story) . Similarly, C mostly lacks the rich frameworks that are common in the Java world. Transcode a C program to Java and you end up with a code base that is still pretty fast (e.g. quake 2 has a Java port). Stupid people in both camps believe that it is an either-or type decision between the two and that it is somehow inherent to the language what you end up with. Clever engineers know that 95% of their code is not performance critical at all (i.e. cpu idling most of the time), and that it makes a hell of a lot of sense to do whatever is necessary to get that 5% performing as best as possible if the cost in terms of stability, productivity, security, portability, etc is low enough. That's why server-side c is not a commonly required job skill.

      That's why Apple used the llvm platform to port Mac OS X to mobile phones and why Google chose to implement a heavily customized Java vm on top of familiar C/C++ components to emulate their success. Good engineers know when to choose what. Both iphone and android are excellent achievements that move beyond the stupid status quo of wondering which language is better.

      --

      Jilles
    19. Re:Pet peeve by glwtta · · Score: 1

      Programming languages don't have attributes like size and speed

      Well, not speed (that's why different compilers are profiled, btw), but certainly size: we're talking about code size here, not memory size (or binary size).

      --
      sic transit gloria mundi
    20. Re:Pet peeve by mahadiga · · Score: 1

      Please suggest me a good programming language for exclusively programming an in-memory stock trading system. For e.g I'd have to use memory mapped (mmap) file in C programing language and it is cumbersome.

      --
      I'd like to buy homeland for our 10 million people. http://twitter.com/mahadiga
    21. Re:Pet peeve by Anonymous Coward · · Score: 0

      Presumably because almost nobody learns assembly anymore... At the time where assembly courses were part of the training, there were as many good assembly programmers as there are good C++ programmers nowadays, proportionally speaking of course.

      This knowledge was lost because we now assume that compilers are "smart" enough to do the job by themselves.

    22. Re:Pet peeve by bored · · Score: 1

      Most C programs are fast, except they have all but 1 core on the CPU idling because threading and concurrency are very hard to bolt on to a C program. Which is why some performance critical messaging servers are done in languages like Erlang.

      Except that auto detecting and synchronizing generic (I'm not talking about vectorization) parallelism is a hard problem. If you look at the thread ring benchmark you will see that haskell and erlang post significantly better results than C. A closer look shows that the C routine is balancing the CPU usage, while the haskell/erlang results are running entirely on a single CPU. How is it a micro benchmark like that could run 20x as fast in haskell on a single CPU as the C version does using all 4 CPU's? Its because C is explicitly context switching, while the haskell implementation is implicitly using a cooperative threads model. Doing that would be extremely easy in C, but its disallowed. It is possible to write massively parallel code using something like VHDL, the problem is that the locking is still explicit (via clocking) and the result is extremely slow. Frankly, if someone could actually write a compiler that does SMP parallelism on procedural code, without doing a time/space tradeoff, or a number of other fundamental issues, there name would appear in every comp sci book for the rest of history.

    23. Re:Pet peeve by QuoteMstr · · Score: 1

      Huh? If you need to lock your program into memory, just call mlockall(2) when your program starts up (and then drop privileges, of course).

    24. Re:Pet peeve by QuoteMstr · · Score: 1

      It used to be a lot easier to be a good assembly programmer. Just consider the implications of modern memory models. Just consider that Ulrich Drepper had to write a seven-part series just on memory.

    25. Re:Pet peeve by bored · · Score: 1

      Clever engineers know that 95% of their code is not performance critical at all (i.e. cpu idling most of the time), and that it makes a hell of a lot of sense to do whatever is necessary to get that 5% performing as best as possible if the cost in terms of stability, productivity, security, portability, etc is low enough. That's why server-side c is not a commonly required job skill.

      Server side, web development isn't done in C because the bottlenecks are almost always the database (which is written in C) and the IO bandwidth of the internet connection. That combined with the fact they are almost always custom, single company jobs. Given that there are a number of languages designed initially for web development. That they are better at it than C shouldn't surprise anyone.

      You can be assured that just about every other kind of "server" IS written in C. The project I work on is handing more than 5GB (bytes!) of IO data a second per machine (fairly standard X86 hardware). That kind of IO throughput is simply not possible with most other languages. You don't see samba written in java for reasons similar to our project. The low level optimizations required to make it run fast just don't exist. Its also heavily dependent on the economies of scale. If your application runs on four servers at two sites, then there really isn't a reason to optimize it to run on a single server at each site. On the other hand if your application runs on two servers per site at 10k sites, then its a significant cost savings when you make it handle the same load on a single server.

    26. Re:Pet peeve by zoips · · Score: 1

      Depending on what you mean by Mozilla, a quarter of the XULRunner codebase is written in Javascript and more than half of the Firefox codebase is written in Javascript.

  11. Forth, the RPN notational programming language by RichMan · · Score: 4, Informative

    http://en.wikipedia.org/wiki/Forth_(programming_language)

    --
    Forth is a simple yet extensible language; its modularity and extensibility permit the writing of high-level programs such as CAD systems. However, extensibility also helps poor programmers to write incomprehensible code, which has given Forth a reputation as a "write-only language". Forth has been used successfully in large, complex projects, while applications developed by competent, disciplined professionals have proven to be easily maintained on evolving hardware platforms over decades of use
    --
    Forth is still used today in many embedded systems (small computerized devices) because of its portability, efficient memory use, short development time, and fast execution speed. It has been implemented efficiently on modern RISC processors, and processors that use Forth as machine language have been produced
    --

    1. Re:Forth, the RPN notational programming language by wonkavader · · Score: 2, Interesting

      If the code size attribute is measured in number of lines, I suspect that forth, which is practically an assembly language, will rank very low (near the top of the graph, if not at the very top), though it ought to be very fast (near the left). It depends so much on stack operations that I suspect its left to right ranking would depend a great deal on the processor it's running on.

      I love forth. I learned it many years ago. But I've never been in a position to use it for anything, which is a shame.

    2. Re:Forth, the RPN notational programming language by rubycodez · · Score: 1

      even though it can generate code that runs faster than compiled C on certain platforms, can it really be used for truly huge projects? is there a modern word processor or DBMS or CADD system written in FORTH?

    3. Re:Forth, the RPN notational programming language by Richard+W.M.+Jones · · Score: 3, Interesting

      I wrote a little "literate" FORTH tutorial if any readers of the above comment are interested in it: jonesforth.

    4. Re:Forth, the RPN notational programming language by rbrander · · Score: 5, Insightful

      I fell hard for FORTH in the mid-80's - it was the programming language of some instrumentation I had to work with. I never did program the instrumentation, but got all the books on the language and interpreters/compilers (the distinction blurs in FORTH...) for it for a number of computers. I did some useful utilities for the PC using "HS/FORTH". I benchmarked it against some other solutions for a course in comparitive computer languages about 1985, and for heavily stack-based (ie very recursive) programs, nothing could touch it. I'm talking QuickSort faster than C.

      But I have to admit: though I busted butt, re-writing and re-re-writing programs to make them as clear and readable as possible, though I re-read the remarkable "Thinking FORTH" by Leo Brodie many times (and would recommend it to anybody who wants to understand the craft of programming, whether they want to learn FORTH or not)....despite it all, most of my FORTH programs were hard to read a few months later.

      There were things it was really good at - that is, the programs WERE readable later, the problem and language were a match - and others where I could just not seem to decompose the problem into FORTH words that fitted well together without a lot of "glue" to manipulate the parameters on the stack.

      That was the most frequent problem with my FORTH programming - one ends up trying to manage several parameters on the stack and doing a lot of stack "DUP SWAP ROTATE" - actions to line up the parameters to hand to the next word. I would re-compose the words and the parameters they wanted to clean up some code, and find I'd made some other code all hard to read.

      FORTH was also profoundly command-line oriented, and when the word went all GUI-centric on me with no good "Visual FORTH" or "Tk/FORTH" on the horizon, I slipped from grace. I can't see getting back to it now, either; lets face it, a huge bonus for any programming language choice is its popularity, so that others will maintain your code, so that you can get help and code fragments with a quick google.

      But I still think that FORTH should be a completely MANDATORY learning experience in all University and Tech CompSci degrees. You can jump from C to Perl to Python far more easily than to FORTH - it really comes at problems from another angle and working with it for years has been an enormous asset to my non-linear thinking when it comes to problem-solving.

      And perhaps if more students learned it, FORTH would rise in popularity for some problems, out of its decades-long sinecure in embedded systems (it started off programming radio telescopes, and undoubtedly still does...) Since it is inherently object-oriented (yes, an assembler-sized OO language from the 1970's, you heard that correctly) it would be an excellent interpretive, experimentation-friendly scripting language for applications. I'm currently needing to do a lot of VBA in Excel at work, and I have a strong suspicion I'd be twice as productive in "FORTH for Applications". It's a tragedy Bill Gates fell for BASIC (of all languages) instead.

    5. Re:Forth, the RPN notational programming language by Anonymous Coward · · Score: 0

      Forth you like if honk

    6. Re:Forth, the RPN notational programming language by Kuciwalker · · Score: 1

      Forth is ONLY really useful as an embedded language. The only reason for its existence is that it is even easier to implement (and has a smaller runtime) than C.

    7. Re:Forth, the RPN notational programming language by keyist · · Score: 1

      I can't see getting back to it now, either; lets face it, a huge bonus for any programming language choice is its popularity, so that others will maintain your code, so that you can get help and code fragments with a quick google.

      You may want to check out Factor. Both the language and its libraries are actively being developed. It is concatenative like Forth, with a strong Lisp influence.

    8. Re:Forth, the RPN notational programming language by Anonymous Coward · · Score: 0

      I share your FORTH love. I worked for almost five years doing FORTH full-time and I really loved the language.

      I didn't have any problems with stack juggling; anything nontrivial, and I would just bust out some temporary variables to clean things up.

      The biggest problems with FORTH as I see it are:

      0) The language is so malleable, people basically write their own domain-specific language, and you need to learn this language before you can work on their code. It's the same problem we had with this one really malleable text editor: none of us could use each other's editor, because everything was so different.

      1) The language was designed for small programs, and doesn't scale as well as I would like. Dictionaries are nice, but you really need name spaces and objects. FORTH is so malleable that I could whip some up, but they should really be standard so that everyone knows how to use everyone else's stuff.

      2) FORTH just never really caught on. There aren't that many software developers out there who do know FORTH.

      All that said, I agree with you that I would love to see FORTH used as a teaching language. If you see someone's resume come across your desk, and FORTH is on there as well as C and such languages, you know that person can look at problems in the FORTH way, as well as the more conventional way. Breadth is good in a software developer.

      I used to think FORTH was the ideal introductory teaching language, because it taught me so much. But now I think you would be hitting those introductory students over the head (with RPN and the rest of FORTH's quirks), so the first teaching language should be Python (so beautifully clean). But FORTH is an ideal language for a second-year or third-year undergraduate class.

    9. Re:Forth, the RPN notational programming language by skeeto · · Score: 2, Interesting

      If you like Forth, you should check out Factor, which is basically a modernized version of Forth (dynamically typed, no *very* low level filesystem junk that Forth has). I've recently started playing with it.

    10. Re:Forth, the RPN notational programming language by Kazoo+the+Clown · · Score: 1

      I also spent much of the '80s in Forth. But as far as a teaching language, I'd say they ought to stick to Lisp for that sort of thing. They're similarly extensible, and I suspect Lisp will be more likely to stand the test of time...

  12. Verbosity is bad because by Limerent+Oil · · Score: 3, Insightful

    Verbosity = ( 1 / Expressiveness )

    1. Re:Verbosity is bad because by Goaway · · Score: 4, Insightful

      Nowhere near true. Objective-C is more verbose than C, yet still more expressive, and largely self-documenting to boot.

    2. Re:Verbosity is bad because by Limerent+Oil · · Score: 1

      For a given task, one language is more expressive than another language if the former takes fewer LOC to accomplish the task than the latter. If we take LOC to be a reasonable approximation for verbosity, then verbosity and expressiveness have an inverse relationship.

      I don't know Objective-C, but since C is just a few steps up from assembler, I can accept that Objective-C is probably more expressive than C, since nearly every language is. Thus, I cannot agree with you that Objective-C is more verbose than C. You and I must be using different definitions of "verbosity".

    3. Re:Verbosity is bad because by CarpetShark · · Score: 1

      Objective-C is more verbose than C

      I think the GP was correct. For example, this Objective C code:


              [my_list addEntry: my_val];

      is hardly more verbose than:


            gtk_list_widget_addEntry(my_list, my_val);

      and that becomes much more of an issue when you accumulate those small extra namespace prefixes over a whole program.

    4. Re:Verbosity is bad because by HiThere · · Score: 1

      It needs to be self documentation, because there's just about no documentation of Objective-C available...that isn't platform specific.

      Sorry, but I've looked at learning Objective-C several times, and always bounced because of the truly pitiful documentation. Admittedly I didn't buy a book about how to use Objective-C on an iPhone (or whatever that was). I was interested in it as a programming language, and bounced when the documentation about that was so abominable. (I have the vague impression, e.g., that functions are only allowed to have one parameter. This *MUST* be wrong, but I couldn't find any documentation that would tell me that it was.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    5. Re:Verbosity is bad because by jeremyp · · Score: 1, Informative

      Try this link
      Objective C tutorials

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    6. Re:Verbosity is bad because by techprophet · · Score: 1

      But it's slower. Much slower IME. If I'm not writing performance-intensive programs then I might use Obj-C, but not otherwise.

    7. Re:Verbosity is bad because by HiThere · · Score: 1

      Following several links from that I reach the conclusion that:
      a) If you aren't developing for a Mac, or other Apple machine, you probably shouldn't bother with Objective-C, and
      b) You can pass multiple parameters by defining a function which takes multiple named parameters, and using the names of the parameters each time you call. The names of the parameters will be considered a part of the name of the function.
      c) And if you happen to define a numeric type, like, say, complex numbers, forget about using +, -, *, /, etc. for the arithmetic operations. You need to call it with names like add:, sub:, mul:, div:, etc.

      It may have some advantages, but if so they were never displayed in the tutorials. (Actually, there appears to be a dialect of Objective C for the Mac [it wasn't stated that it was available elsewhere] which implements properties. I.e., getter and setter functions that can be addressed by the naked name of the variable. That's an improvement over C++ and Java. Not over many other languages, such as D and Python.)

      To me it appears that Objective C/C++ has missed the boat. It appears to be falling behind various languages that are almost standing still. (I'm *not* impressed by it's way of allowing a function to accept multiple arguments. In Smalltalk that almost works, but Smalltalk has a much cleaner syntax than does Objective C. (And even in Smalltalk I find it bothersome.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    8. Re:Verbosity is bad because by Goaway · · Score: 1

      The method syntax is exactly the verbosity I was referring to, and it does have the big advantage of making code self-documenting.

      You kind of have to use it for a while to really get it, though.

    9. Re:Verbosity is bad because by Goaway · · Score: 1

      True, but entirely off topic.

    10. Re:Verbosity is bad because by Anonymous Coward · · Score: 0

      Verbosity = ( 1 / Expressiveness )

      It gets much worse when Expressiveness = 0

    11. Re:Verbosity is bad because by techprophet · · Score: 1

      Not off-topic.

      Comparing the Size, Speed , and Dependability of Programming Languages

    12. Re:Verbosity is bad because by robthebloke · · Score: 1

      In a thread about code size vs slowness?

    13. Re:Verbosity is bad because by jc42 · · Score: 1

      (I have the vague impression, e.g., that [Objective-C] functions are only allowed to have one parameter. This *MUST* be wrong, but I couldn't find any documentation that would tell me that it was.)

      Actually, you don't have to be wrong. There are a number of rather powerful languages that, strictly speaking, provide for only a single parameter to a function, but since that parameter can be a complex data object, it's not the limitation you might think.

      For example, both LISP and perl have functions with just one parameter, but that parameter can be a list, which is a first-class data type in both languages. This means that you can pass arbitrary-length lists of values to a function, and it has the tools to run through the entire list.

      This is much more powerful than the approach in languages that only allow for a fixed number of named function parameters, since in such languages, every parameter is a special case, and you can't iterate through the parameters except by explicitly listing the names of the parameters.

      Language designers have invented all sorts of different function semantics, and some are a lot more powerful than what the Algol/Pascal/C class of languages provide.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    14. Re:Verbosity is bad because by Goaway · · Score: 1

      This particular branch of the discussion is about verbosity in general, not about speed.

  13. Where are the real lanaguages??? by jackb_guppy · · Score: 4, Interesting

    Where Cobol and RPG, the languages that run business?

    1. Re:Where are the real lanaguages??? by DoofusOfDeath · · Score: 5, Funny

      Where Cobol and RPG, the languages that run business?

      They were so far off the top and right axes, the algorithm discarded them as outliers.

    2. Re:Where are the real lanaguages??? by ceoyoyo · · Score: 1

      Top right.

    3. Re:Where are the real lanaguages??? by StormReaver · · Score: 1

      > Where Cobol and RPG, the languages that run business?

      I saw them being led into the alleyway. If we're lucky, we'll hear gunshots soon.

    4. Re:Where are the real lanaguages??? by jd · · Score: 2, Funny

      They wrapped round. You have to turn the PNG over and look at the back.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    5. Re:Where are the real lanaguages??? by Anonymous Coward · · Score: 0

      Actually, bottom left. There is not a "modern" language today that is built for the BULK processing that these two. Like single instructions that move or compare up to 16k long fields (data structures or records). It is why these languages continue today.

    6. Re:Where are the real lanaguages??? by ralphdaugherty · · Score: 1

      Where Cobol and RPG, the languages that run business?

      They were so far off the top and right axes, the algorithm discarded them as outliers.

            RPG would put every language except C to shame, and yes, it could execute all the benchmark code. However, given that there's no real RPG compiler outside of OS/400, it's sort of a moot point.

            On the other hand, not only can RPG, COBOL, C/C++, Java, and PHP be benchmarked in OS/400 (now i5/OS or just i), but probably every one of these languages in TFA can also be benchmarked in the Unix subset of OS/400. And for any that might be implemented in Linux only (unlikely), can be benchmarked in a Linux partition on the iseries, concurrently with the OS/400 benchmarking.

            But like I say, RPG would blow away all the script languages and Java, and that's even with not doing what it's forte is, business data processing, where it would blow C/C++ away as well.

            Not that the syntax format makes a difference in speed, but RPG syntax now is similar to other languages with free format as far as coding, readability, and maintenance go. And the Integrated Language Environment of mixing RPG and C++ among others, calling Java class methods directly, calling any Unix program directly, and being called directly by PHP or SQL stored procedures preceded and is superior to later ripoffs such as .NET.

            So yes, off the charts, but in the best direction.

        rd

  14. What kind of verbosity? by Timothy+Brownawell · · Score: 5, Interesting

    I think verbosity in moderation is necessary. I have read many an article with developers arguing that they don't need to document their code when their code is self-documenting. Do you make all of your variables and class/function/methods a single character for the sake of verbosity? I hope not. And I would think that reading and maintaining that code would be far less than a joy.

    Long meaningful identifiers are useful. Needing 5 lines of setup for each API call is annoying, particularly if those 5 lines are usually the same. Requiring lots of redundant long keywords to "look more like English" is annoying. Large standard libraries that let you remove most of the tedious parts from your code are useful.

    1. Re:What kind of verbosity? by dwater · · Score: 1

      > Needing 5 lines of setup for each API call is annoying, particularly if those 5 lines are usually the same.

      Doesn't this sort of thing help with testing though? I guess it 'depends', but if you are testing some part of the code, then it's much easier to pass in the things it needs so that you can control it's environment - otherwise you're trying to dissect the code from within, sometimes even needing 'friend' type relationships or perhaps even making it impossible(?).

      I think they call it 'dependency injection' or something like that...yup,it's in this talk. I guess it's just one form of 'setup' and there are other times when it's pointless.
      ...or did I misunderstand the talk?

      --
      Max.
    2. Re:What kind of verbosity? by gdshaw · · Score: 1

      I look at it this way. Verbosity that I the programmer /choose/ to add in the interests of readability is generally good.

      Verbosity required by the language, the standard libraries, or some sadist who happened to write the coding standard, is almost invariably bad.

    3. Re:What kind of verbosity? by Raffaello · · Score: 1

      Yes. This suggests that a compressibility metric is a good inverse measure of a language's expressiveness. IOW, the more compressible the source is, the more the programmer has to repeat boilerplate code in that language. Expressive languages would not necessarily have the smallest code size, but they would have the smallest ratio of uncompressed source size to gzipped source size. It would be nice to see the submitter's graphs redone with code size replaced by:

      code-size / gzipped-code-size

    4. Re:What kind of verbosity? by Goaway · · Score: 2, Insightful

      Verbose standard libraries can help immensely with keeping code self-documenting.

    5. Re:What kind of verbosity? by ls671 · · Score: 1

      No language will have APIs for all you might want to do in order for you to use only one line of code !

      This is why they teach how to build custom utility methods in schools. In fact, the first time that you repeat 3 or 4 lines of code in your work means it is time to write a utility method.

      Be careful although, one should always check that this functionality isn't already implemented in standard libraries in order to avoid re-inventing the wheel.

      --
      Everything I write is lies, read between the lines.
    6. Re:What kind of verbosity? by ucblockhead · · Score: 5, Informative

      Exactly.  As an example:

      for item in list:
        print list

      for(object o in list) {
        Item item = (Item) o;
        System.Out.Println(item);
      }

      for(std::list<Item*> it=list.begin();it!=list.end();it++) {
         cout << (*it)->name << "\n";
      }

      Three languages.  Same identifiers.  Big difference in both verbosity and readability.

      --
      The cake is a pie
    7. Re:What kind of verbosity? by Anonymous Coward · · Score: 5, Funny

      And yet you managed to write buggy code in the most terse and readable of them. So much for dynamic languages.

    8. Re:What kind of verbosity? by MichaelSmith · · Score: 1

      Exactly. As an example:

      for item in list:
      print list

      Is that right?

    9. Re:What kind of verbosity? by jgrahn · · Score: 1

      > for(std::list it=list.begin();it!=list.end();it++) {
      > cout name }

      You obfuscated the C++ version with pointers and a 'name' member. It should have gone

      for(std::list it=list.begin(); it!=list.end(); ++it) {
            cout *it "\n";
      }

      Still uglier than Python, but at least it's fast and type-safe.

    10. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      FYI, In your first example I think you meant to write "print item" rather than "print list"

    11. Re:What kind of verbosity? by ydrol · · Score: 2, Insightful

      for(object o in list) {
          Item item = (Item) o;
          System.Out.Println(item);
      }

      What language is this? If its Java maybe

      for(Item o : list) {
          System.Out.Println(o);
      }

      Although java 1.4 would have been more painful..

      http://leepoint.net/notes-java/flow/loops/foreach.html

      Also I guess there are times when strong typing is considered expressive and when it is considered overly verbose.
      In a large application, weak typing sometimes is a PITA, in a short script it is lovely.

    12. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      ...and the only bug in the tersest one. Why print the list len(list) times?

    13. Re:What kind of verbosity? by ucblockhead · · Score: 2, Insightful

      One suspects I'd have found that bug pretty rapidly.

      If you can point me at a language that guarantees bug-free programs, I'd like to see it.

      --
      The cake is a pie
    14. Re:What kind of verbosity? by ucblockhead · · Score: 1

      no.

      --
      The cake is a pie
    15. Re:What kind of verbosity? by Tweenk · · Score: 1

      None of the examples work. It should have been:

      for item in list:
          print "\n".join([str(x) for x in item])

      for(Item o : list) {
          System.out.println(item);
      }
      (if it was Java)

      for(std::list<Item*>::iterator it = list.begin(); it != list.end(); ++it) {
            cout << *it << "\n";
      }
      (assuming Item has operator<< overloaded for stream output)

      --
      Those who would give up liberty to obtain working drivers, deserve neither liberty nor working drivers.
    16. Re:What kind of verbosity? by rrohbeck · · Score: 3, Insightful

      I prefer
      print foreach @list;
      though. Perl FTW as usual :)

    17. Re:What kind of verbosity? by kinkozmasta · · Score: 1

      for(std::list<Item*> it=list.begin();it!=list.end();it++) {
      cout <&lt (*it)->name << "\n";
      }

      Or you could do it the "real" c++ way and be less verbose with increased flexibility.

      copy(list.begin(), list.end(), ostream_iterator<Item*>(cout, "\n"));

    18. Re:What kind of verbosity? by d3matt · · Score: 1

      haven't done much with c++ std libs, but should it be

      for(std::list * it...)

      or does std::list imply a pointer type?

      I hate typedefs that are pointer types. If I want a pointer type, I want to explicitly say *.

      --
      I am d3matt
    19. Re:What kind of verbosity? by dpilot · · Score: 1

      Oh, come on. If you're going to be terse about printing a list, nothing beats APL.

      Unfortunately I haven't touched APL in a quarter century, and can't remember how to print. However, if console output is sufficient, here's how to print the contents of "list" in APL.

      list

      --
      The living have better things to do than to continue hating the dead.
    20. Re:What kind of verbosity? by ruroshin · · Score: 1

      for(object o in list) {
        Item item = (Item) o;
        System.Out.Println(item);
      }

      For a one liner you don't need the brackets and you don't have to cast objects if the list was properly declared. You could write above:

      for(Item item: list)
          System.out.println(item);

    21. Re:What kind of verbosity? by thechao · · Score: 1

      Let me amend that last line of code for you (C++0x, auto variables and for-range loops):

      for (auto it : list)
        cout << (*it)->name << "\n";

      ... although, I am not going to argue that, in general, C++ is a damn wordy language.

    22. Re:What kind of verbosity? by setagllib · · Score: 2, Informative

      Scala, just as type-safe as C++ with good performance and excellent JVM integration:

      scala> val list = List(3, 4, 2, 1)
      list: List[Int] = List(3, 4, 2, 1)

      scala> list foreach println
      3
      4
      2
      1

      You know very well this is a big deal for the future of programming.

      --
      Sam ty sig.
    23. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      while(lst.Next())
            Print(lst.Current());

      The above is C++. Just because there is a concoction called "The Standard C++ Library" doesn't mean you have to use the monstrosity. I suggest that my example is of the thing that resides in the bottom left of the chart.

      (Your example is unclear (or at least the semantics of the languages other than C++ you gave are so ugly as to be confusing) so I assumed your example was one wanting to "print" the whole list, which is clearly (to me) what the C++ example you gave does).

    24. Re:What kind of verbosity? by Rob+Riggs · · Score: 1

      I like it, but it is not C++ (yet). auto, for-range loops, and lambda functions are going to do wonders for making C++ less verbose and more expressive.

      --
      the growth in cynicism and rebellion has not been without cause
    25. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      (map print list)

    26. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      a shortened version of your c++ example

      BOOST_FOREACH(Item * item, list)
              cout name "\n";

    27. Re:What kind of verbosity? by SleepingWaterBear · · Score: 1

      It should have been:

      for item in list: print "\n".join([str(x) for x in item])

      for item in list: print item

      works and produces the same output in the python version. I suppose creating a single string saves you a few function calls, but if you're using print statement it's a safe assumption that performance isn't your top priority, and the more legible version is preferred.

      Alternatively

      print "\n".join(list)

      is probably better if you're really set on just making a single call to print. (well, ok, technically, list is a reserved word in python so in both the examples above that's a problem, but I stuck with the name since I inherited it from the GP)

      Actually, now that I actually look at your code more closely, I think that it would print every character in each string separated by line returns, and still make as many print calls is your list has items... you really should check your code more carefully if you're going to be correcting people.

    28. Re:What kind of verbosity? by SleepingWaterBear · · Score: 1

      I'm really getting nitpicky now, but my second example only works if the list is a list of strings (the first example is good for a list of basically anything). If you want to print an arbitrary list with a single call to print, and with line breaks between the entries, the correct code would look something like:

      print "\n".join(str(item) for item in list)

      which may be what Tweenk was aiming for

      for item in list: print item

      remains the most elegant solution in my mind

      Of course, if you just want to print the damned list,

      print list

      works just fine no matter what the list is made of. The extra code is really just there to insert line breaks.

    29. Re:What kind of verbosity? by helixcode123 · · Score: 2, Interesting

      Or just:
      print "@list";

      Perl. It puts the "fun" in your functions!

      --

      In a band? Use WheresTheGig for free.

    30. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      Not to be cheeky, but the first example you posted shows the practical advantage of clarity.

      The error is easy to catch, and very obvious. The mental checks and comparisons needed to throw a flag are minimal.

      for item in list:
              print item

    31. Re:What kind of verbosity? by heson · · Score: 1

      The java error is epic as where it shows why (many/most) java programs are slow (to the point of useless). Noob programmers creating/deleting objects en mass for no reason.

    32. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      C++0x :)
      for(auto item : list)
      {
              std::cout << *item << std::endl;
      }

    33. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      You managed to code a bug in the second line. i'll vote for a language where such bugs are caught by preprocessor/compiler/lint , rather than at runtime. Even if it comes at the cost of greater verbosity. No programming language will ever save you from expressing your intent clearly.

    34. Re:What kind of verbosity? by Madsy · · Score: 2, Informative

      copy(alist.begin(), alist.end(), std::ostream_iterator(cout));
      Not to mention std::for_each and std::transform from .
      Probably just me, but I find your C++ example code slightly unfair.

    35. Re:What kind of verbosity? by Madsy · · Score: 1

      Eh.. I used HTML in the last post, so "" didn't show up due to the . My bad.

    36. Re:What kind of verbosity? by Phreakiture · · Score: 1

      I believe you have a typo . . . Shouldn't your first example say "print item" rather than "print list"?

      Now, how about this:

      print join ("\n", @list);

      Perl, of course. It's very clear and meaningful, and very concise, all at once. It also eschews all of the visual cruft of having to build a loop when one is really not needed.

      Perl gets a bad rap for some of the serious junk that is written in it, but I think that an example such as the one I just gave demonstrates that there is great power there, and that it can work well if coupled with an appropriate level of responsibility.

      --
      www.wavefront-av.com
    37. Re:What kind of verbosity? by ThePhilips · · Score: 1

      No language will have APIs for all you might want to do in order for you to use only one line of code !

      It seems you never seen C++'s STL.

      I envy you already.

      --
      All hope abandon ye who enter here.
    38. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      I'll say. Big difference in output too.

      I think you meant print item?

    39. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      C++0x:

      for (Item &o : list)
              cout o;

      Get with the times. Your C++ is below C++89 standard - overload operator as you do with the other languages for a somewhat comparable result. You forgot "::iterator" and you used it++ whereas it's common practice (and on bad compilers quicker) to use ++it.

    40. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      I prefer
      print foreach @list;
      though. Perl FTW as usual :)

      or with 5.10

      say "@list";

    41. Re:What kind of verbosity? by Taevin · · Score: 1

      Doesn't this sort of thing help with testing though? I guess it 'depends', but if you are testing some part of the code, then it's much easier to pass in the things it needs so that you can control it's environment

      I think they call it 'dependency injection' or something like that.

      If you're talking about something like (pseudo-code):
      var file = File.Open("path");
      var stream = new StreamReader(file);
      var contents = stream.ReadAll();

      and testing the above, I think you're referring to "mocking." That is, you can create fake (mock) objects to test individual parts of the above. Instead of telling "StreamReader" to read from whatever is returned by File.Open, you could instead create a "MockFile" class and pass it in to the StreamReader. This allows you to test the functionality of StreamReader by varying the data returned, or simulating conditions that may be hard to force otherwise (like file system corruption, access permissions, etc.).

      Dependency Injection is a separate concept that is intended to reduce tight coupling between classes. If you have a class that needs a connection to a database, instead of that class creating it's own instance or retrieving one explicitly from elsewhere in the code, it should instead be "injected" via a constructor or method parameter, usually via an interface instead of an implementation so that the class is also decoupled from explicit implementations of a type. For example:
      public MyType(IConnection connection) // constructor
      There exist many dependency injection frameworks that are designed to allow you to specify dependencies like the above without having to handle all the details of injecting the actual instances into the constructor. You simple request a new instance of a type and it fills in the blanks for you.

      So, more on-topic, yes, having those 5 lines of setup code can improve testability. When we're talking about standard library code though, it's kind of a mess. You end up having to sprinkle your code with these little bits of dirt and perform the little rituals the library demands. In theory, you shouldn't need to be testing your standard library since it should already be done (and the results well documented). However since that's rarely the case, I suppose there is something to be said for having the option. Still, I agree with the GP that this sort of thing is "annoying". In my opinion the best solution is to provide options for both expressiveness (such as many ways to create a StreamReader) and minimizing verbosity (like var contents = File.ReadAll()).

    42. Re:What kind of verbosity? by robthebloke · · Score: 1

      They both messed up....(I'm guessing due to html)

      You iterate with an iterator type, not a pointer.

      for(std::list < Item >::iterator it=list.begin(); it!=list.end(); ++it) {
      cout << *it "\n";
      }

    43. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      Purposefully making things more verbose? Priceless.
       
      Someone has an agenda.

    44. Re:What kind of verbosity? by cadu · · Score: 1

      for item in list:
                                                  print list

      ------program output--------

      Oops!Oops!Oops!Oops!Oops!Oops!Oops!Oops!
      Oops!Oops!Oops!Oops!Oops!Oops!Oops!Oops!
      Oops!Oops!Oops!Oops!Oops!Oops!Oops!Oops!
      Oops!Oops!Oops!Oops!Oops!Oops!Oops!Oops!
      Oops!Oops!Oops!Oops!Oops!Oops!Oops!Oops!
      FAIL!FAIL!FAIL!FAIL!FAIL!FAIL!FAIL!FAIL!

    45. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      Umm, assuming that your second example is supposed to be Java, I don't think that you even write decent Java code. I would write that loop as
              for (Object obj : list) {
                    System.out.println(obj)
              }

      This is ALMOST as compact as the first (Python?) example. It just has some Object typecasting and braces that add very mild verbosity. The braces are bad: Java should have followed Pythons excellent lead and eliminated them (as long as tab char indenting is mandated to specify blocks; not spaces, spaces chars are evil for indenting, but thats another battle...).

      This brings up another point: I could write that Java in a one liner as
            for (Object obj : list) System.out.println(obj)
      if I want to.

      So how much verbosity is intrinsic to the language, and how much is just due to the style preference of the implementing programmer?

    46. Re:What kind of verbosity? by zoips · · Score: 1

      Well, that's also kind of why Sun has invested so much effort into the GC; anymore the creation of such short-lived objects in a tight loop will have very minimal effect on the runtime speed and memory usage.

    47. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      And it also didn't show up in your follow-up post. You know, there is a "Preview" button on the comment submission page. I suggest that you use it from now on. Also, learn about "&lt;" et al.

    48. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      control it's environment

      "its".

    49. Re:What kind of verbosity? by Anonymous Coward · · Score: 0

      There was no object instantiation at all in that piece of code. Even if that were valid Java code (it's just a meaningless mess of what seems to be Java, C# and JavaScript), casting an object is a very very efficient operation on a good JVM, particularly if it can prove the enumerable only contains objects of that kind (turning into zero opcodes).

    50. Re:What kind of verbosity? by triso · · Score: 1

      FYI, In your first example I think you meant to write "print item" rather than "print list"

      So, was it easier to find that bug in the least verbose example compared to the other two examples? asked another way: Does the verbosity affect readability?

  15. Ocaml by LaminatorX · · Score: 3, Interesting

    Every time I see one of these things, OCaml always rocks it. I wonder why it never caught on to a greater degree?

    1. Re:Ocaml by Anonymous Coward · · Score: 0

      Maybe b/c people assumed the language was an OHors designed to specifications of OComitee?

    2. Re:Ocaml by 16384 · · Score: 3, Insightful

      I don't about the rest of you, but functional languages don't fit my brain, and to me it's not worth the struggle. On the other hand, procedural/OO languages are no trouble at all, and I can learn new ones quickly. I don't understand why anyone would choose lisp, scheme, etc. Maybe they were born with bigger stacks, because when working with functional languages I'll go into stack overflow mode in a jiffy :-)

    3. Re:Ocaml by Daniel+Dvorkin · · Score: 3, Interesting

      I semi-agree -- procedural languages are much closer to the way most people think, and that's why pure functional languages have remained a niche. OTOH, the power and expressiveness of functional programming is really amazing. It seems to me that this is a major reason for Python's success: it's basically a procedural language (of which OO is a subset) that makes a functional style easily available.

      --
      The correlation between ignorance of statistics and using "correlation is not causation" as an argument is close to 1.
    4. Re:Ocaml by Anonymous Coward · · Score: 4, Interesting

      To be honest, I have the same reaction. I love OCaml, and am frustrated by the fact it hasn't been adopted more. It seems like a no-brainer to me.

      I've been following it over time, and I think the reasons for it have become clearer to me.

      1. I think the biggest reason is hard to articulate well, but basically I think the OCaml developers are sort of unresponsive to the community, which has been embryonic as it is, and as a result there's a sense that it's not moving in directions it should be. Numerical applications, for example, are one domain where OCaml interest has really been high, but the developers have been pretty unresponsive to concerns about matrix implementations. Comments by the developers on concurrency have also puzzled a lot of people. I don't mean to sound like a troll, but I have gotten the sense over time that while OCaml is wonderful as it is, it's not changing or moving anywhere, at least as quickly as it should be (in a bad way). Haskell is a good comparison to me in this regard, as it's a language that is also functional, but not as useful in applications than it is theoretically. However, Haskell has a wonderfully strong community, it is almost a model of how a language and its implementations can grow in a productive way.

      2. OCaml is occupying a difficult position, in that people who want cold, hard performance with stable implementations will go somewhere else (e.g., C); people who want theoretically elegant implementations will go somewhere else (e.g., Lisp, haskell), and people who want something simple will go somewhere else still (e.g., Python, Ruby). OCaml in many ways occupies all three places, but not quite as well as any one of them.

      Having said all of that, it's important to keep in mind that Microsoft is sort of pushing F# for 2010. F# is essentially a Microsoft implementation of OCaml for the CLR--very very close to OCaml--so maybe if F# takes off, there will be a big push toward OCaml.

      It's one of the few times I could say that Microsoft is really on target technically, and might actually move the numerical computing field forward.

    5. Re:Ocaml by Anonymous Coward · · Score: 1, Interesting

      Ocaml can be used as an imperative language. Try that. Try to avoid using any "map" or something like that. You will end up in clean, elegant and *fast* code anyway.

      Ocaml is a functional, imperative and object-oriented language. The oo-style of ocaml is impressing. The type is driven by the available methods, not by the name of a class. This makes coding object-oriented imperative programs in OCaml a funny and quick task.

      If you *also* know how to make advantage of functional programming, you still can, with one of the most advanced functional programming language available.

      If you don't know how to avoid stack overflow it's better you stick with imperative code, but using a language such as OCaml will make you more productive in any case.

    6. Re:Ocaml by maxume · · Score: 1

      Most so-called 'scripting languages' have functions as first class objects (Perl, Ruby, Javascript, etc.) which is a pretty basic requirement for programming in a functional style.

      I guess Python (which is what I use most, but only for this and that) isn't wildly more or less popular than those languages (but it depends on who you ask...).

      --
      Nerd rage is the funniest rage.
    7. Re:Ocaml by TheTyrannyOfForcedRe · · Score: 0, Troll

      There are two explanations for that. #1 You haven't put enough work into learning them. #2 You're not smart enough to be a programmer.

      --
      "Liechtenstein is the world's largest producer of sausage casings, potassium storage units, and false teeth."
    8. Re:Ocaml by alphabetsoup · · Score: 1

      I wonder the same. But I hope with the introduction of F# on VS 2010, functional programming will finally catch on. If anybody has the muscle to push a new language, its MS.

    9. Re:Ocaml by Anonymous Coward · · Score: 0

      Comments by the developers on concurrency have also puzzled a lot of people.

      Personally, they didn't "puzzle" me, they made me go "holy fuck these people are retarded and as interesting as OCaml looks I'm not going to touch it until someone with more than a few brain cells is in charge of shit like that".

    10. Re:Ocaml by Anonymous Coward · · Score: 0

      Closer to how people think? No. It's closer to how people who have programmed in imperative/OO languages for many years think. Do you really think for example (python-ish metacode):

      res = emptylist()
      for i in aList:
          if (i.isFnord()):
                res += i

      is simpler than (haskell-ish):

      filter isFnord aList

      or do you remember your reaction the first time (way, way back) when you saw the line

      x = x + 1

      I've found that functional programming is actually easier to teach to complete novices than imperative code since most of us don't think about problems as lots of tiny steps and functional programming lets you concentrate more on the "what" than the "how". And equality sign really mean exactly what you expect them to (in Haskell at least).

       

    11. Re:Ocaml by Anonymous Coward · · Score: 0

      Don't worry, your just not that clever. Functional languages fit smart people's brains fairly well. And tehy are a real boon if you ever need to describe an algorithm that is actually complicated, as opposed to the usual trivialities most programers deal with daily.

      But functional languages are quite the bitch to optimize at the compiler level, partially because they have so many many more optimizations available, but mostly because the compiler must do the optimizations humans might normally do (or the humans must describe the optimizations other ways).

      One day, almost all code will be written in purely functional languages because they are so much easier to parallelize, but not today.

    12. Re:Ocaml by david.given · · Score: 3, Interesting

      A while back I tried implementing a project in OCaml, because it looked awesome, and I wanted to explore it.

      I found a lot to like about it; it's fast, reasonably clear, has got lots of awesome functional programming features that I actually found myself using while also having a powerful set of imperative programming features for the rest of the logic, and in general worked rather well.

      However, I kept finding myself running again and again into problems caused by the same conceptual design issue, which eventually led to me giving up in frustration.

      The problem was this: an OCaml program is structured as a series of statements, each of which mutates the program in some manner (usually by adding a definition to it). The last statement in the program typically invokes something (such as a 'main' function). The compiler ensures that your program is consistent after every statement. This means that you can't do forward declarations.

      There is an and construct that allows you to define several items of the same kind in a single statement, which is typically used to implement mutually recursive functions, but that doesn't help if you need to items of different kinds to be mutually recursive: for example, a class and an algebraic data type (which I needed to do lots, in order to implement 'object or None' semantics).

      I found this issue everywhere I looked in OCaml; the language semantics require your code dependency graph to be a tree with no cycles, and you have to structure your program strictly in bottom-up form. So not only can you not have two mutually dependent modules, you can't even put your 'main' at the top of the file for clarity.

      Now, my OCaml skills aren't particularly great, so there may be a way round this, but I spent a lot of time looking for a solution to this and didn't find one. This, and other lesser issues to do with code style and namespacing, smell unpleasantly like an academic language that hasn't really learnt to scale gracefully, and I wonder whether it would be a comfortable choice for implementing large projects. These days I'd be inclined to consider Haskell or Clean instead.

    13. Re:Ocaml by Coryoth · · Score: 2, Insightful

      It's closer to how people who have programmed in imperative/OO languages for many years think. Do you really think for example (python-ish metacode):

      res = emptylist()
      for i in aList:
              if (i.isFnord()):
                          res += i

      is simpler than (haskell-ish):

      filter isFnord aList

      I find it tends to be a case of exactly what you are trying to do. Some problems, such as filtering a list, tend to get expressed functionally (though I like python's list comprehension syntax "[i for i in aList if i.isFnord()]"), and the procedural approach looks and feels clunky by comparison. On the other hand there are other problems that are expressed naturally in a more procedural way (often because we think of them in terms of a logical sequence of state based steps) that take some work to wrap up in a functional way. I don't think it is clear that one approach is the right one for all problems, and personally I find I prefer languages that provide expressiveness in both approaches so I can use whatever is more clear.

    14. Re:Ocaml by shutdown+-p+now · · Score: 1

      OTOH, the power and expressiveness of functional programming is really amazing. It seems to me that this is a major reason for Python's success: it's basically a procedural language (of which OO is a subset) that makes a functional style easily available.

      It's not just Python - it has been a recent trend everywhere. Ruby is another example which emphasizes the functional part further. On another end is C# 3.0 with its type-inferred lambdas and LINQ (which is really just generalized map/filter/fold with extensibility hooks for things like SQL mapping). And more lately we see languages designed from scratch to be hybrid imperative/OO/FP - Scala and F# being two prime examples.

    15. Re:Ocaml by HiThere · · Score: 1

      Because it isn't clear how to write a file?

      When I looked I couldn't figure out how to write fixed length binary records to calculated locations. Something involving monads is all I could guess, but I still don't know what a monad is. Leibniz talked about monads as having no externals (no I/O ports?), but I'm not sure this is what OCaML meant.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    16. Re:Ocaml by TheTurtlesMoves · · Score: 1

      A big problem with higher level languages is tools. They give awful error messages and often you don't even have a line number. As an example consider scheme. Its the error in the way the macro was called or the macro itself? Now consider that often standard language constructs are often implemented with macros we now need to consider a macro of a macro of a macro. Now try to understand that error message.....

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
    17. Re:Ocaml by master_p · · Score: 1

      You conflate the power of functional composition with functional pureness - LISP is not pure, yet it exhibits all the advantages of functional programming languages.

      Functional programming can exist in object-oriented or procedural code. It's only the pure functional programming that creates the issues the GP post talk about (which seems to continuously escape the academics).

    18. Re:Ocaml by setagllib · · Score: 1

      That's Python-ish but it's obviously not Python. The Python would be "res = [i in aList if i.isFnord()]". Ruby or Scala would be more like res = aList.filter{_.isFnord}.

      --
      Sam ty sig.
    19. Re:Ocaml by bored · · Score: 1

      I semi-agree -- procedural languages are much closer to the way most people think, and that's why pure functional languages have remained a niche.

      The way people think is one thing (they can be trained), the problem is that CPU's are linear execution machines. That's the difference between a CPU and a custom piece of logic in VHDL. SMP added parallelism but its _INDEPENDENT_ execution. Anytime those contexts interact they need to be synchronized. Determining the synchronization requirements from a compiler is HARD.

    20. Re:Ocaml by naasking · · Score: 1

      By saying they "don't fit your brain", you are implying that a programmer's brain is somehow naturally wired for programming. This is simply not true. We learn math, logic, and programming, and you could just as easily learn functional programming, and then your brain would be wired for it too. And you'd be better off IMO, because you would unlearn a lot of bad habits people pick up from imperative languages.

    21. Re:Ocaml by naasking · · Score: 1

      Problems with defining recursive modules in ML-style languages are well known. Some ML implementations allow them, but none are as mature as OCaml.

      However, I'm not sure I agree that a language forcing you to structure your program in a certain way is a bad thing. If anything, the improved consistency helps the maintainability of a project. It also helps you keep a uniform mental model of the abstractions working in a program, and helps you compose distinct pieces with very little glue. It just takes some getting used to.

    22. Re:Ocaml by david.given · · Score: 1

      However, I'm not sure I agree that a language forcing you to structure your program in a certain way is a bad thing. If anything, the improved consistency helps the maintainability of a project. It also helps you keep a uniform mental model of the abstractions working in a program, and helps you compose distinct pieces with very little glue. It just takes some getting used to.

      It's more than structure. It completely prevents you (subject to hacky workarounds) from using certain commonly-used design patterns.

      What I was actually trying to implement was a DOM-like tree data structure, where the overall document object contains factory methods for creating nodes and manipulating the tree. However, for the factory to be able to refer to a node I need to define the node class before the factory class... but nodes also have to be able to refer to the factory, and to do that I have to define the factory before the node!

      There are ways around this, the simplest of which is to abandon type safety and treat a node as a generic bag of properties which is only ever manipulated by the factory. But I don't want to do that, because it's a bad abstraction for my problem.

    23. Re:Ocaml by naasking · · Score: 1

      What I was actually trying to implement was a DOM-like tree data structure, where the overall document object contains factory methods for creating nodes and manipulating the tree. However, for the factory to be able to refer to a node I need to define the node class before the factory class... but nodes also have to be able to refer to the factory, and to do that I have to define the factory before the node!

      Your discussion of classes is confusing, as OCaml doesn't have them. I'm also not clear what the use of "factories" is supposed to accomplish. I think a lot of people try to use the same patterns they're used to from other languages, when they're really not necessary in functional languages.

      The Ocsigen project implemented a completely statically typed HTML DOM, so you can use their approach if that's what you're after.

    24. Re:Ocaml by david.given · · Score: 1

      Your discussion of classes is confusing, as OCaml doesn't have them.

      The OCaml documentation says otherwise...

    25. Re:Ocaml by naasking · · Score: 1

      Sorry, got confused; I think of them more as "objects", since they don't follow the same conventions as classes in typical OO languages (structural typing rather than class typing).

      Objects aren't really used very much in OCaml anyway. Check out Ocsigen's functional approach to describing the HTML DOM.

    26. Re:Ocaml by Anonymous Coward · · Score: 0

      And ocaml can do both styles in a clean and efficient way.

  16. HAI by Anonymous Coward · · Score: 4, Funny

    CAN HAS LOLCODE?
    KTHXBYE

  17. Re:C best language out there by Anonymous Coward · · Score: 2, Funny

    It would be better if it was extended to support classes.

  18. Re:C best language out there by Anonymous Coward · · Score: 0

    "C is available on all modern platforms, C has the best compiler of all time on it's side GCC"

    Since when is GCC the best compiler of all time? I'm no expert but I've seen a lot of people complain about GCC, and I'm sure I've read that Intel has a much faster C Compiler.

  19. I think it depends more on what you want to achiev by ledow · · Score: 5, Interesting

    This kind of fits in with my thinking.

    When I was starting out in programming, I just wanted results. I wasn't concerned about performance because the computer was a million times faster than me. I was most concerned about how many "non-vital" keywords were necessary to describe what I wanted the machine to do (e.g. "void main(...)" isn't *vital* because it's just boilerplate. However "if", "for", "while" etc. would be vital - and even for/while are just cousins), and how many of the vital keywords (i.e. those that specifically interfered with the way my program would *actually* operate... a "static" here or there would hardly matter in the course of most programs) were "obvious". Java failed miserably at this... I mean, come on: System.out.println() and the standard wrapping take up too much room.

    So, BASIC was an *ideal* first language (sorry, but it was, and the reason nobody uses it much now is because EVERYONE has used it and moved on to something else - doesn't mean it "breaks" people). In this regard, even things like C aren't too bad - 30-50 keywords / operators depending on the flavour, all quite simple - you could memorise them perfectly in an afternoon. However things like Forth and Perl can be hideous.

    And even C++ is tending towards the stupid. Believe it or not, even things like bash scripting come out quite well under that test. And, to me, that correlates with the amount of effort I have to put in to write in a particular language. If I just want to automate something, bash scripting is fast and easy. Most of the stuff I write is a "one-job program" that will never be reused. If I want to write a program to work something out or show somebody how something is done programmatically, BASIC is a *perfect* prototyping language (no standard boilerplate, no guessing obscure keywords, etc.). If I want to write a program that does things fast, or accurately, or precisely, or for something else to build upon, C is perfect.

    I see no real need to learn other languages in depth past what I'm required to know for my work. I have *zero* interest in spending weeks and weeks and weeks learning YAPL (Yet Another Programming Language) just to spent 90% of that time memorising obscure keywords, boilerplate and the language's shortcuts to things like vectors, string parsing, etc. If I was going to do that, I'd just learn a C library or similar.

    I think that these graphs correlate quite well with that thinking. Let's be honest, 99% of programming is reusing other code or shortcuts - short of programming in a Turing machine, C is one of the simplest languages to learn because it *doesn't* have a million shortcuts... you want to iterate over an array or create a hash / linked list, etc. you have to do it yourself from basic elements. In modern programming, that means a one line include of a well-written library. As far as I was concerned when learning it, even the "pointer++ increases by the size of the pointer" was far too smarty-pants for me, but incredibly useful.

    But with C++, I instantly lost interest because it's just too damn verbose to do a simple job. Java OOP is slightly better but still nasty once things get complicated and the underlying "functional" language is basically a C-a-like.

    I'm a fuddy-duddy. Old fashioned. If I write a program, the damn computer will damn well do instruction 1 followed by instruction 2 with the minimum of flying off into libraries and class systems. If I want 4 bytes of memory to change type, then I will damn well have them change type. And I'll even get to specify *what* 4 bytes of RAM if I want and I'll clean up after them if it's necessary. That's how I think, so things like C match perfectly when I want to code. The fact that C is damn powerful, fast, low-level and so common also add to it's appeal.

    I worry about what will happen when people *only* code in OOP languages. The abstraction is so large that people forget that they are still telling a computer to handle bits and bytes and suddenly they get lazy. M

  20. Ruby by RiotXIX · · Score: 4, Insightful

    On the plus side, both versions of Python can claim many of the smallest programs in the collection. Ruby (8, 1) might also compete for titles, but unfortunately its performance is so bad its star falls off the performance chart.

    Then why the fuck is the Ruby community hyping it so much, and drawing nieve young developers in to a trap?

    Not flamebait.

    Why can't they make a language, or extend a language like Ruby, such that one can program it as a scripting language, but then add verbosity optionally (i.e. declaring the data types and their sizes, private / static etc. & whatever the hell makes a program light weight and fast) optionally? It's my hope that if I stick with Ruby one day it I won't be forced to learn Python because performance won't be "Ruby's big issue" in every discussion, but really, that is *just* a hope. I hope this isn't a mistake.

    --
    "You know you don't act like a scientist, you're more like a game show host." Dana Barret
    1. Re:Ruby by Anonymous Coward · · Score: 1, Insightful

      In fairness, and as one of the commenters pointed out YARV performs better than the std Ruby interpreter it'll be replacing.

      OTOH, lua/luaJIT beats Ruby and Python on all fronts; a lightweight, simple, speedy and expressive language. If we had to pick one scripting language on its merits rather than the personal predjudices of "I know language x" or hype, lua would be it.

    2. Re:Ruby by Anonymous Coward · · Score: 0
      Peter Griffin:

      When I'm through with our schools our students will be so smart they will be able to program their VCRs without spilling piping hot gravy all over myself.

      RiotXIX:

      Then why the fuck is the Ruby community hyping it so much, and drawing nieve young developers in to a trap?
      (...)
      It's my hope that if I stick with Ruby ...

      Heh, sucker.

    3. Re:Ruby by Foofoobar · · Score: 1, Troll

      Why can't they make a language, or extend a language like Ruby, such that one can program it as a scripting language, but then add verbosity optionally

      They did. It's called PHP. Notice how much better it scales in that benchmark.

      --
      This is my sig. There are many like it but this one is mine.
    4. Re:Ruby by Anonymous Coward · · Score: 0

      You're missing the whole point of the language. Ruby is a language for problems where development speed is more important than run-time speed.

      Besides, there's nothing stopping you from coding the bottlenecks in C.

    5. Re:Ruby by s_p_oneil · · Score: 0

      I'll give you a few reasons:
      1) Often the amount of time it takes you to code something is WAY more important than performance.
      2) How clean and easy a program is to maintain is often even more important.
      3) When performance is more important, you probably shouldn't be using a scripting language (or you should go with Lua).
      4) JRuby and YARV (different versions of Ruby) are much faster, and the latest Ruby 1.9.1 is even faster than those.
      5) If you can stand to extend Ruby in C or with COM objects (it's not that hard), Ruby 1.9.1 will do just about anything you want, and you can control performance by writing the slow parts in C. Your only real problem would be using bloated frameworks like Rails, which can't be sped up so easily.
      6) If you can't stand to extend it in C or with COM objects, or if you need native threads, use JRuby. If a piece of Ruby code runs too slow in Ruby, convert it to Java. JRuby doesn't care whether an object is a Java object or a Ruby object.

      "Why can't they make a language, or extend a language like Ruby, such that one can program it as a scripting language, but then add verbosity optionally (i.e. declaring the data types and their sizes, private / static etc. & whatever the hell makes a program light weight and fast) optionally?"

      They already have that. It's called JRuby. Even better than what you suggested, JRuby supports native threads. Run it with an Apache+Tomcat server and watch it put normal Ruby-based web apps to shame in terms of scalability and ease of deployment (probably in terms of reliability, too).

    6. Re:Ruby by Anonymous Coward · · Score: 0

      Considering it only takes a day or two to learn Python, it really wouldn't kill you either way.

    7. Re:Ruby by wumpus188 · · Score: 0, Flamebait

      Because speed is not everything.

    8. Re:Ruby by zuperduperman · · Score: 1

      I think the answer is partly that the different communities involved have mindsets that won't accept that kind of compromise. Suggest to a Ruby coder that they should introduce into Ruby any feature that slows them down or stops them doing "magic" with the language and they'll laugh you out of town. They (as a community) despise it. Key features of various frameworks they use rely on such foibles as modifying types on the fly at run time which make such optimization somewhere between hard and impossible. So they've already rationalized themselves into a position that performance doesn't matter and developer productivity is far more important. It's very hard to back down from there after so many people have bought into this mindset.

      The best hope is with new languages. C# does well, and I think Scala is very promising - it shows well in the graph here but it could do massively better if not for some of the outliers being addressed. Scala is a very young language and actually does exactly what you suggest - it lets you optionally bring in enough "verbosity" to allow the compiler (or JVM, in this case) to optimize the heck out of the code. The important thing is that the community around it has not idealogically rejected either performance or developer productivity as primary and are actively going after both. So it's well situated to do better than most.

    9. Re:Ruby by Foofoobar · · Score: 1

      EEEH! Try again. Development speed is lost as complexity increases. Development speed is again attained through a framework (as all languages can also attain). Ruby has no inherent speed advantages for development. This is an amazing con by RAILS people and anyone can develop well and fast who understands and knows a framework well. I myself use the PHPulse framework and can crank out new CRUD functionality in about 30 minutes to an hour.

      --
      This is my sig. There are many like it but this one is mine.
    10. Re:Ruby by thechao · · Score: 1

      You're desire is for a language that supports "gradual typing"; read about it here: www.cs.colorado.edu/~siek/pubs/pubs/2006/siek06:_gradual.pdf

    11. Re:Ruby by bar-agent · · Score: 1

      Scala is a very young language and actually does exactly what you suggest - it lets you optionally bring in enough "verbosity" to allow the compiler (or JVM, in this case) to optimize the heck out of the code.

      Dylan is not a new language — it was invented about the same time as Java — but it also allows you to optionally optimize the heck out of things. That was an explicit design goal. I was disappointed that it wasn't in the evaluation; I would have liked to see how it did.

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
    12. Re:Ruby by RiotXIX · · Score: 1

      Thanks for that. Druby (http://www.cs.umd.edu/projects/PL/druby/) also seems to be a right step for a faster language.

      --
      "You know you don't act like a scientist, you're more like a game show host." Dana Barret
    13. Re:Ruby by GWBasic · · Score: 1

      Then why the fuck is the Ruby community hyping it so much, and drawing nieve young developers in to a trap?

      Ruby on Rails seems to be intended for rapid prototyping; and web applications that don't need to scale.

      In my career, I've worked on plenty of applications that only need to handle a few concurrent users. The data processing is so valuable that the UI only needs to be good enough to enable a few users to process terrabytes of data that come from heavy machinery. In these situations, Ruby on Rails is much more appropriate then finely-tuned ASP, C#, Java, C++, ect, ect, because the web server will never break a sweat.

  21. Re:C best language out there - what about for web? by walterbyrd · · Score: 1

    C has never caught on for web development, unless you consider C#.

    I thing that browser based applications are going to be even more common in the future.

  22. Be aware of your contexts. by cabazorro · · Score: 2, Insightful

    Contexts can be deceiving.
    Be careful not to use these charts to decide what language to learn or what language is better for a given solution.
    Let's remember the web server ecosystems: cgi, c#, perl, java, python, php, ruby.
    A given algorithm implemented in you language of choice can give you the upper hand
    and instant notoriety; but running the whole operation (labor/maintenance/testing) goes far beyond
    controlled environment testing.

    Lately I've been thinking that
    the more powerful solution (language wise) is the one that you can build and tear down from scratch in less time/effort.
    That gives you more confidence to try new/innovative solutions.
    my 2 cents.

    --
    - these are not the droids you are looking for -
  23. Ada by danwesnor · · Score: 1

    Where's Ada?

    1. Re:Ada by Ada_Rules · · Score: 4, Informative

      Where's Ada?

      One item in the list is gnat which is one particular implementation of Ada. So, there is at least one Ada implementation on the list. I did not recognize any others.

      --
      --- Liberty in our Lifetime
    2. Re:Ada by rally2xs · · Score: 1

      I think its the one labeled "gnat."

    3. Re:Ada by T.E.D. · · Score: 1

      One item in the list is gnat which is one particular implementation of Ada. So, there is at least one Ada implementation on the list. I did not recognize any others.

      Gnat is the only Ada compiler you are likely to see there. I believe the shootout requires a free (as-in cost) implementation of the language. If the poor bastard had to buy compilers for all those languages, he'd go broke pretty quickly.

      Roughly the same logic holds for Fortran, which seems represented there by g95 (the gcc-based Fortran 95 compiler).

      Other interesting languages hidden in there: Scheme ("Stalin", "Gambit", and probably others), Rexx ("Regina"), and Niklaus Wirth's Oberon ("ooc").

    4. Re:Ada by Anonymous Coward · · Score: 0

      Thanks, have to visit sometimes.

  24. ccomparison of C and CAS by e**(i+pi)-1 · · Score: 2, Insightful

    Computer algebra systems are high level programming language. Writing good code does not need
    documentation.  The code itself shows what is done. Here is an example which takes two pictures
    and procuces a GIF movie interpolating them:

    A=Import["image1.jpg"]; B=Import["image2.jpg"];
    width=Length[A[[1,1]]]; height=Length[A[[1]]];
    ImageInterpolate[t_]:=Image[(t A[[1]]+B[[1]] (1-t)),Byte,ColorSpace->RGB,ImageSize->{width,height}];
    Export["mix.gif",Table[ImageInterpolate[k/50],{k,0,50}],"GIF"]

    It takes over a minute to process. A simple C program doing the same is a multiple times larger but also
    needs multiple less time to process. But it needs to be documented because even simple things like
    reading in a picture

      fgets(buffer,1025,in);
      if(strncmp(buffer,"P6",2)){
        fprintf(stderr,"Unsupported file format (need PPM raw)\n");
        exit(1);
      }

      do fgets(buffer,1025,in); while(*buffer == '#');     // get picture dimension
      x_size = atoi(strtok(buffer," "));
      y_size = atoi(strtok(NULL," "));
      fgets(buffer,1025,in);                               // get color map size
      c_size = atoi(buffer);

      if((image = (char *) malloc(3*x_size*y_size*sizeof(char)))==NULL){
        fprintf(stderr,"Memory allocation error while loading picture\n");
        exit(1);
      }

      i = 0;
      ptr = image;
      while(!feof(in) && i<3*x_size*y_size){ *ptr++ = fgetc(in); i++;}
      fclose(in);

    But C it is worth the effort. For more advanced image manipulation tasks for example,
    Mathematica often can no more be used,  due to memory or just because it takes too long
    (Math link does not help here very much since objects like a movie (a vector of images) can just
    not be fed into computer algebra systems without getting into memory problems, which deals with a movie as a whole).
    For computer vision stuff for example, one needs to deal with large chunks of the entire movie).
    While the simplicity of programming with high level programming languages is compelling, speed often matters.

    There is an other nice benefit of a simple language like C: the code will work in 20 years. Computer algebra
    systems evolve very fast and much what is done today does not work tomorrow any more in a new version. Higher
    level languages evolve also faster. And large junks of internal CAS code are a "black box" invisible for the
    user. Both worlds makes sense: the low level primitive, transparent and fast low level language and the slower, but
    extremely elegant high level language.

  25. Where's brainfuck? by xtrafe · · Score: 1

    I, for one, am disappointed that a whole treasure trove of languages was ignored by this study.

  26. Where's D? by Twinbee · · Score: 1

    I wish D was one of the contenders. It'd be shown pretty far to the lower left I'm betting.

    --
    Why OpalCalc is the best Windows calc
    1. Re:Where's D? by wonkavader · · Score: 2, Informative

      Isn't that the 'dlang' reference?

    2. Re:Where's D? by Twinbee · · Score: 1

      Oops oh yeah. Hopefully my original post will get modded into oblivion ;)

      --
      Why OpalCalc is the best Windows calc
  27. C vs C++ by masmullin · · Score: 0

    C++ got a better score. Am I reading this right?

  28. some random observations by bcrowell · · Score: 3, Interesting

    First off, he presents the big chart twice. The second version is meant to compare functional languages with imperative languages, but it's also small enough to fit on my screen, so if you're browsing the article, you might want to look at that one first.

    His "obsolete" sector is really more like a special-purpose sector. For instance, Erlang shows up in the obsolete sector, but that's because Erlang wasn't designed to be especially terse or fast. Erlang was designed to be fault-tolerant and automatically parallelizable. Io also ends up looking lousy, but Io also wast designed to be terse and fast; it was designed to be small and simple.

    The biggest surprise for me was the high performance of some of the implementations of functional programming languages, even in cases where the particular languages aren't generally known for being implementable in a very efficient way. Two of the best-performing languages are stalin (an implementation of scheme/lisp) and mlton (an implementation of ml). However, as the author notes, it's common to find that if you aren't sufficiently wizardly with fp techniques, you may write fp code that performs much, much worse than the optimal; that was my own experience with ocaml, for instance.

    The choice of a linear scale for performance can be a little misleading. For instance, csharp comes out looking like it's not such a great performer, and yet its performance is never worse than the best-performing language by more than a factor of 2 on any task. Typically, if two languages differ by only a factor of 2 in speed, then speed isn't an important factor for choosing between them. The real thing to look out for is that some of the languages seem to have performance that's a gazillion times worse than normal on certain specific tasks.

    Many of the languages are hard to find, because they're listed by the names of their implementations. In particular, g95 is an implementation of fortran.

    1. Re:some random observations by Anonymous Coward · · Score: 0

      The biggest surprise for me was the high performance of some of the implementations of functional programming languages, even in cases where the particular languages aren't generally known for being implementable in a very efficient way. Two of the best-performing languages are stalin (an implementation of scheme/lisp) and mlton (an implementation of ml).

      If you RTFA, you would also notice that Stalin didn't have enough benchmarks ported to it to derive meaningful results.

  29. I wasn't aware... by Anonymous Coward · · Score: 0

    ...that only languages that only remain in usage due to rewriting the programs written in them being too expensive to justify doing so counted as "real languages".

  30. Re:C best language out there by wonkavader · · Score: 1

    I like C, too, but one chooses ones language for the task at hand.

  31. This is totaly stupid by FlyingGuy · · Score: 4, Interesting

    These sorts of things never fail to to amaze me.

    The verbs, nouns, semantics and such used in a given programming language have nothing, I repeat... NOTHING to do with performance!

    What does have to do with performance is the talent of the compiler / interpreter author, nothing more, nothing less.

    C implements ++ and so forth and so on. Pascal does not, you have to express it as var := var + x or in some implementations as inc(var) or inc(var,100). The smart compiler / interpreter author would implement those in the fastest possible way regardless of the particular language.

    The one metric that has real meaning is programmer enjoyment. Do you prefer terseness over verbosity or something in between. Does this languages flow amke you truly appreciate working with it.

    The only other real metric that has any true meaning is again the talent of the compiler / interpreter author. Was the the language parser built so that it can unfold complex statements that are often required to express certain ideas and perform certain operations. Does the language implement your favorite expression, eg: ++ , or something like that, which again harkens back to programmer enjoyment.

    So what it really leaves us with is, "Do you enjoy using that language?" and only you, the programmer can asnwer that question.

    --
    Hey KID! Yeah you, get the fuck off my lawn!
    1. Re:This is totaly stupid by smallfries · · Score: 1

      So language semantics have nothing to do with performance eh? Oh dear. Your experience is clearly much more limited than you estimate it to be. There's a big old world of languages and implementation techniques out there that it would benefit you to learn about.

      From a comment like that you clearly have no idea of the impact on using pass-by-copy or pass-by-reference semantics in a language. Furthermore you are unable to establish what sort of features would make the pass-by-copy faster as it is more amenable to analysis and optimisation. Do you know the difference between static and dynamic despatch in a language, and the performance costs of each? Do you where closures and co-routines can improve performance if the language provides decent support for the programmer to use them?

      Lastly there is the issue of programmer efficiency, as opposed to machine efficiency. If I can code up a problem solution in 1/10 of the time using a higher level language, then the relative efficiency of my high level language and a low level language become very important. People who have learnt more expressive languages than Pascal and C can write code in them much more quickly, and concisely than a low level implementation. For those who are more experienced that you are, the trade-off between verbosity and performance is very important.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    2. Re:This is totaly stupid by Twylite · · Score: 2, Insightful

      The verbs, nouns, semantics and such used in a given programming language have nothing, I repeat... NOTHING to do with performance!

      What does have to do with performance is the talent of the compiler / interpreter author, nothing more, nothing less.

      The empirical evidence then tells us that the authors of assemblers are more talented than those of C compilers, who are in turn more talented that the authors of compilers/interpreters of JITs and dynamic languages. Put another way, you're wrong.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    3. Re:This is totaly stupid by FlyingGuy · · Score: 1

      Oh dear, your argument is not even to the point, but I will reply anyway, if for nothing else then for your edification and to hopefully dissuade you from trying to sound intelligent again in the future.

      Passing by reference is always faster ( with few exceptions ), but there are times when passing by value is more appropriate, so there is not a hard and fast rule, but a rule of thumb. So if you want to speak to that fine although I would direct your attention to the various evaluation methods that have been or are currently used.

      As to the rest of your reply, it only supports my point ( although you don't seem to recognize that ) in as much as programmer efficiency is in almost all instances directly related to programmer enjoyment. I truly enjoy writing in Borland's version of pascal and I am quite efficient, but also enjoy writing in C as well and am not quite as efficient as pascal, but C supports a few language constructs that pascal does not, so again it comes down to programmer enjoyment.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    4. Re:This is totaly stupid by FlyingGuy · · Score: 1

      I normally don't feed the trolls but in your case, your overwhelming lack of logic and a real view of the world needs correcting.

      To represent as you have, that the line of succession in perceived talent follows the progression that you have outlined, is simply pure foolishness as each has it's own difficulties and the more complex the language, the more difficult the task is of turning them into machine readable code.

      So not to put too fine a point on it, not only is your concept wrong, you got the basic assumption backwards.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    5. Re:This is totaly stupid by mr+exploiter · · Score: 1

      Thinking that the design of a programming language is independent of how fast the code written on it runs is at least ignorant. There are some obvious differences between compiled/interpeted languages, and even with JIT compilers, there are some languages that simply are not well prepared to be optimized like others.

    6. Re:This is totaly stupid by Anonymous Coward · · Score: 0

      I normally don't feed the trolls but in your case, your overwhelming lack of logic and a real view of the world needs correcting.

      To represent as you have, that the line of succession in perceived talent follows the progression that you have outlined, is simply pure foolishness as each has it's own difficulties and the more complex the language, the more difficult the task is of turning them into machine readable code.

      So not to put too fine a point on it, not only is your concept wrong, you got the basic assumption backwards.

      Your reading comprehension is just awful, GP was clearly demonstrating by the absurd that the post by FlyingGuy is clearly wrong/stupid.

    7. Re:This is totaly stupid by shutdown+-p+now · · Score: 1

      The verbs, nouns, semantics and such used in a given programming language have nothing, I repeat... NOTHING to do with performance!

      What does have to do with performance is the talent of the compiler / interpreter author, nothing more, nothing less.

      C implements ++ and so forth and so on. Pascal does not, you have to express it as var := var + x or in some implementations as inc(var) or inc(var,100). The smart compiler / interpreter author would implement those in the fastest possible way regardless of the particular language.

      This is all wishful thinking. In practice, language design does have very serious performance implications.

      Here's one simple example. Java doesn't have user-defined structural value types (i.e. types with structural equality and no inherent referential identity), only reference types. C# has both (structs vs classes). Value types are generally more efficient because the compiler doesn't always need to heap-allocate them, doesn't have to guarantee meaningful referential identity comparison for them, and doesn't need to support "null" as a special value.

      Now, in theory, an optimizing Java JIT can analyze how a type is actually used in the code, and deduce from its usage that it is actually treated as a value type, and then optimize it accordingly. However, this requires some quite advanced escape analysis technques - so much so that, IIRC, only the upcoming major Java release actually has this feature. Meanwhile, all C# implementations just do what the programmer told them (by identifying the type as "struct" = value type), enjoying the performance increase. It has been estimated that C# structs are one of the most important factors of why Java doesn't overtake C# performance-wise (because otherwise Java has a better GC and JIT).

      To sum it up: yes, in theory, it is possible to make a perfect whole-program optimizing compiler that can do every trick imaginable, from ideal type inference to escape analysis. In practice, we're still about as far from that as we are from working, production-quality fusion power plants.

    8. Re:This is totaly stupid by smallfries · · Score: 1

      No. You're wrong. Passing by reference is slower when you cannot analyse aliasing, but pass by copy allows CSE.

      And again, no. Programmer efficiency is directly related to the expressiveness of the language. There tends to be a trade-off between expressiveness and efficiency.

      So you know two imperative languages. Do you really think that you are qualified to talk about the range of possible languages?

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    9. Re:This is totaly stupid by Kjella · · Score: 3, Interesting

      I don't think that's the primary scale. I think my primary scale is:

      What level of detail control is the programmer required to and permitted to have?
      How easy is it for a developer to shoot himself (or others) in the foot?
      How often must the developer work around poor or missing language features?

      For example, there's no lower level than assembly but it has no high-level features. Java is high level but has no low-level memory and byte manipulation to speak of. I prefer C++/Qt, I have all the practical high-level functions for the quick gains, yet I can down dive to detailed C/C++ management.

      In terms of "how easy is it to shoot himself in the foot?" I think C/C++ could do much better. Doing all sorts of pointer manipulation is error prone and zero-terminated char arrays are the thing of the devil. And while C++ has exceptions I've never seen them applied consistantly and well like in Java.

      Finally, I think there should only be the need for ONE standard library, not a five library mashup that's kinda standard. Everything else should be modules usually building on top of that library. Java, C# has done it - I emulate it with Qt in C++ because I think STL/boost/whatever is not very good.

      --
      Live today, because you never know what tomorrow brings
    10. Re:This is totaly stupid by FlyingGuy · · Score: 1

      Sigh... Kid I have been doing this for 30 years, I have programmed in most all of them at one time or another. Were done.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    11. Re:This is totaly stupid by smallfries · · Score: 1

      Amusing. We both have the same amount of programming experience then, and yes, I've coded something in most languages at one point. I also write compilers for a living and spend most days examining how changes to language semantics impact performance.

      But hey, if you've finished tossing crap around then you are done. If you feel that you can string a valid point together then continue. In the meantime get the fuck off of my lawn.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    12. Re:This is totaly stupid by sribe · · Score: 1

      The verbs, nouns, semantics and such used in a given programming language have nothing, I repeat... NOTHING to do with performance!

      Wow, this is so deeply untrue that it's flat-out sad it's getting modded up as insightful. Semantics do have a profound influence on what optimizations can be performed, and when, and at what cost.

    13. Re:This is totaly stupid by hendrikboom · · Score: 1

      In terms of not shooting oneself in the foot, Algol 68 and Modula 3 have much to recommend them.

    14. Re:This is totaly stupid by ignavus · · Score: 1

      Which programming language helps you write (and maintain) useful code the fastest?

      Which programming language COMPILER helps you compile code the fastest?

      Which programming language COMPILER produces the fastest binaries?

      Three different questions about performance. Only the first one is about "programming languages" per se.

      I find that I can whip up a prototype program faster in PHP than in C (using PHP in its command line mode). But C binaries run much faster than PHP scripts. So it depends on whether I want faster development time or faster execution time.

      --
      I am anarch of all I survey.
    15. Re:This is totaly stupid by Anonymous Coward · · Score: 0

      Hee-hee, so basically wrong, that I can see and I'm not even a programmer.

      The one metric that has real meaning is programmer enjoyment. Do you prefer terseness over verbosity or something in between. Does this languages flow amke you truly appreciate working with it.

      Example: Ruby. I hear it has lots of enjoyment. Sometimes you shouldn't implement a program in Ruby. Exhibit A: Twitter.

      The only other real metric that has any true meaning is again the talent of the compiler / interpreter author.

      No, the language imposes restrictions that make certain operations easier or harder to perform. Sometimes the language makes some operations impossible to do.

      For example, consider machine code, the lowest level programming language. Theoretically, you could virtualize any platform. In practice, a clean platform like POWER was built for virtualization, while Intel x86 made do with hacks such as VMWare's trap and patch technique until the recent virtualization fad forced AMD and Intel to add extensions for it.

    16. Re:This is totaly stupid by grumbel · · Score: 1

      NOTHING to do with performance!

      That is only true when it comes to syntactic sugar, its not true when it comes to semantics. For example when I write:

      for(int i = 0; i < 100; ++i)
        lst[i] = do_math(lst[i]);

      I don't just tell the compiler what I want to do, but I also say how I want it to be done. The variable i for example has nothing to do with my problem and neither has the forced sequential evaluation. And there isn't an easy way to figure out if do_math() has side effects when it is hidden in some external library either. A compiler will have a much harder time figuring out my intend then in a language that allows me to express what I want to do, instead of how:

      map do_math lst

      Here the compiler knows instantly that I don't care about the order of evaluation and it also knows that do_math doesn't have side effects because its a function, so it can split up the task across multiple CPUs without a problem.

    17. Re:This is totaly stupid by Anonymous Coward · · Score: 0

      This is not really true. E.g. a language that requires dynamic run-time typing will need to do dynamic run-time type checks in the majority of cases (if it can not statically infer the type, which it usually can't unless the language was designed to support type inference, but then it wouldn't be a dynamic language).

      The language design matters for performance.

    18. Re:This is totaly stupid by bar-agent · · Score: 1

      In terms of not shooting oneself in the foot, Algol 68 and Modula 3 have much to recommend them.

      True, but Ada takes first place here. Well, that, or Eiffel. I haven't heard much about Eiffel recently, though.

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
    19. Re:This is totaly stupid by hendrikboom · · Score: 1
      I'm not sure what you mean by "first place". Algol 68 had definitely reached that level of reliability while Ada was still being designed. And the initial Ada design had a lot of problems making data structures involving pointers reliable. I'm not familiar with what happened to the language after the 80's, though.

      Modula 3, Eiffel, and Algol 68 are garbage-collected and statically strongly typed. They are the only languages in which I've written programs of over a thousand lines and had them run correctly the first time I managed to get them through the compiler without error messages. Thes programs involved complicated data structures with dynamic storage allocation.

      I suspect Eiffel would pass this test, too, but I haven't yet had the experience of writing anything that large in Eiffel.

      I have never used Ada. I was involved in some of the WG2.4 consultations on its design.

    20. Re:This is totaly stupid by hendrikboom · · Score: 1

      One of the currently available Eiffels is a variant called smarteiffel. It's free software.

  32. Logarithmic x axis by Twinbee · · Score: 1

    These graphs are great, but it would be nice to see the X axis expressed logarithmically for a greater range of time tests.

    --
    Why OpalCalc is the best Windows calc
  33. Re:I think it depends more on what you want to ach by nekozid · · Score: 1

    I got to 'void main' and stopped reading.

  34. Re:I think it depends more on what you want to ach by Compholio · · Score: 1

    ... Sue me if I want to automate stuff in bash script, or demo stuff in BASIC because it's quick and easy, or write stuff in C because I can see what's damn well going on. ...

    I agree with you for the most part, but I've found that in C it is really difficult to do keep track of large numbers of different physically-representable constructs. If you end up doing this you get to have a lot of "fun" with structures within structures, especially if you decide to change something at a fundamental level. So, for that kind of purpose I tend to switch over to C++ for it's C-like OOP goodness.

    However, I strongly believe that OOP languages are frequently used inappropriately. I believe Java is a perfect example of this, as you pointed out it is not necessary to represent the concept of "output data to the console" as several different layers of objects. On a side note, switching to C++ pisses me off in some applications since C++ doesn't include support for C99 complex numbers (representing these numbers w/ classes is, IMHO, stupid).

  35. Servers are cheap and getting cheaper by Anonymous Coward · · Score: 0

    Servers are cheap and are becoming cheaper all the time. It's much cheaper to load balance between multiple servers or upgrade current servers when necessary, than it is to pay programmers to code in a verbose language, especially for new companies or products that aren't doing millions of transactions everyday.

    Performance isn't all about processor efficiency.

    1. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 3, Interesting

      Funny, isn't this what Twitter thought too before dumping RUBY entirely? Wasn't this what Twitter thought as they threw more and more hardware at the problem and still could not solve the problem? Didn't Twitter end up spending more on IT to administer 2-3 times the numbers of servers that it would take to do the same thing in Python, PHP or Java?

      Yeah, throw hardware at it. That's a viable solution for a company. As long as you aren't thinking about who has to maintain all those servers and the fact that RUBY STILL DOESN"T SCALE.

      --
      This is my sig. There are many like it but this one is mine.
    2. Re:Servers are cheap and getting cheaper by evol262 · · Score: 1

      See this and leave off your trolling. Ruby has its problems, and performance is one of them, but scaling is not so long as you don't re-invent shitty event systems yourself (like Twitter did).

      --
      "The more corrupt a society, the more numerous are its laws." -Tacticus
    3. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      Thats the funny thing. Whe Twitter was using Ruby, the Ruby community said 'Look at Twitter'. When Twitter dumped Ruby and said it didn't scaled along with everyone else, the Twitter community said 'ignore Twitter, they don't understand anything'.

      You can't have you cake and eat it too. Either the company you touted as a prime example of Ruby's capabilities showed that Ruby couldn't scale or you effectively showed that the Ruby community is a bunch of blowhards who cannot accept cold hard facts.

      Either way, the honeymoon and hype are over. Ruby's market share will not ebb and wane like all other languages based upon it capabilities rather than insane speculation.

      --
      This is my sig. There are many like it but this one is mine.
    4. Re:Servers are cheap and getting cheaper by evol262 · · Score: 1

      Don't make me a strawman. I am not part of the Ruby community, but I'm not a rabid fucking PHP fanboy either (you).

      I can, though, have my cake and eat it, too. The simple fact is that Twitter suffered from NIH and implemented a half-assed homegrown queue and state machine that they didn't significantly update for years. They did not even try JRuby or rewriting -- an employee rewrote in in Scala for the hell of it and it performed better. Notably, large parts of Twitter are still using Rails, just not that one.

      You're looking for an excuse to hate Ruby, and I don't really know why. It's a tool. It may have been the right tool, it may have been the wrong tool, but Twitter didn't even try. Scribd? Hulu? Yellowpages? They don't scale? Sure, not as many sites run Rails as PHP, but don't blame the language for shoddy craftsmanship (Twitter's event stack).

      It's not going to die as quickly as you think it will, and even if it does, it's virtually guaranteed to be something like ASP MVC or Django which takes its place.

      --
      "The more corrupt a society, the more numerous are its laws." -Tacticus
    5. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      Don't make me a strawman. I am not part of the Ruby community...I can, though, have my cake and eat it, too.

      Yeah. You're not in denial at all. You call me 'rabid'? All I saw in your comments was 'ruby ruby ruby ruby'. Talk about denial.

      --
      This is my sig. There are many like it but this one is mine.
    6. Re:Servers are cheap and getting cheaper by evol262 · · Score: 1

      You also saw Scala, among other things. If you saw "ruby ruby ruby ruby" it's because you spouted uninformed bullshit, and though I'm not a Rubyist, you could at least get it right.

      If you actually bothered to read the rest of the reply, you'd see why Ruby was not the problem, though I admit that performance is not one of Ruby's strong points.

      Not that you're going to change your mind, no matter what sites are running Ruby (I'll add GitHub and Penny Arcade to that list).

      --
      "The more corrupt a society, the more numerous are its laws." -Tacticus
    7. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      Uh huh. Ininformed bullshit. Riiiight. I spout what everyone else 'spouts', what the development community 'spouts', what enterprises 'spout', what benchmarks 'spout' and like all RUBY fanatics, you throw a tantrum?

      Did I expect anything less than a tantrum from someone using a toy language?

      --
      This is my sig. There are many like it but this one is mine.
    8. Re:Servers are cheap and getting cheaper by evol262 · · Score: 1

      You are not listening. I do not use Ruby. I use Perl and Python, given that I'm a systems administrator.

      Your uninformed bullshit was an explicit reference to Twitter, as it's apparent that you don't know anything about there internals or why performance was crap. Pointing out facts to you is not a tantrum.

      Go back to your "real" language and with its ripped-off Perl mysql_escape_string vs. mysql_real_escape string. Do try learning something new every now and then, though. Different paradigms make you a better developer.

      --
      "The more corrupt a society, the more numerous are its laws." -Tacticus
    9. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      And I never said I was a PHP dev. You did. I happen to work in C and Java and PHP. And you fail to see that what you are explaining is only one tiny aspect of the puzzle. Much like your brain. You rant about JRuby (while better because it is based on Java) is still crap because it is an interpretted LAYER. See? You THINK you are explaining things but understand VERY LITTLE. Thats why those benchmarks for JRUBY show it still being worse than PHP, PYTHON and PERL.

      I love it when people who have been programming for a year decided to flame on slashdot because it shows them for the tards they are.

      --
      This is my sig. There are many like it but this one is mine.
    10. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      Oh and as a self professed sys admin, you know jack shit about development. Why don't you go write a BASH script or something and leave development to people who know what they are talking about? Sheesh. It's like getting preached to on rocket science by a car mechanic.

      --
      This is my sig. There are many like it but this one is mine.
    11. Re:Servers are cheap and getting cheaper by evol262 · · Score: 1
      You've got to be kidding me. You:

      Why can't they make a language, or extend a language like Ruby, such that one can program it as a scripting language, but then add verbosity optionally They did. It's called PHP. Notice how much better it scales in that benchmark.

      EEEH! Try again. Development speed is lost as complexity increases. Development speed is again attained through a framework (as all languages can also attain). Ruby has no inherent speed advantages for development. This is an amazing con by RAILS people and anyone can develop well and fast who understands and knows a framework well. I myself use the PHPulse framework and can crank out new CRUD functionality in about 30 minutes to an hour.

      You are clearly a PHP dev.

      I mentioned JRuby once. Interpreted "layers" are not written directly on top of the JVM or CLR (see: IronPython, IronRuby, Jython, JRuby, Scala, Clojure, etc). By your definition, Scala is also a "layer." The benchmarks for JRuby are bad because there were ZERO flags passed to it (-Xint, -server, -client, ANYTHING), and JVM startup time is brutal. You'll notice the Java is heavily optimized. FYI -- YARV is faster than PHP. As an aside, Javascript is also dog slow, but I'd wager you use that.

      I'm not the one coming off as an idiot here, CAPSLOCK ARE CRUISE CONTROL FOR COOL.

      --
      "The more corrupt a society, the more numerous are its laws." -Tacticus
    12. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      Yeah and your vehement defense of RUBY in the face of clear denial defines you as a RUBY fanatic. Amazing how your own logic works on you as well. if thats what you call it.

      --
      This is my sig. There are many like it but this one is mine.
    13. Re:Servers are cheap and getting cheaper by evol262 · · Score: 1

      in the face of clear denial

      That phrase doesn't mean what you think it means.

      You can call me whatever you want. Knowing the whole story rather than just blaming the language helps. FYI, they'd have had the same problem no matter what language they used.

      This will be the last reply to your inane trolling and idiocy.

      --
      "The more corrupt a society, the more numerous are its laws." -Tacticus
    14. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      The phrase has meaning that you fail to perceive because you are not taking it in the correct context. But your logic has never been your strong suit or else you might have become a developer instead of a sys admin.

      Shouldn't you be setting up a cronjob somewhere?

      --
      This is my sig. There are many like it but this one is mine.
    15. Re:Servers are cheap and getting cheaper by GWBasic · · Score: 1

      Funny, isn't this what Twitter thought too before dumping RUBY entirely?

      Ruby on Rails seems to be intended for rapid prototyping; and web applications that don't need to scale. Twitter is a poor use of Ruby on Rails, because it needs to handle many concurrent users.

      In my career, I've worked on plenty of applications that only need to handle a few concurrent users. The data processing is so valuable that the UI only needs to be good enough to enable a few users to process terrabytes of data that come from heavy machinery. In these situations, Ruby on Rails is much more appropriate then finely-tuned ASP, C#, Java, C++, ect, ect, because the web server will never break a sweat.

      On the other hand, if I had to write a web application that needed to scale to millions of users; I would never use RoR, except for a quick proof-of-concept prototype.

    16. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      I had a lowend shared server running PHPulse, the fastest framework for PHP (whose benchmarks also beat Ruby on Rails by a factor of 5-8). Anyway, I used to get 3 million hits a month on that shared server and it never broke a sweat and the pages loaded instantly. I didn't need extra servers, I didn't need a dedicated server and we didn't need extra memory. The company that maintained the server did bitch that I got alot of traffic and tried to get me to move to another server because of the bandwidth but I was still within my bandwidth limit so I wasn't gonna move.

      My point being, PHP, Perl and Python grow with your site and your company. You don't want to have to recode everything because the language cant keep up. While you have worked for alot of mom and pops, I have worked for alot of companies that have grown and need to have their architecture grow with them without hitting a brick wall. Thats the inherent problem with RUBY and the one they HAVE to solve before they achieve mass adoption within mid-to-enterprise. Otherwise it is just for mom-n-pop shops.

      --
      This is my sig. There are many like it but this one is mine.
    17. Re:Servers are cheap and getting cheaper by GWBasic · · Score: 1

      I have worked for alot of companies that have grown and need to have their architecture grow with them without hitting a brick wall. Thats the inherent problem with RUBY and the one they HAVE to solve before they achieve mass adoption within mid-to-enterprise. Otherwise it is just for mom-n-pop shops.

      It's all about knowing your requirements and who's using your application.

      In my case; I was working for the opposite of a mom-n-pop shop. I did one project for a major pharmaceutical company; and another for a major semiconductor company. In both projects; massive amounts of data were generated by heavy machinery; and processed in a batch manner using the most appropriate language.

      The data was interpreted by a small amount of specialized people. We only needed to target about 5-20 users; although the way the applications were written, they could grow to be about 100 users. In these cases; if we were to make a web-based applications, we really wouldn't need to care about the same kind of scalability issues that public-facing web sites reach. We wouldn't need to worry about millions of users; instead, we would just need an environment that could handle queries that can return a couple thousand rows. This, as far as I know, is well within Ruby on Rails abilities.

      Our biggest concerns were choosing an appropriate database; using development methodology that resulted in accurate code; and cost / time of development. Scaling to millions of concurrent users just wasn't going to happen!

    18. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      Yes. Exactly. Small mom-n-pop. And thats what Ruby is good at. I on the other hand am a real developer and have to plan for uncontrolled spikes in traffic and growth over time. We can build an app small to begin and add more and more functionality but we have to plan for how that app will scale with the architecture. Otherwise we are just building a throwaway app and the companies investment in that app is money lost since they (like Twitter) will just end up recoding in some other language.

      Ruby shows promise and is a good language but by obfuscating so much, it does alot more backend processing that the developer could be deciding how to do. This of course may take SLIGHTLY more development time but you get more speed and scalability. Effectively, for every 1 minute of development time you save, you lose 1 second on every page load which is why you keep having to throw more servers at Ruby (and more sys admins at those servers), etc etc.

      It's a scalability nightmare. So yes, Ruby is wonderful for mom-n-pops but I'd never use it for anything that I wanted to grow.

      --
      This is my sig. There are many like it but this one is mine.
    19. Re:Servers are cheap and getting cheaper by GWBasic · · Score: 1

      Yes. Exactly. Small mom-n-pop

      No, I'm referring to 2-5 million dollar projects that deal with industrial automation:

      • Large companies have applications that process large volumes of data but only have a small amount of users.
      • For these applications, all state is in the DB. Different parts of the application are written in different languages.
      • There are only a small amount of "users." These are highly specialized technicians.
      • Ruby on Rails can be considered because the UI part of the application essentially gets an insignificant amount of use.

      Again, it all comes down to understanding your users, knowing your requirements, and picking the best technology for the job. This is something that all real software developers know.

      Otherwise we are just building a throwaway app and the companies investment in that app is money lost since they (like Twitter) will just end up recoding in some other language.

      One way to start a business is to hack together a prototype and keep hacking at it while you try to get investments. It's a method that I don't like, but it seemed to work for Twitter!

    20. Re:Servers are cheap and getting cheaper by Foofoobar · · Score: 1

      Ruby wasn't dumped by Twitter (and a ton of other developers and companies) because 'the UI part of the application essentially gets an insignificant amount of use'. It was dumped because they were using Ruby for a significant amount of BACKEND use. Have you not seen benchmark after benchmark after benchmark of comparison? It actually CAPS OUT!!! It has a plateau! While other spike and go up and down and scale with demand, Ruby plateau's and cannot accomplish more unless (as every Ruby develop explains) you throw more hardware at it. And again, it requires 2-3 times the number of machines (and with that extra sys admins and maintenance) to do in Ruby what you can do in any other language.

      And for the record, my brother is a military contractor in Virginia and has offered me many a job with Pentagon contractors; I can build million dollar apps in Perl/Python/PHP too. The dollar amount means nothing. We are talking about the ability to scale with growth and demand and Ruby has never been able to do that.

      That is the one thing you have been avoiding this entire time. Sure you can build small apps for the backend that don't get much usage. Small websites for mom-n-pops that don't get much traffic. You can build apps that hardly anyone uses in Ruby. That's neat. It's a fun toy. I build apps that millions of people use. And for that I need a real language that can scale with the business and application demands.

      --
      This is my sig. There are many like it but this one is mine.
    21. Re:Servers are cheap and getting cheaper by GWBasic · · Score: 1

      Ruby wasn't dumped by Twitter (and a ton of other developers and companies) because 'the UI part of the application essentially gets an insignificant amount of use'. It was dumped because they were using Ruby for a significant amount of BACKEND use. Have you not seen benchmark after benchmark after benchmark of comparison? It actually CAPS OUT!!! It has a plateau! While other spike and go up and down and scale with demand, Ruby plateau's and cannot accomplish more unless (as every Ruby develop explains) you throw more hardware at it. And again, it requires 2-3 times the number of machines (and with that extra sys admins and maintenance) to do in Ruby what you can do in any other language.

      That's because they're using the Active Records design pattern. It's well-known that that design pattern doesn't scale. Have read the book on Ruby on Rails? The Active Records design pattern will choke if you have to handle a large volume of data because it sucks a lot of data in the database into Ruby objects before they can be manipulated.

      Active Records is fine for rapid prototyping, and for handling cases where a small amount of data maps to a complicated data structure. Backend stuff, where large volumes of data need to be manipulated, doesn't work well with this kind of design pattern.

      For example, I once worked in a C# project that used the Active Records design pattern that makes Ruby on Rails slow. I wrote a function that had to update a bunch of rows in a table; and when I tested it with the maximum number of rows that the requirements called for, it took about 20 minutes to run. I then bypassed the Active Records portion and wrote my own SQL Update statements, and the code ran in about a minute. (I had a 20x performance improvement because I knew the requirements and chose the correct design pattern.)

      This is why I say it's all about knowing your requirements. Processing large volumes of data using Active Records in ANY language or framework, including Ruby on Rails, will be so slow that it's uneconomical to throw hardware at it.

  36. Re:C best language out there by mdmkolbe · · Score: 3, Interesting

    Ha ha. Good joke. You've forgotten the most important feature "needed in a great programming lang": higher-order and first-class functions with proper closures. Oh wait, C doesn't have that.

    Any truly great statically typed language will also have at least algebraic data types, parametric polymorphism (even C++ only has ad-hoc polymorphism), type constructors and functions, maybe even a Turing complete type system (heh). C doesn't have any of those.

    Even aside from types, great languages should include tail-call optimization, pattern matching and hygienic macros (CPP macros are a bad joke).

    Now don't get me wrong. C is a great portable assembly language. It's close to the metal, widely known and easy to read. But as far as programming languages go, C feature poor.

  37. gnat by Anonymous Coward · · Score: 0

    that's where

  38. Re:ccomparison of C and CAS by Helios1182 · · Score: 1

    Of course the "right" tool is always context-dependent. If I were a grad student already familiar with that CAS system and needed to process a dozen images for a project I know which language I would chose: the CAS. If it takes me 5 minutes to write it in CAS and half an hour to process the images I'm out 35 minutes of my time. Say it only took me 30 minutes to write the C code and seconds to do the processing. I would still go with the CAS because I can go grab a coffee while the processing happens and I don't have to fight with C.

    If I had thousands of images to work with I would take the time to learn a faster executing language.

    Also imagine that maybe I don't _have_ to make this program, but I have an idea that I think could give interesting results. I'm much more likely to go ahead and write the code if it is fast and easy to do so. Maybe the implementation isn't the fastest, but I can see if it does something interesting. I could always go back and implement it in C if I found it really useful. I may just brush off the idea all together if it meant a long, painful coding process.

  39. Lua? by Anonymous Coward · · Score: 0

    I have to say I was really surprised by Lua, and especially LuaJIT.

    It has me wondering why it's not used more often. It seems like a really simple, clean language, with a fast implementation.

    Why isn't it used as often as say, Python, Perl, or Ruby?

    I know it's been used in game scripting, but why not elsewhere?

    I know very little about Lua--I hadn't paid much attention to it now, but are there people who have considered using it over another traditional scripting language? Why did they adopt it or not adopt it? Lua seems very nice.

    1. Re:Lua? by maxume · · Score: 1

      The 'ecosystem' isn't as rich. Python, Perl and Ruby come with quite a lot of libraries and there are dozens/hundreds of third party extensions.

      --
      Nerd rage is the funniest rage.
    2. Re:Lua? by Cthefuture · · Score: 1

      Partly but that doesn't explain it all. It's very easy to bind to other libraries in Lua. It's almost fun actually, which causes some problems because there are often multiple bindings available for the same library, but I digress.

      I think the real issue is that Lua is relatively "new." Now I know Lua has been around a long time but it really wasn't until it hit version 4 or 5 that it started to shine and version 5 has only been around for 6 years.

      Lua is an absolutely wonderful environment to work in. It's tiny, simple, fast (for a scripting language) and powerful all rolled up into one. Like I said, extending the language and binding to binaries so simple that it's almost fun and it's so easy to embed in other applications.

      Lua is what Javascript should have been.

      --
      The ratio of people to cake is too big
    3. Re:Lua? by grumbel · · Score: 1

      Why isn't it used as often as say, Python, Perl, or Ruby?

      You don't chose a language for their syntax, but for most part for their libraries and thus are lacking in Lua. Lua happens to be mostly intended as an language for embedding, not as a stand alone language.

  40. Re:C best language out there by Anonymous Coward · · Score: 0

    Zing!

  41. Modded troll? Really? by rbarreira · · Score: 0, Redundant

    What's there trollish in that post? It's just a shortcut to say some evidence is needed for that extraordinary claim, especially considering APL is usually an interpreted language.

    --

    The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    1. Re:Modded troll? Really? by fractoid · · Score: 1

      This whole topic is a troll. Not that the actual topic doesn't deserve discussion, and a way of quantitatively rating different programming languages to enable concrete comparisons is definitely useful, but posting it here is like going to a religious forum and posting a cost benefit analysis based review of the major religions. :P

      --
      Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
  42. Re:C best language out there by Murdoch5 · · Score: 0

    Then you just have to build in the features you need, I've personally made some major libs for C, I made a polymorphic array with poly data type support and special list methods etc..., C is very flexible language.

    The problem with all the high level one is that you get everything given to you and you don't nessary understand it. For instance, polymorphism, how many programmers actually understand it.

    Actually the thing I'm most interested in doing is making my own language, I know it would be primitive and hard but I would think it would be enjoyable.

  43. True but not very useful by rbarreira · · Score: 2, Insightful

    What does have to do with performance is the talent of the compiler / interpreter author, nothing more, nothing less.

    I think your statement is strictly speaking true but not useful in practice.

    Here's what I mean: strictly speaking, with unlimited intelligence on the compiler's part, the compiler can understand what a program does and rewrite it completely as it wishes to conform to the same behavior. This means any turing-complete language can have the same performance, with a sufficiently intelligent compiler

    In practice and in current times, however, a language's features determine how well the state-of-the-art in compilers can optimize a program. To give a very simple example... You don't see compilers inserting statements to free memory in Java programs, even though that would sometimes make them faster than running them with a garbage collector as happens in practice.

    --

    The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    1. Re:True but not very useful by FlyingGuy · · Score: 1

      Your are correct, but your correctness is supported by a poor argument and here is why:

      Here's what I mean: strictly speaking, with unlimited intelligence on the compiler's part, the compiler can understand what a program does and rewrite it completely as it wishes to conform to the same behavior. This means any turing-complete language can have the same performance, with a sufficiently intelligent compiler.

      All statements in any language must resolve to a set of correct machine instructions either by way of a compiler or an interpreter for the given platform. One can test a set of machine instructions to determine if it is the efficient way to accomplish a given task, be it a simple add or to index memory to obtain the details of a set of objects or a set of chars in the representation of string. It can be done, it has been done, and should be done every time there is a substantive change to the grammar of a language.

      In practice and in current times, however, a language's features determine how well the state-of-the-art in compilers can optimize a program. To give a very simple example... You don't see compilers inserting statements to free memory in Java programs, even though that would sometimes make them faster than running them with a garbage collector as happens in practice.

      Is it then the job of the compiler to write correct code or is it the job of the programmer? This is an interesting question, which is complex and arguable until the proverbial cows come home.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    2. Re:True but not very useful by rbarreira · · Score: 1

      All statements in any language must resolve to a set of correct machine instructions either by way of a compiler or an interpreter for the given platform. One can test a set of machine instructions to determine if it is the efficient way to accomplish a given task, be it a simple add or to index memory to obtain the details of a set of objects or a set of chars in the representation of string. It can be done, it has been done, and should be done every time there is a substantive change to the grammar of a language.

      Yes but what does that have to do with performance?

      In case it wasn't clear, my point was that a hypothetical intelligent (human-level or higher) compiler can extract the purpose/behavior of a program from its source code, and generate optimal (or very close to optimal) machine code for the task. I don't see how your reply relates to this point.

      Is it then the job of the compiler to write correct code or is it the job of the programmer? This is an interesting question, which is complex and arguable until the proverbial cows come home.

      It's the job of both of course. The programmer should write correct source code and the compiler should correctly convert it to another language (e.g. machine code).

      But again, I don't see what your reply has to do with the matter at hand (performance differences between languages in practice).

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    3. Re:True but not very useful by hendrikboom · · Score: 1

      In case it wasn't clear, my point was that a hypothetical intelligent (human-level or higher) compiler can extract the purpose/behavior of a program from its source code, and generate optimal (or very close to optimal) machine code for the task.

      Close to optimal, maybe. Optimal, no. That problem is unsolvable in general.

  44. Re:I think it depends more on what you want to ach by gparent · · Score: 1

    You realise C++ does exactly what you describe, with the exact same keywords as C, right?

  45. Re:I think it depends more on what you want to ach by gparent · · Score: 2, Informative

    It's *not* several layers of objects.

    System is the package containing the 'out' object, which is of type "PrintStream". println() is simply the method that outputs a line of text to the standard output, followed by a newline character for the current system.

    Now, compare this to C++: std:: is the namespace, which is the same as "System". However in C++, this code: "using std::cout;" will allow you to omit the name space when you use the object. "cout" is an object of type ostream, like "out" in Java. And then, "operator
    So in both languages, we're dealing with 3 different things: a namespace, an object, and a function call. Some people think C is better because you can just write printf(), but I disagree because I cringe whenever I need to type silly things with libraries such as BASS_DoThis(), BASS_DoThat(), etc. Namespaces are *way* better.

  46. Re:I think it depends more on what you want to ach by WankersRevenge · · Score: 1

    Just to nitpick ... I can output to the console with one character if I choose.  It's quite easy.

    import static com.jezner.libraries.io.Console.p;

    public class Test {
        public static void main(String[] args) {
            p("I am writing to the console");
        }
    }

    All the p method does is encapsulate the "System.out.println()" method.  Using a static import, you don't need to reference any objects.  But you knew that, didn't you?

  47. Re:C best language out there by Anonymous Coward · · Score: 0

    The wikipedia article that you referenced for parametric polymorphism contradicts your claim that C++ only has ad-hoc polymorphism. The higher-order article also points out that C supports one type of higher-order function, a function that takes another function as an argument. First-class functions cannot be implemented without reflection or some ability to compile code at runtime (JavaScript's eval for example); not having them in a natively compiled language like C makes sense.
     
    Calling C feature poor is the same as calling "the metal" feature poor.

  48. Anti-functional FUD by ygslash · · Score: 0, Troll

    Functional languages in practice often implement nlog n algorithms in quadratic time or memory.

    * False *

    We really understand how to optimize imperative languages well, we don't have the same level of knowledge / experience regarding functional.

    * False *

    Did parent poster read tfa?

    Does introducing functional features kill performance? No, it does not...

    In fact, the great success of functional languages in the shootout supports the intuition of just about everyone who has learned to program well in both imperative languages and functional languages - that the expressiveness of the functional paradigm makes it easier, not harder, to optimize speed, if that's what you need.

    People whose brains have rusted in place from too many years of strictly imperative programming will say anything to protect themselves against admitting the need to learn something new.

    1. Re:Anti-functional FUD by Lunzo · · Score: 1

      How is the parent post a troll? What he said about functional languages is true. It could have been expressed a bit more politely but hey this is /. and we're all anti-social nerds.

    2. Re:Anti-functional FUD by jbolden · · Score: 1

      If this were the case then Perl 6 would have stuck with the Pugs implementation. GHC would have stuck with Darcs and not gone to GIT. I love functional languages but putting your head in the sand regarding where the problems are and considering the evaluations FUD is not going to advance the cause.

      So if you want to continue this conversation start reading the various performance related discussions. There are 2 decades of papers on trying to resolve specific examples of this problem. Wadler's site is a good place to start.

    3. Re:Anti-functional FUD by ygslash · · Score: 2, Interesting

      If this were the case then Perl 6 would have stuck with the Pugs implementation.

      That's silly. Pugs was not designed as a production implementation of Perl 6 - it was a proof of concept for the new syntax. The fact that Pugs was so surprisingly easy to implement, and so surprisingly performant before any effort at all was put into its performance, was a stunning demonstration of the power of functional programming.

      GHC would have stuck with Darcs and not gone to GIT.

      GHC did stick with Darcs. There was a time when a move to Git was considered, but it had nothing to do with Darcs being written in a functional language. At the time, the Darcs team was not big enough or well enough organized to keep up with the heavy support demands of being the RCS for a large and growing compiler project. That has changed. Darcs has become one of the best run (and most fun) open source projects, with a large team of active and talented developers. Darcs is now an excellent choice of RCS even for very large projects.

      That is typical of the process that has been happening with functional programming during the past few years - a quick transition from the theoretical to the best-of-breed in practice.

      So if you want to continue this conversation start reading the various performance related discussions. There are 2 decades of papers on trying to resolve specific examples of this problem.

      If you're interested in history, you are the one who ought to have a good look at that literature. Learn to tell the difference between knotty problems that were identified twenty years ago, and the astonishing continuous progress that has been made since then.

      But if you want to continue this conversation, you should look at what is happening in the present. One thing that has happened is that you no longer need to read academic papers to learn and use functional languages in practice. There are books, online tutorials and resources, many developer-friendly tools, and a huge and super-friendly community.

      The shootout is a nice demonstration that speed optimization is another aspect of the increasing strength of modern functional compilers and functional programming techniques. No one will claim that a functional language can beat C at speed right now, but it says a lot that such high level languages can now compete well in the same league as C. As hardware architectures continue to move farther and farther away from the classical imperative model, watch for this trend to continue.

      I love functional languages but putting your head in the sand regarding where the problems are and considering the evaluations FUD is not going to advance the cause.

      I called the great-grandparent post FUD because it is FUD. These are common misconceptions, caused by lingering impressions of where functional programming was decades ago. Open your eyes, look at the facts, see what is happening now. Don't let the FUD lull you into apathy.

  49. island paradise by epine · · Score: 5, Insightful

    When the first 4K TRS-80 showed up at my high school, I had the option to learn BASIC, Z80 machine code, or APL up the street at the local university.

    One of my early exercises with BASIC was writing a set of nested for loops which called a subroutine (gosub). I put the next statement that controlled the for loop iteration inside the subroutine, and the return statement for the subroutine inside the nested for loops. It still worked! At that point I understood that there were mechanistic languages and languages with a solid conceptual basis.

    APL's reputation for inscrutability was only halfway deserved. Often the problems arose when you were trying to shoe-horn a data structure that didn't want to be an array into an array, because that was your only hammer. Later APL supported nested arrays, which increased the data structuring options, but I think by then the PR battle was lost.

    In the original APL, it was kind of painful to pass more than two arguments to an APL function. This lead to programmers passing in flags to the function encoded in the array's rank, which were extracted to the tune of rho rho rho, while imaging the knapsack folding problem in Colossal Cave Adventure. As brutal as any language I've used. But you have to give APL a bit of a pass in some respects. Like vi, it was designed in 1963 to work well within the constraints of a paper teletype.

    The next level of inscrutability arose because the APL primitives could often be combined in novel ways to yield surprisingly powerful algorithms. IIRC, the IBM 370 APL included a JIT compiler for certain common APL idioms. A one line program I wrote in APL to find primes (sieve of Eratosthenes) ran ten times faster than the compiled PASCAL program by the CS student sitting next to me.

    Understanding APL was a lot easier if you were familiar with functional programming languages, but these hadn't been invented yet. Hey, I didn't know this: the Wikipedia page credits APL as a direct influence on FP, which I first heard of in 1982. Father knows best.

    So you encounter this unfamiliar pattern of 15 familiar symbols for the first time, and you brain is polluted with horrible iterative solutions from BASIC or PASCAL, and the beauty of the expression is denied to your limited frame of consciousness.

    Like solving a Suduko? Hardly. It takes me twenty minutes to solve a typical five star Sudoku. It used to take me about the same amount of time to puzzle out an unfamiliar APL one liner, which might be anywhere from 10 to 40 characters. There is one small difference: after decoding the APL algorithm, I usually slapped myself across the head and moaned to myself, "I am unworthy to drool on the shoe laces of the grand designer, but I will learn!" Never got that feeling from Sudoku.

    Wrestling with the higher art of APL was like giving your ignorance a root canal. Sometimes the root canal made me barf up my milk: when the highest art of APL was applied to shoe horn a data structure unsuitable to array representation into an array representation anyway, like the Beethoven scene in Clockwork Orange.

    The third case is where the one liner isn't all that difficult, but it's doing it in more dimensions than the brain wishes to visualize. This is a case where a picture is worth a thousand words. Your 20 character APL function would have been better presented as a caption on a one page UML diagram. Never figured out how to embed a UML diagram in an APL lamp statement on my VT100 terminal.

    Another problem APL suffered was too much kinship with Forth. To thrive in APL, you needed to create hundreds of tiny APL functions, which the implementations of the day mashed together into a single unmaintainable workspace.

    And the system interface tended to suck.

    But other than that, what's not to like?

    I could have composed instead a tedious, but germane post on Shannon's first law: concision is a function of preconception. It's a rare breed of programmer who thrives in a language which provides su

    1. Re:island paradise by Anonymous Coward · · Score: 0

      How curious that you would write a long, rambling post about APL. It seems the language's terseness hadn't stuck with you.

    2. Re:island paradise by Anonymous Coward · · Score: 3, Insightful

      Lisp, arguably the grandfather of a lot of programming languages, was specified around 1958. While the first efficient implementations were a long time coming from that, I don't think you can claim APL was a forerunner to FP languages.

      Nice post otherwise :-)

    3. Re:island paradise by Anonymous Coward · · Score: 0

      Sometimes the root canal made me barf up my milk

      kids this is why you dont have breakfast before surgery

    4. Re:island paradise by michael_cain · · Score: 1
      But you have to give APL a bit of a pass in some respects. Like vi, it was designed in 1963 to work well within the constraints of a paper teletype.

      The symbolic debugging capabilities built into IBM's APL system by the early 1970s spoiled me: breakpoints, stack traces, interactive examination of data structures on errors, etc. I recall getting permission from the professor to use APL instead of Fortran for third-semester numerical analysis. He considered it a failed experiment because I was treating assignments that were supposed to be two-week nightmares to code as weekend projects.

      OTOH, you needed all of that because APL's name-scoping rules created situations where the simple bug of failing to make a variable name local to a function could result in all kinds of erratic behavior that was very difficult to track down.

    5. Re:island paradise by oldhack · · Score: 1

      "I could have composed instead a tedious, but germane post on Shannon's first law: concision is a function of preconception. It's a rare breed of programmer who thrives in a language which provides succinct expression of thoughts unlike the ones you already have."

      Good bit.

      --
      Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
    6. Re:island paradise by Anonymous Coward · · Score: 0

      Very enjoyable post. I will pick one minor nit:

      But you have to give APL a bit of a pass in some respects. Like vi, it was designed in 1963 to work well within the constraints of a paper teletype.

      It was really more ed, not vi, that was designed for a paper teletype. vi was designed for dumb terminals, but it could work on the very dumbest of the dumb terminals. vi didn't require anything beyond ASCII: it can get by without function keys, page up/page down, or even arrow keys. I actually used vi on ADM3A terminals, which lack all of the above. IIRC, the ADM3A didn't even have an escape key, and I had to hit Ctrl+[ to get an escape.

    7. Re:island paradise by Anonymous Coward · · Score: 0

      And that is why verbosity is bad.

    8. Re:island paradise by Kazoo+the+Clown · · Score: 2, Interesting

      Nice post. It is true that APL sends you to places you never go with any other language. And it is also true that this isn't necessarily a good thing.

      My first language was APL on an IBM System/360 in about 1973. I recall one of the lab assistants had a workspace of text functions he'd created that some of us were looking at. One in particular, was designed to take a text string and reduce occurances of multiple spaces down to single spaces. The program was a one-liner, of about 120 characters. Several of us looking at it could see that it could be simplified from this 120 character monstrosity, and of course that it *should* be, so we set ourselves to the task. We divided up into a few groups, and an buddy and I worked on it for awhile and got it down to 14 characters. We concluded that was as good as it could get and were firmly convinced we would win the informal contest we were having. But then one of the other students showed us his result which was almost identical to ours but had it at 13 characters because he had noticed a logical not that could be combined with an operator in order to eliminate it. We were crushed because we worked so hard on it and were sure we had it aced...

      But that was pretty typical with APL, you could spend a huge amount of time juggling array elements to be just so, in order to evaluate all the answers in parallel, when in any other language you would have just written a for loop with a few statements and been done with it. Not as challenging as APL, but as I said, that could very well be a Good Thing(TM)...

      Plus, the varying quality of APL programmers meant that you may be looking at a 120 character monstrosity of obscure and unneccessary logic that could have been done more concisely in 13 characters...

  50. Re:C best language out there by oldhack · · Score: 1

    "It would be better if it was extended to support classes."

    That's what Satan whispered into Strostuf(sp?)'s ear and see where that led us - 2 decades of hell and still counting...

    --
    Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
  51. Re:C best language out there by Anonymous Coward · · Score: 0

    So would C++

    *ducks*

  52. A language does not have performance by brunes69 · · Score: 3, Insightful

    Performance is created by the compiler, not the language. A C program compiled with a shitty compiler is going to run slower than a Ruby one in a good VM, even though C is running native on the CPU. For that matter, what if I take the C code and compile it with the CLR as a VM target?

    I wish people would stop trying to compare languages by performance, it does not make any sense. The only language it makes any sense for at all is assembler.

    1. Re:A language does not have performance by Anonymous Coward · · Score: 0

      Performance is created by the compiler, not the language.

      Yeah, that's why I like to program in English.

    2. Re:A language does not have performance by dcam · · Score: 1

      That is incorrect. A language may enforce limitations on the compiler that may block it from further optimisation.

      --
      meh
    3. Re:A language does not have performance by bar-agent · · Score: 1

      A language may enforce limitations on the compiler that may block it from further optimisation.

      C is a good example of this, sort of. The problem is that C is missing some limitations that would allow better optimization. My God — they've made a thousand C compilers over the decades. Can you imagine how optimized-to-hell-and-gone it would be, if it could be?

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
  53. Re:I think it depends more on what you want to ach by Anonymous Coward · · Score: 0

    Dork

  54. Re:I think it depends more on what you want to ach by sneilan · · Score: 1

    Yeah! Get off my lawn!

    --
    "I like it when the red water comes out.."
  55. Writing APL by DrYak · · Score: 2, Funny

    If you would like APL to be on the list, then submit benchmarks for APL to the Shootout (the blog got its data fro there).

    ~I'm sure he would definitely like to. But he broke the necessary keyboard~

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
    1. Re:Writing APL by JakartaDean · · Score: 1

      ~I'm sure he would definitely like to. But he broke the necessary keyboard~

      That brings back a distinctly unhappy memory from my engineering school thesis in 1985-86. I was graduating in mechanical engineering, I was never a programmer, and as part of my thesis I wanted to analyze data from Canadian passenger car accidents. No problem, I had the data because I had spend a summer working as a member of the university's "Multi-disciplinary Accident Research Team" funded by the federal government. All of the accident data 10 teams across Canada collected was entered into some magic program, but there was no program provided to extract said data. It turned out that Transport Canada had contracted the programming out to one of their favoured consultants, who didn't see the use in a conventional database (dBase II would have been contemporary), but programmed the whole thing, including the database, in APL.

      We were using an IBM-PC, chock full of expansion cards overflowing into an expansion chassis. It was truly a thing of wonder, and probably cost $25,000 to put together. BUT, it didn't have the special chip it would have needed to show APL characters on the screen. That would have disabled regular characters or something, I recall, and wasn't an option.

      So, I, a non-programmer had to learn APL from some manual or book, on a computer without the APL character chip, in order to access an undocumented database, as an ancillary part of my project (although this work was included in the plan, it wasn't critical to the results). What a nightmare. Just thinking about it has convinced me to open a beer.

      --
      The subject who is truly loyal to the Chief Magistrate will neither advise nor submit to arbitrary measures (Junius)
  56. These benchmarks suck by coppro · · Score: 2, Insightful
    Okay, there's many problems with the benchmarks here, including in the labeling.
    • The uses of each language aren't analyzed. I've never encountered a desktop application written in Perl, nor have I ever seen a C++ web framework (I'm sure both exist, but they aren't common)
    • Dependability isn't analyzed. The title specifically says 'dependability'. I can excuse them because well-written Erlang smokes the competition in terms of reliability (Some Erlang-based servers have been running with 100% uptime for years).
    • This is not a comparison of multiple programming languages. It's a comparison of a haphazard set of environments. For instance, C and C++ are not distinguished, but the various compilers are. On the other hand, C# and F# are grouped the same, even though they operate in the same VM, with the same JIT optimizer, and so on (and Mono, on the other hand, is nowhere to be found.

    I'm sure there are others, but I have work to do.

    1. Re:These benchmarks suck by adamkennedy · · Score: 2, Interesting

      FYI, the new Padre Perl IDE is itself written in Perl.

      http://padre.perlide.org/wiki/Screenshots

  57. Seems odd about Smalltalk by WeirdJohn · · Score: 1

    It seems odd to me that the Smalltalk implementations are all so far to the right and so far up, especially the latter. Smalltalk is usually considered to have a very high amount of bang per LOC, at least 15 times more than C++. If they are considering superclasses in the code size count are they considering libc for gcc, or the entire dotNet libraries for C#?

    I have to wonder how good the smalltalkers were that implemented the benchmarks. Until you get your head around it, smalltalk code is bloated. Then as you learn to think the right way your code shrinks to a beautifully expressive minimalism.

  58. Re:C best language out there by mdmkolbe · · Score: 1

    First-class functions most definately do not require reflection or run-time compileation. I know because I've implemented them in two different compilers I've written. If you don't believe me, look in any compiler book that covers the implementation of closures.

    C being a natively compiled language is no excuse for it not having first-class functions with proper closures. (Technically C already has first-class functions, but they carry no dynamic closures.)

    In all of these features you mention (e.g. polymorphism in C++, higher-order functions in C), their implementations are broken half implementations of the full ideas. Even if they are technically present, they don't fulfill the spirit of the ideas.

    And yes, "the metal" is feature poor when it comes to expressiveness. It's not a question of whether I can make the machine do what I want, but rather how hard I have to work to make the machine do what I want.

  59. Re:C best language out there by mdmkolbe · · Score: 1

    At least half the things I mentioned cannot be easily implemented as libs in C. E.g. I'm guessing your polymorphic array isn't statically type checked which is what is usually meant with parametric polymorphism.

    You could build them with layers on top of C (e.g. "cfront" the original C++ compiler), but you could say that about any Turing complete language. After all a compiler is just a front-end for machine code. The question isn't what features could be added, but rather what features it has.

    I actually agree without about the problems of getting everything given to you. Which is why everyone should implement their own compiler or even interpreter for a high level language early in their carrier. (Take a class or read a book on it though. If you try to invent it on your own, you won't get as much out of it because you would have learned how you would implement it and not how it is actually implemented by the experts.)

  60. Anonymous Coward by Anonymous Coward · · Score: 0

    C is the only programming language you need if you are a competent programmer. A good assembler is nice if the compiler isn't up to snuff.

  61. Re:C best language out there by Murdoch5 · · Score: 0

    I agree with you, that I wont get much hands on value out of building my own compiler / language but the amount of knowledge I can gain from taking ont he project would be execellent.

    Your also right in assuming the polymorphic array, I called the Marray, was not staticly typed. The array was a complex method of varable agrument lists and macros and etc... It took probley 50 + hours of work but I was able to finish it. and it was a very good project to future my understanding of C which went from good to excellent. I believe in understanding a language in and out and around before learning another.

    Personally I'd rather only know 5 extrememly well like the back of my hand then know 12 only moderitly well.

  62. Short answer by hey! · · Score: 1

    the kind that applies the detail you are looking or right now, but no others. Oh, yes, I really mean right now, whether or not you know what it is. That's ideal.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  63. Re:ccomparison of C and CAS by janwedekind · · Score: 1


    require 'hornetseye'
    include Hornetseye
    a = MultiArray.load_rgb24 'image1.jpg'
    b = MultiArray.load_rgb24 'image2.jpg'
    output = MEncoderOutput.new 'test.avi', 15
    for k in 0..50
        output.write a * ( k / 50.0 ) + b * ( ( 50.0 - k ) / 50.0 )
    end

    I happen to develop a Ruby library which can be applied to this problem. In this case it generates the 50 transitional frames (640x480) in less than 10 seconds. I tried GIF first, but generating GIF is indeed very slow, since it requires global colour-indexing. So this may be the real performance problem in your example. Even so you should use Ruby ;)

  64. These benchmarks are bogus by atripp · · Score: 3, Informative

    All of these numbers are based on what completely flawed microbenchmarks from a site that used to be called "The Language Shootout". The numbers have been thoroughly debunked several times in the past. See this thread, for example: http://www.javalobby.org/java/forums/t86371.html?start=30 Or just google for "language shootout". It's not that the people who run this are just incompetent (making dumb mistakes like including JVM startup times). It's that they actively allow and even encourage cheating. For example, at least one of the "C" benchmarks actually uses hand-coded assembly (libgmp), and rather than stick to the obvious "program must be written in the language it's listed under" rule, the site maintainer suggests that the "Java" benchmark could be changed to also use assembly. This is all documented in the thread listed above. After several of these debunkings over the years, they had to change the name from "the language shootout" to something else, as any quick google will show that these benchmarks are completely bogus. Nothing to see here, move along.

    1. Re:These benchmarks are bogus by Anonymous Coward · · Score: 0

      LOL, linking to a bunch of moron zealots nobody had heard of surely proves your point! (?!)

  65. Is it the language of programmable HPs? by colinrichardday · · Score: 1

    Is FORTH the language of programmable HPs?

    1. Re:Is it the language of programmable HPs? by rbrander · · Score: 1

      No, I can't recall any. FORTH is/was, however, the ROM-level pre-boot language you could set up a SUN workstation with.

      Postscript is in fact just a variant of FORTH; or properly, it IS just FORTH with a bunch of specialized vocabulary added. (With FORTH, the operating system, the language, and your application all blur into each other. The language is just a list of FORTH "words" - each a program - that should be already written for you when you get it. Then you add more and more FORTH words to its vocabulary until the top-level ones provide your application. But there's no special distinction between the standard words and the ones you've added. )

      A popular early-computer-graphics recursive program draws a tree, where each branch is another tree with (N-1) levels left. So a friend of mine wrote a Postscript/FORTH program about ten lines long. It takes about 1 second to "send to Print", then the poor Postscript interpreter in the laser has to chew on it for about an hour before this ten-levels-of-recursion tree comes out with about a million separate lines drawn.

      FORTH was also the native language / OS of a very innovative, now-forgotten computer called the "Canon Cat" (when Canon imagined it might make a play in 8-bit computers, ca. 1980) designed by Jef Raskin, famed Mac innovator. Raskin, who wrote books on human (and humane!) interface design, liked FORTH for the ultrasmall footprint (everybody does), and because it had tools to address the floppy disk directly. (I said it was an operating system). Canon Cat floppies did not have to be formatted, the Cat just always stored documents as a multiple of the disk sectors. (This made sense with 160K disks; you would rarely have more than 1-2 documents per disk).

      Much of the Cat's design was replicated as an add-on circuit card for the Apple II called the SwiftCard, if memory serves.

      And, as mentioned, FORTH was found as a native language for a lot of programmable instrumentation. Where I ran across it in 1983 was for the "Golden River Retriever" traffic counting devices. They'd count cars going over an induction loop you buried in the road with a sawcut.

      Come to think of it, it would be a surprise if HP did not use it in any of their many lines of lab instrumentation, especially back when the ability to fit a whole OS and language interpreter/compiler into about 16K was really handy.

  66. What do you mean? by ClosedSource · · Score: 1

    Improper use of pointers in C is the number 1 cause of programs that appear to work when they really don't.

    1. Re:What do you mean? by TheTurtlesMoves · · Score: 1

      Add security problems even when they do "work". aka Buffer overflows. To add to that they make flow analysis very difficult.

      --
      The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
  67. Re: C++ by durdur · · Score: 1

    C++ can indeed be used as a "better C". And some features such as inheritance are best left alone or used very sparingly. It's not a bad choice of language used carefully but it gives the programmer a lot of room to go wrong or over-complicate the solution. Also for a long time many compilers were buggy or failed standards compliance in one way or another - they're better now, but still not 100%.

  68. Re:C best language out there - what about for web? by Anonymous Coward · · Score: 0

    You are correct that browsers are the future, simply due to the easy of deployment and lack of needed installing.

    However, not all applications can be web-ified, and all browsers need programing and a OS to run on. C is a good choice for the necessarily low-level parts of a computer system. C++ may also be a choice, but I find its features unnecessary in the lowest levels of a OS, its more geared towards the higher levels such as GUI and application toolkits.

    In sort: like COBOL, C is not going anywhere and will still be actively used for the forseeable future, but also like COBOL, its role will be more specialized.

  69. Whole program compilers by Estanislao+Mart�nez · · Score: 2, Interesting

    The biggest surprise for me was the high performance of some of the implementations of functional programming languages, even in cases where the particular languages aren't generally known for being implementable in a very efficient way. Two of the best-performing languages are stalin (an implementation of scheme/lisp) and mlton (an implementation of ml).

    You should not draw too many conclusions about the results of those two without taking into account the fact that both are whole-program optimizing compilers. Those two systems just do not support separate compilation of individual source files; if you change one line of one file in your program, every file must be recompiled.

    This type of compiler has a performance advantage over the more common separate compilation systems, simply because it can inline anything anywhere, and thus optimize far more aggressively. But it's next to useless for developing large software systems, and thus mostly really useful only for writing smallish programs, in very high-level style, that perform some really expensive computations really fast.

    1. Re:Whole program compilers by bcrowell · · Score: 1

      This type of compiler has a performance advantage over the more common separate compilation systems, simply because it can inline anything anywhere, and thus optimize far more aggressively. But it's next to useless for developing large software systems, and thus mostly really useful only for writing smallish programs, in very high-level style, that perform some really expensive computations really fast.

      Interesting ...but what's to stop you from using it to write a smallish library, and then linking the library to other software?

    2. Re:Whole program compilers by Estanislao+Mart�nez · · Score: 1

      Interesting ...but what's to stop you from using it to write a smallish library, and then linking the library to other software?

      The fact that (a) the compiler doesn't output linkable object files at all, (b) the fact that to get the maximum performance boost, the compiler needs to optimize across the application/library boundary. The latter becomes particularly important in functional languages where you have library routines that accept functions as arguments--a whole program compiler is capable of inlining the code for a lambda into the library routine that it's passed to, and then optimizing the result aggressively.

  70. Java is fast by codepunk · · Score: 1

    Java is smoking fast as long as the machine running it has a TB of ram for each hello world app.

    --


    Got Code?
  71. Oops. by Anonymous Coward · · Score: 0

    It's funny that you made an error in the simplest one....

  72. Re:I think it depends more on what you want to ach by Anonymous Coward · · Score: 0

    Yep, that's why Lua kicks ass too. Simple, easy to learn/memorize yet very powerful.

  73. Paucity of GUI libraries, for one by duyn · · Score: 1
    Try finding a decent GUI library for Windows, for example. Your choices:
    • LablGTK. GTK on Windows. Yuck.
    • LablTk. Tk is a toy GUI kit.
    • OCaml-Win32. If you have to ask what's wrong with the win32 API, you've never had to use it in a language other than C.
    • Some alpha or out of date binding of wxWidgets or Qt for OCaml.

    OCaml programs aren't shorter than scripting languages, and they're limited to a curses interface at best. Together with its speed, OCaml gives off the impression of being a language you'd reach for when you write high performance, low interaction programs---like automated financial trading agents. Not many of us do that. And so not many of us use OCaml.

  74. Where is Objective-C by Edward+Scissorhands · · Score: 1

    I looked everywhere in that graph, but I did not see Objective-C. How come that was not included?

  75. Re:I think it depends more on what you want to ach by Anonymous Coward · · Score: 0

    ...If I want to write a program that does things fast, or accurately, or precisely, or for something else to build upon, C is perfect...

    I'm a fuddy-duddy. Old fashioned. If I write a program, the damn computer will damn well do instruction 1 followed by instruction 2 with the minimum of flying off into libraries and class systems. If I want 4 bytes of memory to change type, then I will damn well have them change type. And I'll even get to specify *what* 4 bytes of RAM if I want and I'll clean up after them if it's necessary. That's how I think, so things like C match perfectly when I want to code. The fact that C is damn powerful, fast, low-level and so common also add to it's appeal.

    Well, you're also obsolete. As I understand it, optimizing compilers for C are quite free to reorder your operations, so you better learn what is considered correct programming and not just depend on the computer doing precisely what you tell it to do.

  76. Mr. T's programming language by Tablizer · · Score: 1

    nuf sed

    1. Re:Mr. T's programming language by Tablizer · · Score: 1

      Or eubonic's code, allegedly a runnable language:

      http://www.public.iastate.edu/~crb002/prog.html

      Sample:

      sup
      {
          gimme x bitch
          slongas (x aintlike 1)
              if ((x videdby 2) time 2 sameas x)
                  x be x videdby 2 bitch
              ifitaint
                  x be x time 3 an 1 bitch
              fi
              putou x bitch
          nomo
      }

  77. Java by guliverk · · Score: 1

    Java is killer language :-P

    --
    JMule user : http://www.jmule.org
  78. GNAT by krischik · · Score: 1

    The benchmark list compiler names and not language names. And this quite right as compiler implementations are compared.

    Ada is therefore GNAT. And the other questions often asked: Fortran is g95.

    Martin

    PS: Of course the hole Blog is therefore wrong. It's title should relay be The speed, size and dependability of programming languages implementations.

  79. The Computer Language Benchmarks Game by krischik · · Score: 1

    Only languages implementations of the The Computer Language Benchmarks Game [1] are used. Read there rues and you know.

    Martin

    [1] http://shootout.alioth.debian.org/

  80. The Computer Language Benchmarks Game by krischik · · Score: 1

    Only languages implementations of the The Computer Language Benchmarks Game [1] are used. Read there rues and you know.

    Martin

    [1] http://shootout.alioth.debian.org/ [debian.org]

  81. Objective-C vs C++ by krischik · · Score: 1

    Well, we had two choices open. We can't blame Satan that choose the fast but difficult option.

  82. Re: GHC by ygslash · · Score: 1

    Then go on the ghc mailing list and educate the people who write the compiler for Haskell and let them know, they are are getting nailed by several of these problems.

    There are no such problems with the GHC compiler. As with any serious compiler, there are plenty of performance tuning issues. But those issues would be the same - or perhaps even more knotty - if GHC were written in, say, C.

    And I'm sure you realize that neither you nor I will soon be educating the gurus who work on GHC. :)

  83. Now let me guess what language you use... by foxylad · · Score: 1

    Seriously, I'm and old c/c++ hand, lately turned to Python for most work because I enjoy it. But the reality is that very few of us get much choice - we have to use whatever system the PHB got swayed by back in the day.

    So I wouldn't get too upset by this article, even if Java is your pride and joy - I doubt we'll see a stampede to Stalin. Java programmers will remain java programmers, just like those poor buggers who started out in Cobol are still hacking away in Cobol.

    --
    Do as you would be done to.
  84. Re:ccomparison of C and CAS by Anonymous Coward · · Score: 0

    Computer algebra systems are high level programming language. Writing good code does not need
    documentation. The code itself shows what is done.

    Yes, but why does it do what it does?

    Documentation doesn't say "what" the code does, it says "why" it does so. Why do you want to interpolate those two pictures? Why output them as a GIF and not as a MNG? What are the requirements of your application? What happens if the images are not in the good format? etc.

    I guess you need some doc after all...

  85. Re:C best language out there by MobyDisk · · Score: 1

    Can you explain how C++ does not support parametric polymorphism in its entirety? From the Wikipedia article you quoted:

    Today it exists in Standard ML, OCaml, Ada, Haskell, C++, Visual Prolog and others. Java, C#, Visual Basic .NET and Delphi (CodeGear) have each recently introduced "generics" for parametric polymorphism.

    Based on the descriptions of how parametric polymorphism works, C++ seems to support it 100%. Are you sure you aren't meaning C#, which has "generics" instead of "templates?"

  86. Re:I think it depends more on what you want to ach by MobyDisk · · Score: 1
    This seems like the usual anti-OOP rant from someone who has never written OOP. These show up on all Slashdot discussions about languages. OOP is not some crazy high-level abstraction that adds some performance penalty and prevents you from accessing the bare metal. It is a design construct, one that is best expressed with a few additional keywords, than can be implemented in most decently expressive languages. And just in case I get a reply that says "I do know OOP:"

    I read a one-page cheat sheet and never attended a single class and passed with flying colours.

    I can imagine how that experience would taint you against it. I took a few similarly lame classes at a good university.

    But with C++, I instantly lost interest because it's just too damn verbose to do a simple job.

    That is provably false. Since almost every C program is a valid C++ program, C++ is by definition, no more verbose than C.

    Java OOP is slightly better but still nasty once things get complicated and the underlying "functional" language is basically a C-a-like.

    Java is not a functional language.

    I worry about what will happen when people *only* code in OOP languages. The abstraction is so large that people forget that they are still telling a computer to handle bits and bytes and suddenly they get lazy.

    OOP has nothing to do with this. I can't think of an OOP language that does not allow you to handle bits and bytes.

    [Java was] a C-a-like with OO

    So is C++. Throughout your post you talk about how disorganized the class libraries are. If you ever code enterpreise-level software, or need to code something quickly, you will appreciate those libraries. Implementing everything yourself will result in bigger, slower code and longer development cycles.

    I recommend learning C# since it has a very organized class library, and using that to dig into what OOP really is. I've even done OOP in assembly language - it's a design paradigm, with zero overhead, a few keywords, and some damn powerfully expressive shortcuts.

    (Queue someone posting outdated information about virtuals to try and counter the "zero overhead" part)

  87. Re:ccomparison of C and CAS by Coryoth · · Score: 1

    Documentation doesn't say "what" the code does, it says "why" it does so.

    It's also woth noting that, at some point (usually around the function level in larger projects) it can be useful to say what the code is supposed to do. Being able to see what the code does is all well and good, but you can't tell whether something is a bug or not unless you know what the code is intended to do (so you can determine whether it is actually doing it correctly). For short functions, or small projects, it is often obvious what the code is supposed to be doing from context and function names (presuming we have good function names); as things scale larger, however, exactly what a particular complex function is exactly supposed to do becomes less clear, and a little documentation is a good idea.

  88. Re: Sieve of Eratosthenes by ygslash · · Score: 1

    Sieve of Eratosthenes is a good example because it has been solved but the discussion of the flaws in older solutions are quite subtle. http://www.haskell.org/pipermail/haskell-cafe/2007-February/022666.html

    The "flawed" version was written by David Turner over 30 years ago. At that time, his version was meant to illustrate the expressiveness of pure functional languages, not to achieve speed.

    The discussion you reference was as much about what algorithm is "the genuine sieve of Eratosthenes" as about speed. You can read all about it in O'Neil's paper that came out of that discussion, "The Genuine Sieve of Eratosthenes".

    But yes, there are subtle issues in the speed of sieve algorithms. And yes, this is a good example. Compare O'Neil's work to the imperative papers she references. You can see how much easier it is to achieve the same results in a functional setting than in an imperative one.

  89. Re:C best language out there by mdmkolbe · · Score: 1

    Can you explain how C++ does not support parametric polymorphism in its entirety?

    Sure! There are two main differences.

    The form of polymorphism defined by templates in C++ is based on expanding and compiling a separate copy of the template code for each and every type that the template gets instantiated with. This is different than Standard ML, OCaml and Haskell where only one copy of the code gets compiled.

    As an example, try to compile the following in C++:

    #include <utility.h>
    #include <iostream>
    using namespace std;
    template<typename a>
    a foo(int n, a x) {
        if (n == 0) return x;
        else return foo(n-1, make_pair(x, 17)).first;
    }
    int main(int argc, char** argv) {
        cout << foo(argc, argv[0]);
        return 0;
    }

    If I constructed that example right, you C++ compiler will either reject that program or go into an infinite loop trying to compile it. This is because depending on the value of argc, the foo template must be instantiated for string and pair<string,int> and pair<pair<string, int>, int>, etc.

    On the other hand the equivalent Haskell program poses no problem to the compiler:


    import System

    foo :: Int -> a -> a
    foo n x =
        if n == 0
            then x
            else fst (foo (n-1) (x, 17))

    main = do
        args <- getArgs
        print (foo (length args) (head args))

    The second difference is that in the implementations of parametric polymorphism seen in languages like Haskell, the parametric argument must be treated opaquely. In C++ the template argument types are known at compile time and the language allows your program to use that knowledge (e.g. template based type dispatch). This can be seen as either an advantage (yea! I can do more things) or a disadvantage (boo! the template/function type doesn't express all the assumptions about the type that the template/function makes). Regardless of whether it is an advantage or disadvantage, it is a natural consequence of whether or not the code gets expanded for each and every type.

    At the end of the day C++ template polymorphism is to parametric polymorphism as macros are to functions. Both templates and macros are based on expanding code(*) and thus may inspect their arguments at compile time. On the other hand parametric polymorphism and functions do not expand code and at compile time must treat their arguments as opaque.

    P.S. Some things said here may change with the introduction of "concepts" in C++0x.

    (*) Except templates keep a cache of recent expansions to ruse where macros usually do not.

  90. I know that quote... by autophile · · Score: 1

    If you drew the benchmark results on an XY chart you could name the four corners. The fast but verbose languages would cluster at the top left. Let's call them system languages...

    This is from Dead Poets' Society, isn't it?

    I sound my barbaric yacc.

    --
    Towards the Singularity.
  91. Re:C best language out there by Anonymous Coward · · Score: 0

    So is every program written in such a language going to include a JIT compiler? None of those features you describe are going to be available in any language that has performance comparable to C.

  92. Garbage collection by js_sebastian · · Score: 1

    The only real difference between Java and C execution model (aside from better defined semantics in Java) is that Java does the translation in software, at run-time, taking into account performance characteristics of both the running program and the underlying hardware.

    Java is a garbage-collected language. Garbage collection comes at a cost in performance AND memory. This cost may not be huge in most benchmarks, but there are some benchmarks where it is going to be. Which isn't to say the guys who came up with java were dumb... It so happens that you cannot be safe from pointer errors in a language where the programmer can free memory.

    Also java has all that cool introspection/reflection functionality... The rather weaker but similar run time type information in C++ is a compile time switch, because it causes a significant memory overhead in some cases (when there are many small objects).

    Some features have a price. You may want to pay that price (hell, I mostly program in python these days!), but don't delude yourself you're not paying any.

  93. Re:C best language out there by mdmkolbe · · Score: 1

    So is every program written in such a language going to include a JIT compiler?

    No! None of these features require a JIT. (e.g. Haskell/GHC compiled programs do not include a JIT.)

    Which of these features do you think requires a JIT? If you want, I can explain how it can be implemented without one. (Frankly implementing them with a JIT would be a silly way to do things.)

  94. Re:island paradise (thanks) by Anonymous Coward · · Score: 0

    Enjoyable post. Thanks.

  95. Re:C best language out there by Kazoo+the+Clown · · Score: 1

    Now don't get me wrong. C is a great portable assembly language. It's close to the metal, widely known and easy to read. But as far as programming languages go, C feature poor.

    I would agree with this-- and with all these now deprecated functions (replaced with "safe" ones) designed to eliminate programmer bad habits, it's become something of a nightmare...

  96. Re: Sieve of Eratosthenes by jbolden · · Score: 1

    This is meant to be an easy example and a solved one, how this happens very naturally. I know this is easy to fix, that's why it is easy to see. The "expressive", "natural" version being quadratic is the point. As for easier, agreed. I don't think functional languages are worse by any means, but we (meaning programmers) are less skilled at this point at avoiding these sorts of inefficiencies.

  97. Re:C best language out there by Anonymous Coward · · Score: 0

    Ha ha. Good joke. You've forgotten the most important feature "needed in a great programming lang": higher-order and first-class functions with proper closures. Oh wait, C doesn't have that.

    Any truly great statically typed language will also have at least algebraic data types, parametric polymorphism (even C++ only has ad-hoc polymorphism), type constructors and functions, maybe even a Turing complete type system (heh). C doesn't have any of those.

    Even aside from types, great languages should include tail-call optimization, pattern matching and hygienic macros (CPP macros are a bad joke).

    Now don't get me wrong. C is a great portable assembly language. It's close to the metal, widely known and easy to read. But as far as programming languages go, C feature poor.

    test