Writing Functions
Posted on 24 Jun, 2019
Got to learn some new points regarding functions() in CleanCode.
Functions should be small.
They should do one thing only.
FUNCTIONS SHOULD DO ONE THING. THEY SHOULD DO IT WELL. THEY SHOULD DO IT ONLY.
To know if a function is doing more than "one thing" see if you can extract another function from it with a name that is not merely a restatement of its implementation.
Function arguments should NEVER be greater than 3.
We should never ignore any part of code.The parts we ignore are where the bugs will hide.
PS : I have been reading CleanCode for a while & logging what I learn here.
Last updated