Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: My Perl code can be understood by...

by Juerd (Abbot)
on Feb 25, 2008 at 15:27 UTC ( #670028=note: print w/replies, xml ) Need Help??

in reply to My Perl code can be understood by...

It all depends on the kind of code, and the intended audience. For CPAN modules, I try to optimize for performance if it doesn't hurt readability too much. This code can be understood by experienced Perl programmers.

For one-off quick hacks and oneliners, I don't care about readability and will use any technique that saves me from having to write much more code. This code can often be understood by people who are experienced in Perl. I will use ~~ instead of scalar.

For example code in documentation, I try to optimize for readability. However, I will continue to assume that the reader is at least comfortable with Perl. That means that I still do use statement modifiers and the $_ variable.

The Perl novice will have to find a way to plough through the first part of learning Perl: dealing with its sometimes exotic syntax. In some ways that is a barrier of entry, and keeps dumb and uninterested people away. It's not hard to learn how Perl works, there's lot of documentation to explain it. If you're learning Perl, you're only a real novice for a few days anyway.

I suggest that people who are not comfortable with Perl, should not be using it.

Juerd # { site => '', do_not_use => 'spamtrap', perl6_server => 'feather' }

  • Comment on Re: My Perl code can be understood by...

Replies are listed 'Best First'.
Re^2: My Perl code can be understood by...
by gloryhack (Deacon) on Feb 26, 2008 at 01:08 UTC
    ++ ** 10E6!

    I spent years dumbing down my code so J. Random Neophyte could read it, understand it, and make changes. I found out the hard way that JR is an untrustworthy witless dolt who should never be allowed to use a computer. He turns off the strict pragma because it does nothing except stop perfectly valid code from executing, and thinks that testing is a crutch used by incompetent programmers who don't know what to expect from their own code. I don't want JR to feel comfortable "fixing" my "executable line noise". I want JR to go back to flipping hamburgers where he belongs. And to receive at least two painful burns each week. On his face.

    The greatest threat to continued habitability of the planet is people who are convinced of their knowledge of things they've never actually learned.

      Now I have to go and find the 20 things most likely overheard from a Klingon programmer ... Sheesh!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://670028]
[Corion]: We-ird - I hadn't known this, but Ingress and Pokemon Go (both AR games in the real world where you run around) switched from using Google Maps to OpenStreetMaps, which is great. But I wonder why, as Ingress is (was?) owned by Google/Alphabet. But ...
[Corion]: ... maybe not wholly owned, or the load on Google Maps was too high?!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2018-03-19 09:06 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (236 votes). Check out past polls.