Categories
Uncategorized

Perl Best Practices

Yesterday, I was reading Perl Best Practices on the train. I got nearly half way through in three hours. Then I came home and finished it off. I was completely taken by surprise as to both how readable and how incredibly useful it was.

Conway is excellent at explaining not just what is a best practise, but why. He’s certainly got me to reevaluate the way in which I work. The book made me realise that some of the ways in which I code are alright now, but certainly aren’t conducive to easy maintenance of code.

But perhaps the best bit are the sections on OO Perl. Whilst Perl has long been known for having fearsomely weird OO (in fact, Conway wrote the book on OO Perl), in Perl Best Practices, he manages to talk you, very sensibly, through something called “inside-out objects,” which are a great deal more secure than the default Perl way of OO. In typical Conway manner, he starts small, with a simple implementation, then builds on it and builds on it, until you end up with something remarkably useful. And then at the end, he says “of course, you can always download the CPAN module Class::Std to implement all of this for you.” So you’ve got the idea behind the module, but you don’t have to do any work to actually implement it. It’s a bold step, coming up with a radically different Perl OO scheme, but he appears to have done it well. Others have tried and failed, let’s hope he succeeds.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s