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

WILL: What?

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)!

Fear

A non-exhaustive list of some of my programming fears:

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.

Anger

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.

Hate

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:

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?