Small Talk on
clean code principles
Agenda of the meet:
➔ My intro
➔ Why do we need clean code ?
➔ Exploring CC with an example
➔ Resources
➔ Queries
● My Intro
● Why do we need clean code ?
"Any fool can write code that a computer can understand.
Good programmers write code that humans can
understand."
– Martin Fowler
Exploring Clean Code with an example
Sample
code
An
attempt
to
make it
cleaner
Let’s make functions !
SwitchOn Vs IsSwitchOn
SwitchOn = true
There can be two possible questions
1. switch needs to be switched On
2. The switch is already On
IsSwitchOn = True
How many meanings does this convey ?
→ Name booleans in question format.
Changing boolean variable FLAG
Let’s make functions -2
Resources
Clean Code by Robert Cecil Martin
The Art of Readable Code by Dustin Boswell and Trevor Foucher