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:

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)
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:
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


In reply to Re: Perl as Cr*p? by tachyon
in thread Perl as Cr*p? by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.