Code Quality Week part 8, the finale

This week we at Little Chicken are celebrating code quality. Resident Developer and Code Quality Guru Joris Van Leeuwen penned eight byte sized posts on this subject. Each day will see a new post on this subject.

PART 8: Quality Code is Structured

Code that has high quality means that it is structured; it’s easy to understand because its structure makes sense.

Let’s do a quick scan over the following example:

PART 8: Quality Code is Structured Code that has high quality means that it is structured; it’s easy to understand because its structure makes sense.  Let’s do a quick scan over the following example:

Not a code example this time! This chart represents a set of classes, we start off with the world class. A world has a set of cities, which each has one zoo. Each zoo has a set of animals, which can be either a bird type of fish type; sharks, ducks and maybe even more.

This set of classes is simple, because the hierarchical layout makes sense. No arrows are drawn in a nontrivial direction.

Structure does not stop at class associations. We can also put structure in the way we order the methods in our class. In the way we organise our script folders and where we decide to use a namespace. Good structures are easier to remember and allow us to focus on what really matters.

What makes your code structured? Tell us on facebook