Code Quality Week part 3 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 3: Quality Code is Independent
Code that has high quality means that it is independent.
Take a look at the following example.

The example defines a child that gets hungry when its energy drops below a desired amount. It’ll need to eat to get it’s energy back on track.
This child is independent of whatever feeds it. It could be fed by a caring parent, like the one in the readability example. But it could also be fed by a very cruel parent, that only feeds it when the child is NOT hungry! Or maybe something that is not its parent at all.
The point is that, when reading this class, we do not need the knowledge of other classes to understand how this one functions. It is independent; the complexity is limited to the class itself.
What makes your code independent? Tell us on facebook