WorksheetsClean Code
Total questions: 8
Worksheet time: 4mins
Which is NOT a rule for meaningful names?
Distinctive
Short
Pronounceable
Intention Revealing
A function should...
Perform as many tasks as possible
Have elaborate comments to explain what it does
Be short, not complex and do one thing
Have a short name
Switch statements should...
Contain all the implementations
Never be used with constants
Be used as much as possible
Call functions that contain the implementations
Comments...
Can be used when names are not meaningful
Should be added before every function
Should be replaced with self explanatory code
Make up for bad code
Formatting is all about...
Being petty
Communication
Performance
Security
Why should code lines be short and indented?
To keep the code well organised
For better performance
So they'll do only one thing
To reduce cognitive complexity
Which is NOT a code smell?
Agility
Rigidity
Opacity
Fragility
A clean code looks like it was written by...
Someone else
That guy from accounting
Uncle Bob
Someone who cares
