in reply to Textual Analysis and Idiomatic Perl
in thread Textual Analysis and Perl

If you intend to discuss programming idiom as cultural phenomenom you will need to define 'cultural'.

For instance, does the programmer's choice of idiom depend on what s/he was taught in a programming class. S/he may learn to use one idiom in a classroom, someone else may pick another teaching him/herself Perl. And a third programmer might learn to use an idiom because s/he saw it's use on Perl Monks. Which is a personal choice and which is 'cultural'? Or are all three 'cultural?

I am not trying to nitpick what has been said. I am just trying to point out that this is a difficult and complex subject. A good analysis will take a lot of work by a lot of monks.

xenchu

Perl has one Great Advantage and one Great Disadvantage:

It is very easy to write a complex and powerful program in three lines of code.

********************************************

The Needs of the World and my Talents run parallel to infinity.

Replies are listed 'Best First'.
Idiomatic Perl and Culture
by gwadej (Chaplain) on Dec 02, 2003 at 14:23 UTC

    You've hit the nail right on the thumb as they say.

    In this case I was speaking of Perl culture, although all of the others apply.

    I have dealt with many programmers who continue to write code in every language they encounter as if they were still using the first language they learned. ("You can write FORTRAN in any language.")

    I'm sure we have all seen people who stick to an approach they were taught in a programming class, whether it is correct or even makes sense in the current context, because that is how they were taught.

    In this case, I'm speaking of the shared culture of Perl (assuming it exists <grin/>). Obviously, some of the idioms above do not apply to other languages. Most languages have their own cultures and idioms. Some of those idioms translate to other languages, some don't. One of the things I like about Perl is the richness of the idioms it supports.

    Strangely, some languages seem to try to remove idioms in favor of having only one way to solve any given problem.<shrug/>.

    G. Wade
      Strangely, some languages seem to try to remove idioms in favor of having only one way to solve any given problem.

      Even worse, some people designate many of perl's unique, concise and powerful idioms as "tricks", and unilaterally declare them as deprecated. The usual rational for this is that the (mythical) "maintainance programmer" may be confused by them -- it's never 'them' that is confused, always the maintanance programmer.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      Hooray!
      Wanted!

        That's a very good point.

        <grin type="evil">I've even been known to use this as a feature.</grin>

        For code that requires a certain level of expertise and understanding to modify, making it idiomatic sometimes scares away those who shouldn't touch it. Kind of like those you must be this tall to ride this ride signs. I haven't yet come up with a you must know this much before modifying this code sign.

        Unfortunately, it sometimes backfires. People fix the code to make it more readable, and make it do something else entirely.<sigh/>

        G. Wade