Monday, August 30, 2021

The Funhouse Mirror of Perl Criticism

Circus infograhpic.

Last week's article got a great response on Hacker News, and this particular comment caught my eye:

I think this is the real point about Perl code readability: it gives you enough flexibility to do things however you like, and as a result many programmers are faced with a mirror that reflects their own bad practices back at them.

-orev, Hacker News

This is why Damian Conway's Perl Best Practices (2005) is one of my favorite books and perlcritic, the code analyzer is one of my favorite tools. Although, the former could do with an update and the latter includes policies that contradict Conway. Point perlcritic at your code, maybe add some other policies that agree with your house style, and gradually ratchet up the severity level from "gentle" to "brutal." All kinds of bad juju will come to light, from wastefully using grep to having too many subroutine arguments to catching private variable use from other packages. perlcritic offers a useful baseline of conduct and you can always customize its configuration to your own tastes.



from DZone.com Feed https://ift.tt/3zMdPHL

No comments:

Post a Comment