I used to be a nasty hacker. I mean I used to write horribly twisted unmaintainable code.
It was as if this was my manual. It was fun!
But much later, after I finished high school and then university and eventually started being paid to write code, I started to work on systems which did not have the property that all of the concepts and implementation details of the system were in my head.
I began to prefer cleaner code.
Cleaner code led to fewer mistakes, faster changes and relied less on memory of the system when returning to it after an absence.
When I started to prefer cleaner code and worked for a while on systems where the code was comparatively clean, I started to sense a kind of allergic reaction whenever working on code which was disogranised, inconsistent and swamp-like.
It disgusted me and my occasions of exposure to the swamp were overwhelming. I have worked with guys who slithered past the many traps and gotchas, unmoved to clean up. I remembered that I used to be like them.
I remember never really thinking about the meaning of names. Why not just "x" or "w", or "foo" or "grandma"? I expected just to have my own symbol table in my head. Keeping all the mess in my head was a sharply honed skill.
I was a swamp wader. But I have since evolved.
I had become more like a watchmaker. I chose to keep things in their proper place. All the delicate sprockets and springs, neatly arrayed on sea green felt.
With everything in its place I refactor with confidence to bring the few strays into line. I revisit forgotten code and my expectations of being insulated from failures in unrelated parts of the code are capably met by the beautiful mechanisms. Names infer purpose. The code speaks for itself. I sought to only work with like minds.
Unneeded, my swamp-wading skills dwindled.
But sporadic outings into swamp lands were disorienting so I started to worry that being a pure watchmaker put me at a disadvantage. What if a nuclear holocaust wiped out all the quality code and I was forced to fend for myself in the swamp? How would I put food on the table and gadgets in my pocket?
I knew I needed to train myself. To follow a regime of tortuous swampy puzzles. Like writing Perl. And assembly. To maintain my mental toughness.
These days, decades after I began in the swamps I no longer suffer from the watchmaker's nervous discomfort in the presence of swampy code. I wade in when I have to. I do tend to cultivate things a little here and there but resist creating islands of pond-scum topiary amidst the impossible wilds. When I can I will isolate and subdivide. I'll leave signs and make paths. If there is time I may do more, but sometimes I just have to get dirty.
2 comments: