How can managers get high quality code from their programmers?

Quality Code

I’ve worked as a programmer for the last 15 years in many different environments, chilled out, busy, noisy, quiet and so on. These are some of my reflections on what produces good code.

What I want to do is write good quality code. After all, that’s what is going to keep my clients happy and get me paid.

There are lots of things that go into good quality code that can be measured, things like code formatting, code meeting certain useability tests and code being delivered within a certain period of time.

Then there are things which are more subjective. Those are things like code that is organised, code that flows, code that is easier to update or maintain. Often, code that is of high quality is code that has multiple and sometime opposing qualities. Code that is organised but has no other quality may suffer from an over complicated or rigid structure. Code that is organised but at the same time simple will have enough organisation to suit the purpose it was intended, not too much, not too little.

Then there is code which fits all the quality objective and subjective criteria but somehow it turns out that the coder has forgotten the end user of that code.

It is this last one that often undermines what could be good quality code and causes managers headaches. This can be a project manager’s headache, the highly skilled but somehow disconnected coder.

And it is the state of mind of the person who is producing that code that is the main topic of of this blog. Coders talk about ‘the zone’ or ‘being in the flow’ when they are writing good code. Of being aware of the big picture behind the code and at the same time being able to produce good details.

Every line of code ever written, directly or indirectly is produced by a human body with a mind attached. Being in the zone is the ability to be with your body and your mind at the same time. It’s being able to be with the highly abstract thought processes that are the act of writing code without becoming disconnected from yourself and the environment which is producing that code in the first place.

What produces ‘the zone’ for coders? Well, there’s lots and lots of variation in that because everyone is different. For every coder who needs silence to get there, there are others who find it while having their favourite German heavy metal band on in the background. Some love the give and take of the open plan office, others find their flow severely disrupted by being around other people.

Ideally, there would be a discussion about what was best for any particular coder and the organisation that is paying their fee.

In my experience, this discussion rarely happens and when it does, it revolves around the perceived needs of the organisation. It usually happens at the time the coder is hired and is generally a reactive one, it’s about what happened in the past being prevented in the future.

Is it possible to have a discussion about this which facilitates high quality code and also meets the needs of both coder and organisation? Of course, this happens all the time. Here’s what I think needs to be on the table

  • What are the requirements of the project / work? If this isn’t understood by either then it’s very difficult to get to the next part.
  • What are the needs for connection and contact for this project / work? Every project needs a connection between the coder writing the code, other team members, project managers and the customer for the code. How often does there need to be a connection and how long?
  • What’s the best way to maintain positive feelings of respect, connection?

In fact, it doesn’t really matter what the topics are as long as there is a discussion.

What’s your experience of managing or recruiting coders when it comes to getting a high quality result?