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."
Better? How about we start with distinguishable?
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
How does C++ fair? LOL
The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
I always thought Perl was a randomly generated programming language.
There's no -1 for "I don't get it."
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.
Who taught them Perl? Where did they learn to call subroutines with an ampersand? A Perl 4 manual?
OK they're novices but even I didn't write loops using C-style loops as a novice Perl coder because I was reading that it was more readable to do for($a..$b) instead.
They claim that Perl is not significantly better than Randomo, but that's just due to the test they chose. Looking at their figure, Perl programmers outperformed Randomo programmers in 6/6 tasks (that is, their means were greater). Using a simple sign test on the differences between the means, the two tailed p value is about 0.03, and the one-tailed p value (I think we're justified here having having a directional hypothesis...) is about 0.015. Both of these numbers are less than 0.05; we are justified in saying that Perl programmers performed significantly better than Randomo programmers, in spite of what the paper says.
Are they telling me that Quorum is better then a randomly generated language at teaching and that Perl makes bad programmers? This sounds more like someone setting up a study and trying to rig it so that their horse (quorum) gets taught in the class room. Personally I stick Perl in the same bucket as VB and most scripts. They may have their uses but new programmers need to be beaten with languages like C and C++ first. Otherwise they learn bad habits. Perl only starts getting good when you use strict so that it has been given permission to beat the programmer for any little mistake.
My guess is that Cobol would beat any of the three - it is designed from the ground up to be readable.
So are Pascal and Python. In fact, Quorum looked a lot like Pascal from what I saw in the PDF.
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.
But for now... If I were a Samurai, I would not start newbies with a live sharp sword. And Modern Perl is so, so very sharp...
I keep reading the full paper (+points for publishing the whole thing!) and have yet to hit upon the definition of the word "accurate" they are using to measure the results. Apparently that is contained inside their previous paper with no direct link. On page 3 though, Perl is described as "A well-known commercial programming language". Really? C# is a commercial language, Perl is an Open Source language with wide commercial adoption that has evolved or the years into several distinct beasts.
1 Dachshund + 1 Dachshunds = A Paradox.
The participants didn't know the languages before. If anything, the study only proved that Perl has a steep learning curve.
Didn't APL prove this a long time ago?
When Perl is well written, including indents and not jamming multiple lines all together on one line, it looks very similar to Python, but with a semicolon at the end at each line.
I was going to post a string of close parens as representing the termination of a Lisp program, but the comment moderation nanny would not let me do that. So much for trying to tell a geek joke around here.
It's something of an injustice to credit "Southern Illinois University" researchers for this. The unmodified SIU is in Carbondale, while these researchers were in the Edwardsville branch.
One of these days that may happen to me.
How is Java better than C++?
The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
While it is important for adoption how fast one can learn a language, the long term benefits are much more important. I also needed time to get used to Perl but is now a programmable languages very dear to me: it is reliable, has a great culture, is fast, does evolve only slowly and can be extremely powerful. This is similar to LaTeX, which needs first some efforts to learned but after a while runs circles around any other text processing system. Other programming languages or text processors might be easier to get started with, but they do not scale and limitations will eventually lead to frustration.
You know, the "study" (which I didn't read, this being slashdot 8-) probably involved exposing the languages in question a hugely diverse and wide ranging number of College Undergrads That Fancy Themselves Programmers. As such, the fact that the quality of the code was not distinguishable despite the language chosen indites the programmers more than the languages.
The problem with most studies is that College Freshmen already know everything so any attempt to test them is doomed to fail.
Innocent people shouldn't be forced to pay for inferior software development.
--"Code Complete" Microsoft Press
Perl is a language, just like Dutch, Swedish, English, German and most of the others. In just about any language there is, to paraphrase a well-known Perl motto, more than one way to say something. That is in many ways a good thing, especially when it comes to using the language creatively as a novelist or poet or similar type of wordsmith does.
It is true that this quality does tend to make Perl programs somewhat hard to grasp for the uninitiated in the programmers style of writing. That is another quality the Perl language shares with those other languages mentioned above - did you understand all of Finnegans Wake the first time you read it?
In other words, Perl is a writers' language. It is not an editors' language. Once you get into the right mood, Perl flows like your native language does. Done right, this can lead to great things. It can also lead to the sort of notes you made when attending those lectures you did not care about in the first place, and did not understand in the second. Use Perl for things you care about, and it will provide you the means to express yourself in just the right way (for you).
--frank[at]unternet.org
me: My hovercraft (pantomimes puffing a cigarette)... is full of eels (pretends to strike a match).
them: Ahh, matches!
me: Ya! Ya! Ya! Ya! Do you waaaaant... do you waaaaaant... to come back to my place, bouncy bouncy?
This paper is about program language syntax, and frankly speaking I think it's a shame that after so many decades of programming language research syntax is still being discussed and people constantly come up with new ways of writing down the same. Why do people invent a new syntax every time they invent a new language as if it mattered at all? Who the fuck cares about syntax?
However, if we must talk about syntax, I'm really wondering whether there is anyone out there who honestly believes that there is anything wrong with LISP style S-expressions, which is about the simplest syntax you can get, after actually having completed several large projects in a prefix LISP-style language with standard reader. For it seems that most if not all people ranting about parentheses and s-expressions have never really used any such language. I'm fine with being wrong about this, so I'd like to know: Is there anyone on /. who has actually programmed a lot with a LISP-style language and didn't like for its syntax or had problems with its syntax? What was the problem with it? (Parentheses? Well, then use Algol-68 instead.)
In brief, shouldn't the discussion be about programming language semantics instead? There is still lots of work to do regarding parallel programming constructs.
Wow, how much time did they spend studing the premise that people working with a tool they know are able to "more accurately" write programs than users of language they don't know...
I think I'll file this right after the study on why" holding heavy things makes my arms hurt" and "people who know where they are going tend to not rely on their GPS" studies...
Ken
C'mon. You're messin' with me aren't you?
Please do not read this sig. Thank you.
If you ask a novice to sit down and learn the tool chain it takes to write "hello world" in Java vs just about any other language, you'll be conducting a fair test that is actually relevant to novices.
Seastead this.
They're using outdated perl syntax. And taking advantage of things you shouldn't be doing even if they're allowed. Lots of languages let you do things and caution you not to. Not saying "return" or using good variable names or declaring scope on variables isn't good.
Regardless of how hard a language is to learn, once you "get it" you pretty much "get it" for 90% of other languages too. For instance, I can read and translate both Quorum and Randomo just by looking at the examples provided. That doesn't make the languages easy to use or better, or make perl worse, they're just different cases.
Users have to learn the fundamentals of programming before they can program. Conditionals, loops, subroutines, Boolean logic. All of which were touched on by their sample. To me, changing "sub" or "function" to "action" doesn't make things any clearer, it just seems like you're trying to reinvent pascal. Repeat b-a times is kind of nice, but you could do the same by saying for($a..$b) { } (which arguably is less clear than the repeat statement but just as true, you want it to repeat for all integers between $a and $b)
Also, removing parenthesis might make things clearer for simple logic but what about if d + e > 4 * x? Now you've introduced ambiguity, or at least forced the user to memorize order of operations rather than letting them be clear in their statement.
They also acknowledge they only tested 18 people, which isn't a big enough sample set to know if they're on to something. They've essentially asked "which is easier to understand, psuedocode or badly written real languages with no comments" and the answer is pseudocode, but it's still not intuitive what the program does.
I think they're failing to understand that people writing code now might not even understand modulus. While that's sad, it's also important to grasp what level of novice you're dealing with before training them. Visual Basic will let you write a minesweeper game without doing any math. Does that count as easier, or does math still have a place? (When I see novice programmers writing logic that doesn't use math it generally means they've unrolled what you would be doing mathematically and done a bad job of it)
In summary, I like perl. Many people from the python/ruby/php communities have already had their fun pooping on the party so if you're going to attack the language please make sure your arguments hold some weight. There are definitely problems but syntax isn't one of them unless you run with scissors every time your parents hand them to you. Perl has very few training wheels and therefor you get people giving bad examples, but if you ignore those it just gets things done.
Larry Wall came up with Perl on purpose.
He is well known for having a wierd sense of humor.
I have heard that in Randomo shops they create variable names by closing their eyes and pulling tiles from a Scrabble set.
We stopped doing that after we realised that the variable names were spelling out messages from dead serial killers.
Ok, sorry, but I'm just going to call nonsense on that one, lol. Either you have no idea of the scope of problems that can be addressed in 250 lines (and perhaps no idea what a c line *is*), or you're one of the world's worst c programmers.
I've fallen off your lawn, and I can't get up.
Ain't surprising that Perl and Python win for string stuff, but :
C beat both Java and C++. C has no string type! LOL
The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
"Its syntax is very forgiving, and there are lots of ways to do most things"
Am I the only person who sees this as one of the biggest problems with PERL? Don't get me wrong, I love choice and having options. But when you're learning a language you do not want 10 different styles of writing a function, statement, loop, whatever. Because when you are working with 10+ people you now have 1 language, 10 different ways to write in (and now 10 different ways you need to read).
When I first started learning PERL and reading books, websites and downloading examples all the different styles of writing in PERL was the biggest problem. You can't just simply learn how to do an IF statement, you have to learn the 20+ different ways you COULD write an IF statement, since every example you will find online will be totally different.
TruePunk | Games
...which begs an interesting question, why doesn't source control include some sort of formatting neutral diff system? Imagine code that you format using style "a", because you prefer it, is uploaded to the server, which removes all formatting and saves it. I download your changes, and upon download, style "b" formatting is applied. When I look at changes, formatting differences are negated. Seems like a very useful feature.
HA! I just wasted some of your bandwidth with a frivolous sig!
Could said novice read the documentation?
how to invest, a novice's guide
Try Moose.
I think you have to understand the two underlying philosophical notions of Perl and know how to use the documentation to use it effectively. The book Modern Perl (I wrote it; electronic versions are free) explain those straightaway.
how to invest, a novice's guide
I thought Perl *was* a randomly generated programming language. I think Perl users tend to fall into two groups -- the ones who thrive on it, and the ones who get violent headaches from too extended a contact with the language. (I'm in the latter group.)
Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
I started with Python, and I was struck by how the syntax was relatively close to natural English. Someone said it looked like BASIC, even.
Python: Relatively easy for newbies to pick up on, while still being a full-powered general-purpose language
I listen to both RIAA and non-RIAA stuff if I like the music, tangential business/politics nonwithstanding.
Really, Python's problem is that both spaces and tabs are legal
Open IDLE, Options > Configure IDLE... "Python Standard: 4 Spaces!"
If their purpose was to show that good programming habits are hard to teach with Perl as a base, that makes sense because Perl is rather forgiving of things that other languages would flat out reject.
That, however, does not on its own make Perl "bad" or even "worse" than any other language as a whole. Tragically, that seems to be the message that the summary is trying to convey here.
Taking two programming languages - any combination of two languages - and trying to call one "good" and the other "bad" is idiotic at the very least. It is like setting a chainsaw next to a Glock and asking someone to tell you which one is bad and which one is good. Both are useful and you can't compare the two on just one dimension and expect to have meaningful results of that comparison.
Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
Is Perl Better Than Another Randomly Generated Programming Language?
It's great for quick and dirty - unfortunately, everything written in perl tends to look like it was done "quick and dirty." Programming "clean" perl means ignoring most of perl's features, at which point you might as well just switch to a cleaner language.
The paper talks about things like "repeat" being more intuitive than "for"... I wonder if the authors considered testing languages like Hypertalk or AppleScript that are purposely designed for novice use. It would be interesting to see if they work. However, my gut (very unscientific) tells me that most professionals learn to think in the syntax they adopt, and other factors come into play than this intuitiveness. These might include efficiency (or density) of the language and ease of debugging (the whitespace issue). A test like this does not say much about the usefulness of a language to someone who devotes themselves to it.
Looking at the paper, I can see that quorum is wordy, using full words for most of its syntax. This makes it friendly to beginners. Indeed, this is what the results showed; novice programmers for whom quorum was their first language could understand it more easily than perl. But, a wordy language is annoying and inefficient for pros. The quorum example code has many more characters than the perl or randomo code, which means much more typing. A smart IDE can help to a point, but it can't completely remove the overhead of extra verbiage.
The study (and I don't think it represents itself correctly) was presenting code samples and telling people to learn from them how to write a program in that language.
The participants were presented with something which looked a lot like a modern version of basic (Quorum) a random-ish programming language, and perl. The sample programs were written as best as could be written, I suppose, in that language; the Quorum samples were written like you'd expect a basic program to be written; and the perl sample programs (as shown in the PDF) were written like basic programs by someone who clearly had no idea how to write a decent perl program.
None of the syntactic aids which perl is so rich in were used. Variables & function names were chosen like in old basic or fortran. Integers were initialized like reals. The study shows that when incompetent programmers are told how to program by incompetent programmers, it's helpful to make a programming language have a more immediately and superficially helpful syntax.
Duh.
If they'd given these people a book and some time, they would have certainly have written better programs in perl than in the random language. Possibly better than in Quorum, though I doubt it. People have a lot of baggage/experience with basic and the languages which derived ideas from it, so that Quorum (as presented in these code examples) would seem more natural to them. These people weren't programmers, they were people who wanted $10. A random sample of college students will find a bunch of hits on people who have used basic, and some who might have done something in java -- I suspect about 20% to 30%. But how many will have experience with a novel language like perl? One? (I am just guessing on those numbers. Notably missing from this study is any analysis of the experiences of the subjects, which would have given us some clue to those numbers, albeit with this small sample size.)
Cobol would have been alien to them too, and the designers of this study would have tried to make it look like basic, since that's what they seem to know.
Thank you. I was not aware of your book.
Looks good.
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program. The rest of them will write Perl programs.
The truth or interpretation..
Ok, I gots to know:
Why is $_[n] for getting the values of arguments error prone?
Less importantly, why is &foo bad perl code?
In this thread, I've seen these ideas presented as self evident, but this is the first time I've encountered them.
Plan My Week for iPhone
Comment removed based on user account deletion
Comments above show this paper does not study what it purports to study and draws false conclusions based on a non-understanding of statistics. Is it my imagination or are we getting more and more crap papers like this on /.?
It's so boring listening to little Perl haters. They always seem to have some chip on their shoulder as if Perl were the one language they just couldn't ever get. As if that C++ is any fun. Please, *must* I write in C++? Perl is a writer's language, if you are in the habit of using it you can write hard code [b]very[/b] fast. Brilliant prototyping, unbeaten RE/text manipulation, an unmatched repo of prewritten library code in CPAN, and a real "soul" that encourages one to have a stab at that complex regex only to discover it actually works first time. And that poetic sense that line noise is never just line noise. And finally: as great as sed and awk are, if you know a little Perl you won't need sed or awk for anything.
We're all supposed to be "knocking up" everything in Python. Yawn. I'm sure Python's great and I like the built in library (no way comes close to CPAN though). But Perl has character. There are intangible things that will attract one to a language. Perl can do things simply or Perl can do things hard. There is a wealth of intellectual complexity in Perl or just pattern-obsessed autism, either way it works. Perl rocks.
I suppose I should be pleased that Ruby is still fashionable. Ruby syntax is based on Perl and Larry has said that Perl OoO takes a lot from Ruby.
Interesting... I found their CS department to be OK.. but I got my BS-CS back in '93 at SIU-C. Maybe the department has changed, I know the landscape of CS certainly has. But these researchers are from SIU-E, and I don't even think they had a CS department back then. I don't think you can discount the research entirely based on where it came from.
My beliefs do not require that you agree with them.
Can an expert in Randomo code in Perl without knowing Perl beforehand?
It occurs to me that Perl is just the web replacing the gap left by Teco.