Tuesday, 13 December 2005

Simplicity, comments and refactoring

David Crow posts an article about Simplicity Rules . I like number 10:

Simplicity is about subtracting the obvious, while adding the meaningful

It reminds me of removing obvious comments from code and refactoring code to make it meaningful and self-documenting.

Here are Kent Beck's criteria for evaluating the simplicity:

  1. Appropriate for the intended audience : No matter how elegant a solution is, if the people who need to work with it don't understand it, it isn't simple for them. Do the simplest thing that works for the audience.
  2. Communicative : Every idea that needs to be communicated should be represented in the solution. The code should express the programmer's intentions and should communicate to the readers.
  3. Factored : Do something once and only once. There should be no duplication. Duplication of logic or structure makes code hard to understand and modify.
  4. Minimal : Working within the above 3 constraints, the solution should have the fewest elements possible. If you ain't gonna need it [YAGNI], don't do it. Fewer elements means less to test, document, and communicate.



Tags: agile
Posted by Simon Baker - Permalink

Creative Commons Licence

preload call-us-on.png preload chat-over-coffee-on.png preload coffee-cup-on.png preload guspower-avatar.png preload simonbaker-avatar.png preload email-on.png preload meet-the-crew-on.png preload about-on.png preload bits-on.png preload blog-on.png preload coaching-on.png preload consulting-on.png preload crew-on.png preload home-on.png preload software-on.png preload other-talks-on.png preload phone-on.png preload previous-talks-on.png preload boost-icon-on.png preload jumpstart-icon-on.png preload liftoff-icon-on.png preload powerup-icon-on.png preload skype-on.png preload speech-bubbles-on.png preload creative-commons-on.png preload slides-on.png preload video-on.png