Zen and the Art of Software
# Introduction
I don't know how this will play out. It might be part memoir, part musings and part nonsense. Or it might all be unfinished ramblings. Some of it may be true and some may be imaginary. I think that's ok.
# One
I was baffled when my dad, guided by his friend Phil entered a store filled with plastic boxes, glass screens, ominous red and green blinking lights and nylon coated wires that felt more like a biology lab than showcase of a consumer technology. Phil was needed, I imagine, because my dad is a proud, self-declared luddite and Phil, a nuclear engineer, was clearly much more technical. The baffling thing to me was that we had come to get a mouse, which I expected to find in a more natural habitat like the puppy-and-parakeet-filled windows of the Westminster Mall pet shop we passed on our way in.
I guess we'd already had a computer at home by that point, but the mouse is my earliest memory of technology. It seems the regrigerator, floor lamps, station wagon, paved roads, television, VCR, radio and tennis shoes didn't count as technology to my 1995 self. The mouse was different. I think maybe the mouse didn't belong. It also seems that my dad the luddite didn't consider those other technologies to be offensive to his resistance of the digital future.
I also remember clearly another instance of technology that made me afraid—which for me meant a deep-in-the-chest burning anger and the feeling of being trapped, drowning or suffocating or being locked in a small closet with the lights out and all the friendly voices of the world just beyond laughing and belonging and forgetting that I exist. This instance was when my dad bought a CD player for the house. The new technology threatened the comfort of the old radio and casettes and records and all the memories that came along with them. I panicked, but, like with the mouse, I eventually gave in.
I wonder if other people are so threatened by technology or if they don't even notice it or are apathetic. And I personally do not know anyone who is Amish.
# Two
- to write good code you have to believe there is such a thing as good code
- ego and insecurity are the most common reasons I see bad code
- developer egos are strongly offended by the suggestion that code can be better
- good code, like good prose, usually requires more than one draft
- most code I read is written like a rough draft
- developers usually don't want to spend the time to get code right
- sometimes it's because they don't believe there is a way to get it right
- sometimes it's because they are impatient
- sometimes it's because their ego is offended
- often it's because there is no expectation by peers, mentors or managers to do it well
- most code in tutorials and forums online is bad (contrived)
- that has an enormous influence on professional developers
- efficiency is often the enemy of progress
- readability and style
- flowery code, terse code and elegant code
- readability is usually an excuse for familiarity
- naming things is hard and often neglected
- organizing code requires intentionality and discipline (ref: Coding by Coincidence—Pragmatic Programmer)
# Three
- a theory on code, balance and zen
- I try to write code like Hemmingway or Cormac McCarthy
- I want to be as clear as possible without wasting any words
- Dieter Rams talks about it in regards to design: "Good design is as little design as possible."
- I also have no tolerance for terseness
- the goal is clarity
- mostly clarity can be "pure"—communicated by clean code
- sometimes and only rarely, clarity has to be more blunt for the sake of performance.
- this means comments in the code