What is code quality ?

So starting the new jobs has given me the opportunity to take a fresh look at software and how it should be approached.

One of the questions that I have been pondering on alot is “What is code quality ?”  Is it code that’s well documented ? Is it code that follows some sort of coding convention, code that is uniform throughout ? Well named variables ? Test cases ?

Obviously we all have our own perceptions, but in order to write good software I think its important to look at code from multiple perspectives, in order to do this I need your guys feedback!

Please tell me what you think makes good code ?

5 Comments

RickusSeptember 11th, 2009 at 00:12

That’s easy -

Good code is code that behaves itself :)

Dave TapsonNovember 25th, 2009 at 16:40

This is one of those personal things – what one person thinks of as quality code, another reviles.

Personally I think it’s dependent on the environment – for corporate code I go for simplicity over clever complexity, comments that describe what the code is supposed to do (as opposed to what it does) and a convention that is not too verbose. With a convention should come uniformity.

In something like a skunkworks, things can be different – one does not need to be quite so pedantic as hopefully experienced and enthusiastic developers will have some sense of responsibility towards the code base / other developers.

Nic WillemseDecember 1st, 2009 at 07:40

What about a good understanding of the paradigm ? it’s all to often I have seen typical procedural code in an OO paradigm. Does this not constitue bad code ?

Rick TonoliDecember 1st, 2009 at 09:19

How about this as a start: Good code is (amongst other things) code that any developer of equal experience, and no previous exposure to the code or business, can understand by simply reading it?

MichaelJanuary 12th, 2010 at 08:45

For me code quality is made up of a number of criteria and not just one thing.

->Does the code solve the business problem
->Elegance of the solution (can the developer explain the design decisions)
->Is it understandable by someone else
->Is it unit testable

and more…

Leave a comment

Your comment