It ain’t easy to be simple
Monday, July 31st, 2006Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away (Antoine de Saint-Exupery)
Everything should be made as simple as possible, but not simpler (Albert Einstein)
What do these quotes, the Rube Goldberg machines, Occam’s Razor and the KISS principle have in common (Google and Wikipedia keep impressing me what you find by just searching for a simple little word)?
Well, they are all about SIMPLICITY (or lack thereof)!
Simplicity is also a central tenet in software engineering and development.
I’ve seen really great pieces of software that unfortunately were complex and awkward to use. I’ve seen classes that were simple to use, but that had so many different responsibilities that they were hard to understand and maintain. I’ve seen design rules that were supposed to make implementation for the programmers as easy as possible, but resulted in a big pile of overly redundant code (this is also not simplicity).
Simplicity is all about reducing this complexity as much as possible.
In software engineering, this principle should be applied wherever and whenever possible.
When designing and implementing, the class’s internals should be simple (not too much responsibility for a single class - this is where high cohesion comes into play), but also its interface should be simple (the Spring guys, for example, are doing a great job wrapping and simplifying complex third-party classes and components).
But this is also true for a system’s architecture. System components should be as simple as possible, resulting in probably more, but simpler components.
And last but not least, simplicity also makes sense for processes - the build process and the development process (I don’t want to use the agile buzzword here … oops, too late).
I think a good metric is, how easy it is to describe a component. If you can say in a few sentences, what a component does, then it is probably simple enough. This applies to classes, but also to system components or subsystems.
And a final note: the goal is avoiding complexity, not negating it.