The Robert C. Martin Clean Code Collection (Collection) (Robert C. Martin Series)
Rate it:
Open Preview
Kindle Notes & Highlights
10%
Flag icon
FUNCTIONS SHOULD DO ONE THING. THEY SHOULD DO IT WELL. THEY SHOULD DO IT ONLY.
11%
Flag icon
The ideal number of arguments for a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided where possible. More than three (polyadic) requires very special justification—and then shouldn’t be used anyway.
11%
Flag icon
arguments are ugly. Passing a boolean into a function is a truly terrible practice. It immediately complicates the signature of the method, loudly proclaiming that this function does more than one thing. It does
11%
Flag icon
one thing if the flag is true and another if the flag is false!
12%
Flag icon
In general output arguments should be avoided. If your function must change the state of something, have it change the state of its owning object.
12%
Flag icon
Functions should either do something or answer something, but not both.
13%
Flag icon
The proper use of comments is to compensate for our failure to express ourself in code.