Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.41 KB

File metadata and controls

40 lines (25 loc) · 1.41 KB

Week 2: Object Calisthenics.

Let's look at the steps needed to read better code

The concepts

9 Steps to improve code readibility

Object Calisthenics are a set of principles intended to help developers write cleaner, more maintainable code. They were introduced by Jeff Bay in his book "The ThoughtWorks Anthology". The rules focus on maintaining simplicity and clarity in code design. They are as stated below:

  1. Only One Level Of Indentation Per Method
  2. Don’t Use The ELSE Keyword
  3. Wrap All Primitives And Strings
  4. First Class Collections
  5. One Dot Per Line
  6. Don’t Abbreviate
  7. Keep All Entities Small
  8. No Classes With More Than 2 Instance Variables
  9. No Getters/Setters/Properties

As illustrated in this article

Reflexion

Which one do you agree and disagree and why? Write down your observation about the steps above by your own experience

Exercise 1: Fight Indentation

Exercise => Head to the /exercise folder to the week 2 - exercise 1 to get the code version

Solution => Head to the /solution folder to the week 2 - exercise 1 to get the code version

Exercise 2: Identify the steps

Exercise => Head to the /exercise folder to the week 2 - exercise 2 to get the code version

Solution => Head to the /solution folder to the week 2 - exercise 2 to get the code version

Go further: CQS Heuristics