Code like a Jedi
Fear is the path to the dark side. Fear leads to anger, anger leads to hate, hate leads to [failed projects and teams]. -YODA
I have been watching a fair bit of Star Wars with Will, six, of late and the littl'un will often ask:
WILL: Why did Anakin go to the dark side?
ME: Because he had too much fear and anger
ME: Umm.. well...
As adults, the philosophy is pretty clear - to a six year old, not so much. But how does the classic Yoda quote apply to our daily work as developers? What follows is my attempt at identifying "Dark-Side-Path" traits that have reared, and continue to rear, their ugly heads in myself in the context of programming. Hopefully they will have a universal resonance and confessions will pour forth in the comment section below (and we'll all be closer to Jedi/Sainthood)!
A non-exhaustive list of some of my programming fears:
- fear of appearing unintelligent
- fear of appearing unknowledgable ("sure, I know all there is to know about x, y, z...")
- fear of having broken code discovered
- fear of being wrong, heaven forbid
- fear of writing imperfect code (as if it were possible not too)
The list could go on and on - indeed, I've left a few out to avoid this post being dragged to the depths of self-councelling. Identifying our fears has to be a vital excercise if we are to avoid turning into Lord Vader in the workplace, death pinching junior developers, designers and everyone else when they step out of our world of perfectness.
I recall working on a project that almost made me physically ill, such was the state of the inherited code-base and my naivity in working with legacy code. Returning to that code two years later produced the same rage-ridden reaction. Oh how I longed to HULK SMASH the code and the servers that it lived on. That would have been really helpful, I'm sure.
Fear leads to anger.
So what was I afraid of? And what am I still afraid of today when I work in similar situations? I've pondered this question for most of the day and my smuggest answer is fear of appearing not to be angry. i.e. if I am not on the verge of nervous breakdown while working in this dirt, others might think that I am ok with it and conclude that I code to that same standard.
I think that if we indulge in our developer-rage (and indulgent it surely is) so often that we become permantly green and our wardrobe permantly ripped and torn, we can too easily find ourselves in the very dark world of hate. We will likely to have become isolated from our colleagues who will be scared to approach us and, like Anakin, it will be hard for us not to dellusionally blame everyone else for our miserable situation - we all know what happened to him (he became a really bad team player and the team was destroyed).
Lightsabers (what can we do about it)?
In The Pyschology of Computer Programming, Gerald Weinberg talks about "Egoless programming". One of the key concepts of this is the idea that we must detach our selves from our code - the code belongs to the team. The work environment should activey promote this attitude if it is to prevail.
In my last place of work, we made some great progress towards achieving this nirvana. It really felt that the code belonged to the team, and any flaws and imperfections in it were not a blight on our characters. We unaffectedly changed our language from the individual to the collective, i.e. "I wrote this awesome reusable module..." became "We wrote this awesome reusable module..." and "Henry made a mistake here, n00b..." became "We made a mistake here, here's how we are going to fix it...". Defensiveness, fear and anger were rarely experienced. It sounds simple, and in part it is. Some things that I thinked helped:
- A highly organised boss (project manager), who shielded his teams from impossible deadlines. When a client wanted changes, the answer was almost always, "Sure thing, it means this gets pushed out till next year, etc." - the client was mostly if not always very understanding
- A boss that intentionally or not, promoted egoless programming through his language and the rules that he laid out (I have a strong suspicion that it was enterily intentional)
- Boarding up our 'broken windows'. Where code was not as we would have liked it, we made sure that everyone in our team was aware - sticky notes were placed on our 'broken windows' board. Even if nothing was done about it, we all knew not to code in that way in the future and the defensiveness (fear) that results from shielding bad code code was eliminated
- Pair programming. We coded a lot in pairs, this helped write better code and also promoted shared ownership (not the ownership of individual egos). It also gave each member of the team a better knowledge of the entire system
- Peer reviews. These had a similar effect to pair programming and we could have done more of these.
- Bi-weekly retrospective meetings. We were working in an Agile environment and the retrospectives at the end of each sprint helped promote the shared goal of improving as a team, and constantly improve we did
Return of the Jedi (conclusion)
There is clearly plenty more to the dark-side in the coding workplace. More sources of anger, many more practices to help eliminate it and more fears. But I think that egoless programming is a fantastic goal to aim for as a team, as is working without fear, anger and of course, Sith lords.
For me, the single most important factor from experience has been strong leadership. Leadership that relieves the wrong kind of pressure from teams while maintaining the drive to produce great software on time. The wrong kind of pressure is always a catalyst for fear.
The title of this post might also be better phrased as, "Code like a [team of] Jedi". What are your experiences of the dark-side at work?