Formative Experiences: Intro to Chapter 5 of Larry Wall’s Programming Perl

Reading Larry Wall’s Programming Perl book was a formative experience for me in a variety of ways. Discovering that writing about programming could be funny was amazing. But more importantly, that writing about programming could be fundamentally insightful while being funny was the true delight. The introduction to Chapter 5 on “Packages, Modules and Object Classes” is the distillation of what makes this book great. Wall’s awareness of the sociology of programming and addressing/accommodating/reining developers and their base instincts is something that’s stuck with me far beyond my dalliances with perl. If you’re a programmer, these paragraphs are worth a read

This chapter, more than any other in this book, is about Laziness, Impatience, and Hubris – because this chapter is about good software design.

We’ve all fallen into the trap of using cut-and-paste when we should have chosen to define a higher-level abstraction, if only just a loop or subroutine.[1] To be sure, some folks have gone to the opposite extreme of defining ever-growing mounds of higher-level abstractions when they should have used cut-and-paste.[2] Generally, though, most of us need to think about using more abstraction rather than less.

(Caught somewhere in the middle are the people who have a balanced view of how much abstraction is good, but who jump the gun on writing their own abstractions when they should be reusing existing code.)[3]

Whenever you’re tempted to do any of these things, you need to sit back and think about what will do the most good for you and your neighbor over the long haul. If you’re going to pour your creative energies into a lump of code, why not make the world a better place while you’re at it? (Even if you’re only aiming for the program to succeed, you need to make sure it fits it’s ecological niche.)

[1] This is a form of False Laziness.

[2] This is a form of False Hubris

[3] You guessed it, this is False Impatience. But if you’re determined to reinvent the wheel, at least try to invent a better one.

blog comments powered by Disqus