Find Your Mantra

Recently I was asked a question to describe what exemplified me as a coder, preferably with an example of code. It was odd, not something I’ve ever really thought about. I write code and attempt to leverage the pluses of a given framework and work around the minuses. I don’t have one “goto algorithm” for sorting things, or a given methodology that could be described in words let alone code, so I got to thinking, and thinking, and thinking. All I came up with was one simple rule: “Write easily digested code.”

I’ll be straight, I’m 40 years old, been in IT for over 20 years, and I’ve not the time nor desire for flexing my coding muscles by showing of my implementation of  the “modified pre-order tree traversal” algorithm. I’m not gunning for a job at Google, or looking to be a star on Top Coder, etc. I’m here to “get shit done” in a sensible, maintainable, and easy to understand way. Perhaps its my python background that taught me that there is elegance in simplicity and much value to be had in explicit versus implicit code. Sometimes that may seem like the long way around but in the end, even the most “showy” of developers wind up appreciating something simple. We stare at problems all day, one of those problems need not be deciphering someone else’s “mental inspirations” in their code.

MOST of us aren’t coding to save lives, put someone on the moon, or write high performance platform games. MOST of us don’t have to worry about the “Big O” of a given algorithm. I save that for the people *way* smarter than I am. I rarely have to dust that sort of skill set off and when I do, you can be darn sure I will have no less than 22 tabs open in Google walking me through it.

At the end of the day, when I move on in this world, whether figuratively or otherwise, I want whomever inherits my code to not have to sit back and scratch their head, or re-read a section of code over and over to make heads or tails of it.

I’ve talked about writing clean code before, but this goes even beyond that a little bit. Its really one of those things that are hard to talk about until you’ve seen it. I’m always striving to make my code simple to comprehend, but not just by seasoned programmers but by the young intern that’s gonna be inheriting your code someday.

I’m not exactly sure the person I was talking to was pleased with my answer, it was probably nowhere near academic enough to hold their interest and probably seemed like a cop-out. It may be a cop-out to them but for me, its sort of turned into a mantra: “Write simple and easily ‘ingestable’ code”

 

:wq!