While pairing with Jake this week, one of the things that I have really been impressed with is his ability to and steadfastness in writing crappy code. It’s not meant as backhanded compliment or sarcastic slight, I think it’s a valuable skill and one I’ve struggled with throughout my apprenticeship. Let me explain…
Jake has ingrained in himself the discipline of what I’m calling Pain First Programming (PFP). PFP is best described as obstinate resistance to changing the code you’ve written until looking at it and leaving things as they are actually causes you some sort of averse physical reaction.
When looking at code you’ve written feels somewhat nauseating, you have a really excellent reason to change it. You feel encouraged to make it better. You’re forced to care about it. It gives you skin in the game.
Furthermore, whether you like it or not, you will feel the pain eventually. PFP is about seeking it out so you aren’t suckerpunched later. This is a tough discipline to maintain because it seems so circuitous, unecessary, and avoidable. Butfor a programmer, making those mistakes early on, writing crappy code, understanding wh it’s crappy, and then fixing it. All of that makes for an excellent education, and if you skimp on the discipline you also rob yourself self of those valuable learning opportunities.
When you force yourself to make mistakes early on, you develop a lower and lowertolerance to pain, which means you identify issues and fix things quicker. It primes you to constantly think of ways that you could be doing things better.
PFP is not a novel concept, but I’ve been thinking about it a bit and thought it deserved some further fleshing out.