Slashdot Mirror


Is Perl Better Than a Randomly Generated Programming Language?

First time accepted submitter QuantumMist writes "Researchers from Southern Illinois University have published a paper comparing Perl to Quorum(PDF) (their own statistically informed programming language) and Randomo (a programming language whose syntax is partially randomly generated). From the paper: 'Perl users were unable to write programs more accurately than those using a language designed by chance.' Reactions have been enthusiastic, and the authors have responded."

11 of 538 comments (clear)

  1. Better? by Hognoxious · · Score: 5, Funny

    Better? How about we start with distinguishable?

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    1. Re:Better? by Chris+Burke · · Score: 5, Funny

      Indeed. This is the reason why the Obfuscated Perl Contest is run by the Department of Redundancy Department.

      --

      The enemies of Democracy are
    2. Re:Better? by Smallpond · · Score: 5, Informative

      Yet another ridiculous summary. The study wasn't which language was better, it was in which language can first-time users write a program more accurately. My guess is that Cobol would beat any of the three - it is designed from the ground up to be readable.

  2. Perl Is way better by PerlJedi · · Score: 5, Informative

    I'd have to say PERL is better than a lot of purposefully crafted languages. Its syntax is very forgiving, and there are lots of ways to do most things. Those two components are likely the reason this study came to that conclusion. This in no way means that PERL is not a good language. It does mean that many people can write PERL badly, but many people speak English badly and that doesn't reflect poorly on the language. PERL is, IMO, and should always be: Easy to do, but impossible to do "perfectly". But then I'm not sure that anything can truely be done "perfectly". Things may be done poorly, well, very well, or nearly perfectly, but to claim perfection is to deny the possibility of improvement.

    1. Re:Perl Is way better by gold23 · · Score: 5, Insightful

      I would suggest that perhaps Perl is particularly effective in separating good from bad programmers. In other languages, restrictions allow bad programmers to write code that *looks* good.

      But if you see readable, understandable Perl code, you know you've got a keeper.

      --
      Trust not a man who's rich in flax / His morals may be sadly lax
    2. Re:Perl Is way better by eriks · · Score: 5, Insightful

      This!

      Perl is a "beautiful" language -- in the same way some people talk about certain human languages (e.g. romance languages, Russian, or Sanskrit) being beautiful, as opposed to merely functional. Other people will disparage those same languages as being too this, or not enough that... the same kind of debate we see with programming languages, particularly with Perl, which is kind of interesting.

      And for some of those human languages, you'll also hear people lament how horribly some non-native speakers butcher them, perhaps because those non-native speakers are using them merely as a "functional" language, rather than grasping the full depth of expression that is possible.

      This analogy has at least some merit I think, since Perl is a language that was designed "linguistically" at least in some sense, in that it has the same kinds of patterns that natural languages have and is chock full of idioms and expressions, that some programmers (myself included) find not only useful from a functional perspective, but actually enhance the creative process that happens when one writes code. I think part of that is due to Larry Wall's now venerable "Programming Perl" -- which is one of the few truly valuable programming books that's also actually fun to read -- especially if you're one of those people that thinks at least a little like Larry, and enjoys a dry wit.

      Anyway, so yes, I totally agree, programmers that need "restrictions" in a scripting language to have their code be readable are definitely a certain "kind" of programmer. Not that they are better or worse programmers, they just don't embrace the TMTOWTDI philosophy, which is something that the society at-large doesn't generally embrace, so it's no surprise that there seem to be a lot of people that shit all over Perl.

      I've seen (in my own code and in others) truly beautiful and elegant Perl code that reads like a story, and also the "line noise" code people complain about. Which is really all about regular expressions. Some people really love 'em, perhaps a little too much. Though as has been pointed out probably a billion times, there's nothing wrong with one-off throwaway code that looks like line noise, but if you're building a giant system, then your code should be all pretty and commented and generally sociable.

      It's both unfortunate (and I still hope... a mixed-blessing) that Perl 6 has taken so long to come about. In that PHP went and pretty much took over it's niche as a web-development and "glue" language. Though the Perl community is still strong, if small, and I have no doubt that it will remain a living language for a long time to come, if for no other reason than the fact that CPAN is awesome, and there are zillions of lines of code written in Perl that a lot of people depend on every day, and that when Perl6 matures, I think it will enjoy a resurgence, within the Perl community, and perhaps much further, simply because of the simple and powerful philosophies that it encodes.

      Easy things should be easy and hard things possible.

  3. Re:Next question by Halo1 · · Score: 5, Funny

    How does C++ fair?

    Farely average.

    --
    Donate free food here
  4. Re:Novices learning from whom...? by finnw · · Score: 5, Informative

    Yes it was Perl 4, which is one of the flaws in this study.

    --
    Is Betteridge's Law of Headlines Correct?
  5. Also... by Ardeaem · · Score: 5, Insightful
    They also say that

    While Perl has never had a particular reputation for clarity, the fact that our data shows that there is only a 55.2 % (1 - p) chance that Perl affords more accurate performance amongst novices than Randomo, a language that even we, as the designers, nd excruciatingly difcult to understand, was very surprising.

    This is a complete misunderstanding of what a p value means in statistical inference. The p value is not, and should not be interpreted as, the chance that "Perl affords more [or less] accurate performance." The p value is the chance, given that there is no difference, of obtaining a difference as large or larger. This is covered in first-year statistics.

  6. Re:Quorum looks a lot like Pascal by MoNsTeR · · Score: 5, Insightful

    If those punctuation marks (or keywords) make the code more readable, then they're not gratuitous are they?  I, for one, find brace-less languages fantastically hard to read, Python especially.

  7. Re:Novices learning from whom...? by Smallpond · · Score: 5, Informative

    "we did not train participants on what each line of syntax actually did in the computer programs. Instead, participants attempted to derive the meaning of the computer code on their own."

    They were not trained. They were just shown code samples with no explanation. The code samples had 1-letter variable names and no comments. The Perl sample uses $_[0} for getting the first sub argument instead of shift, and "for ($i = $a; $i = $b; $i++)" to do a for loop instead of "foreach $i ($a .. $b)", so it is deliberately obfuscated Perl.