Hacker News new | ask | show | jobs
by mutation 4881 days ago
There's one obvious way to write good Perl code: read the documentation. Perl has tonnes of it. There are bugs in there of course, but most of it is very good. Also try to visit perlmonks.org once in a while - they're good there. Everything else is just a reason to be lazy and not care about the code you write.
3 comments

And, Perl has an awesome community, let's not forget that. They do love clean code and all (modern Perl is very easy to read and understand IMHO), but are aware that in the end you want to get the job done.

Time and again, the question "are there any useful ideas or features in language X that we can borrow and implement in Perl?" has been posed by prominent people in the Perl community. Which is the opposite of the "not invented here" syndrome.

There's another obvious way to write good Perl thanks to the CPAN: don't write it because others already made the work better than you. @mutation: i agree with doc quality.
Well, the documentation system on CPAN is ancient and awful to use. I have often enough found missing documentation. Particularly perl programmers seem to give a f*ck about documenting return values. And even when there is a good documented function, often enough i am not smarter after reading. Just picking a random method of a random module here:

http://search.cpan.org/~grichter/HTTP-Webdav-0.1.18-0.17.1/W...

What's the return value? Is there really no result? And what is cache? I can't even click that variable and see it's structure.

As a reminder, i just picked some random module. It's 2013 and not 1980. I'd like to know that kind of stuff quickly when i check for arguments and how to call stuff. I like that stuff in my editor/ide as well. Clickable. Call me lazy, but i do want to work efficiently and not trying to google all day for a simple usage example. I like to get the work done.

You're partially right about perlmonks. It's a great resource for perl! Sometimes it seems like it's the last stronghold of the perl community but it has great answers. What is not so great is that i find multiple solution (like more then 10) for a very simple problem, but that's subjective..