in reply to Opinion: where Perl5 wasn't attractive for me

A wise man once said:

To gain the benefits of Perl, programmers coming to it from a different language must learn and internalize idiomatic Perl programming style and technique. The same applies to programmers used to earlier and less expressive versions of Perl.

Thoughtlessly applying techniques effective in one language to another typically leads to awkward, poorly performing, and hard-to-maintain code. Such code is also most frustrating to write because every line of code and every compiler error message reminds the programmer that the language used differs from "the old language."

...except that he didn't say it quite like that. The statement above was written by Stroustrup, in The C++ Programming Language, 4th Edition.Except that everywhere you see Perl, his statement read "C++".

All of these bullet points enumerated in the top post of this thread are just annoyances or surprises to someone who comes to Perl from another language. And that entire class of issues pertains to anyone learning a new language when another language is more familiar. Such an individual will be frustrated until a similar comfort level is achieved in the new language.

For each of your bullet points, I encourage you to step back and ask yourself "Why is it that way?" Don't settle for "because". Investigate, and don't stop until you know the reason. There is a reasonable explanation for each of the points you raise. But you won't be convinced until you do your own investigation and realize, in each case, "Oooooh! I see." And when you do reach that stage, you'll be a better Perl programmer for your effort.

If, at any point, you reach a full understanding of the issues surrounding each of your bullet points, and still feel that there's a better solution, put it in a proof-of-concept module, upload to CPAN, and see if people like it. Fully researching a topic, and producing a better solution... that's progress. Knee-jerk reactions to constructs that you haven't taken the time to fully investigate will not produce a better Perl. Nor will they make you a better programmer.

(Update) Learning why a language works the way it does will make you a better programmer, whether it's Perl, Lisp... even PHP.


Dave

  • Comment on Re: Opinion: where Perl5 wasn't attractive for me

Replies are listed 'Best First'.
Re^2: Opinion: where Perl5 wasn't attractive for me
by Anonymous Monk on Nov 20, 2014 at 03:11 UTC

    .... Knee-jerk reactions to constructs that you haven't taken the time to fully investigate will not produce a better Perl. Nor will they make you a better programmer.

    Having thoughts and bravely sharing them, is a good first step on the journey to enlightenment :)

      I'll accept that. :)

      This was a meditation, after all. My hope is that these bullet points are really just seen as a list of things to investigate further, to earn better enlightenment.


      Dave

Re^2: Opinion: where Perl5 wasn't attractive for me
by rsFalse (Chaplain) on Nov 20, 2014 at 11:20 UTC
    >> All of these bullet points enumerated in the top post of this thread are just annoyances or surprises to someone who comes to Perl from another language.

    And I think that my bullet points are mostly indifferent to other languages. I'd write same bullet points if I weren't familiar with other languages.
    Also one bullet: I wanted to write that I little dislike assignment operator "=" (C lang family), maybe because firstly I was learning "Pascal" (":="), but stronger motive is that assignment has direction, so that operator hasn't vertical symmetry axis or symmetry point. I'd like to use symmetric operators for commutative operations, such as +, -, *, but for non-symmetric operations - use non-symmetric: =~ , <<,... But his rule difficult to realize, because then operators would consist of too much signs. Hm.. maybe I'd rather use "&~" operator for smartmatch, but it is a little more difficult to write.