Please enable JavaScript.
Coggle requires JavaScript to display documents.
Functions/Methods (Function Arguments
(Parameters) (The ideal number of…
Functions/Methods
-
-
-
Have No Side Effects
Side Effects - your function promises to do one thing, but it also does other hidden things
Your function shouldn't have any hidden side effects. If you do have hidden operations you should rename the function, however that would violate the Do One Thing rule
Command Query Separation
Your function either should change the state of an object or it should return some information about that object, but not both
To not cause any confusing between changing the state or returning information, use get or set prefix
Do One Thing
- Functions should only do one thing. They should do it well. They should do it only
-