Hello coders, today I will teach you something that will help you and your colleagues. This article is the second of a two part series, you can find the first part here. Let’s jump in and learn how to code clean functions! Here are my tips:
Keep it Small
The first rule of the function is that they should be small. How small they should be? There is no hard and fast number for this. But as Uncle Bob suggests it should hardly ever be 20 lines long.
Do One Thing
Functions should do one thing and They should do it well. A function should perform just one responsibility. How can we understand if the function is performing more than one responsibility? If the function is doing the steps that are just one step below the stated name of the function then the function is doing one thing. Otherwise, the function needs some refactoring.

#programming #oop #coding #clean-code #uncle-bob

Clean Code  - Functions
1.25 GEEK