Rule of Simplicity | Glossary

Definition:

Kent Beck while developing Extreme Programming (XP) came up with rules of simple design. He recommended that developers should do the simplest thing that could possibly work. Simple code means you’re travelling light – low up-front investment, and not much to slow down when things needs to change. Simplicity is being recognised as one of values in XP, where programmers are encouraged to start with simplest solution which helps them to focus on designing and coding for the needs of today instead of tomorrow.

Rule of Simplicity

  1. Pass All Tests
  2. Clear, Expressive & Consistent
  3. Duplicates No Behaviour or Configuration
  4. Minimal Methods, Classes & Modules

With these rules, we can judge whether the code developed is simple enough. What we can derive is to think about what is most important, the code should work, pass all tests. The next most important thing is that the code should be easy to understand, therefore we need to ensure that it expresses every idea  with clarity. Even though the code works, we need to consider maintainability, see to that there is no duplicate code. This minimises cost and maximise benefits over the lifetime of the software.

Further Reading:

Book: Extreme Programming Explained: Embrace Change by Kent Beck
Book: Understanding the 4 Rules of Simple Design by Corey Haines
Book: Understanding Software by Max Kanat-Alexander
https://en.wikipedia.org/wiki/Extreme_programming
http://wiki.c2.com/?XpSimplicityRules
https://martinfowler.com/bliki/BeckDesignRules.html

CRC Cards | Glossary

Definition:

CRC Cards was originally proposed by Ward Cunningham and Kent Beck as a teaching tool, brainstorming tool used in the design of object-oriented software. CRC card is Class-Responsibility-Collaboration card, popular among expert designers and recommended by extreme programming supporters.

CRC cards are index cards, which are used by team members to write relevant class/object of their design which are partioned in threes areas. Class Name on top of the card, with Responsibilities of the class in the left and on right list of other collaborators (classes) with which class interacts to fulfil its responsibilities.

Advantage of CRC cards are, it keeps the complexity of the design at a minimum on a small card where designers focuses on essentials of the class, preventing them to getting them into details and implementation. These cards are portable and can be easily laid out on a table and re-arranged  while discussing a design. You create a CRC card by writing out a scenario which identifies the actors and actions which the actors do. Nouns should turn into the classes of the card, verbs typically turn into the responsibilities of the card, and collaborators are the other cards  with which the card will be interacting.

Further Reading:

Book: The CRC card book by David Bellin
https://en.wikipedia.org/wiki/Class-responsibility-collaboration_card
http://agilemodeling.com/artifacts/crcModel.htm