As many are aware, Yahoo! recently decided that PHP would be a better choice for their software than Perl. They'll still use Perl, but they feel that PHP is more more maintainable and scalable. I can't help but wonder if this Yahoo! Store example code is indicative of their Perl quality. If so, no wonder they don't like it. Ignoring the standard "I can't use CGI.pm" excuse, that is simply some awful code in so many ways. Even if they were to say "we cut some corners to make the example more clear", I can't buy it. Yahoo! recommends that people use it as a starting point. Given that it would take all of five minutes to improve that code quality, I can't see why they would put out code that is so embarrassing.
Which brings me to my point: programmers are awful. I don't care what the language is, most programmers just can't cut it. Looking at the sample code out there for Java, JavaScript, COBOL, C, or [insert your language here], I see some awful, awful code. When I look at job postings for Java programmers, I see employers typically want 4 to 6 years of experience with Java. Frankly, I wouldn't care about that. I would care about whether or not a person can program well (though I will stipulate the need for a certain minimum amount of competence in a given language).
The Yahoo! example Perl code is a good indication of why many prefer Java: Java coddles programmers with poorly developed skills. Maybe you're not inclined to see if the file opened successfully (I know the file's there, I set the permissions, I'm not changing my file structure, etc.), but you can't forget to do this in Java (well, that's not quite true). Yes, being able to play fast and loose is a strength in Perl, but it's a liability when you need to write something large that scales well. Many Perl programmers won't be able to do that, but I also think that if you drop the word "Perl", you might still be telling the truth.
Heck, when I became a mainframe programmer, I had a lot of illusions shattered. I assumed that with so much money riding on things, mainframe programs had to be rock solid. Nothing could be further from the truth. You were not allowed to move your program into production without a detailed set of instructions to the operators on how to restart your program upon certain sets of failures. There was no error reporting. Is your program trying to shove a numeric value into a non-numeric field? Who cares? It's not your problem that your program gets bad data. Unlike out modern applications, it was simply expected that people would constantly babysit the code. Given how awful code is today, though, I don't think we've come that far.
Nonethless, an organisation the size of yahoo should be able to get that fixed.
-Dom
Re:Non perl coders at work
spur on 2003-06-28T18:34:07
The backbone of Yahoo stores still runs Common Lisp... Recently there has been some fuss about Yahoo wanting to rewrite it in C++ because its programmers didn't know Lisp, but later gave up the idea. Don't know where things stand now.