in reply to Perl as Cr*p?
I see two major problems with Perl
The ease with which you can get a Perl script to run is both a blessing and a curse. Because you can get some code running easily and, once you discover CGI.pm etc, actually generate useful applications it is easy for people to convince themselves they are programmers and then go on to try to make all 101 of the 101 all time worst programing snafus. Unfortunately the explosion of the web has seen what I have heard described as "English majors who have been promoted to positions as database engineers". Their chosen weapon has typically been Perl.
The second problem is TIMTOWDI. Most languages have 1 major loop construct. Perl has dozens of ways to write a simple loop, depending on how you count:
At this node Idiomatic Array Index Search? someone was asking how to make their code more idiomatic. They presented 20 lines with comments, whitespace and indentation that was easy to understand, yet they wanted to make it idiomatic. I presented a seven line idiomatic (but still quite understandable) solution and then went on to GOLF it down to this:for ($i=0; $i<=10; $i++) # old faithful! for (0..10) for (@array) for (0..$#array) print $_ for 0..10 print $_ for @array print $array[$_] for 0..$#array print $i++ while $i<10 Not to mention foreach (same as for but...) foreach my $element (@array) map {print} 0..10 Throw in a few infinite loop constructs for (;;) 1 while while (1)
sub getArrayIndex { map{return --$_ if $_[0] eq $_[$_]}(1..@_-1) and -1 }
I did note that generating this code in a production environment was unlikely to amuse the boss. The ability to get the job done in a really terse manner as demonstrated above is amusing to a Perl hacker but probably gives the sh*ts to people who are less familiar with Perl. Especially if they have to maintain this sort of code.
I love Perl anyway. It is a great language and Perl geeks are good geeks. What more could you want? You can't please all of the people all of the time.
cheers
tachyon
|
|---|