32
loading...
This website collects cookies to deliver better user experience
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.
perlcritic
, the code analyzer is one of my favorite tools. (Though 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.perltidy
, and it too has a Conway-compatible configuration as well as its default Perl Style Guide settings. I’ve found that more than anything else, perltidy
helps settle arguments both between developers and between their code in helping to avoid excessive merge conflicts.perlcritic
and perltidy
, but what about other sins attributed to Perl? Here are a few perennial “favorites”:bless
, constructors, or writing accessors for class or object attributes. Smarter people than me have done the work for you, and you might even find a concept or three that you wish other languages had.32