Code Quality Week part 4 of 8
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 4: Code is Comprehensible
Code that has high quality means that it is comprehensible.
Take a look at the following example:

A simple interface for a television set. It has a channel and a volume, you can turn it on/off, change its channel and its volume. Notice how I defined the interface as “simple”.
I always envision a class or an interface as a television remote; when there are too many buttons I simply cannot comprehend all of its functionality. This is true for classes and methods as well.
Classes and methods that get too big are hard to wrap your head around. Adding functionality or localising a bug is difficult because there is so much going on! It’s usually because the class or method has too many different responsibilities. To write quality code you’ll need to divide them into smaller ones, so you can isolate their complexity.
What makes your code comprehensible? Tell us on facebook