DATA-ORIENTED DESIGN The hardware will thank you.


Follow Data-oriented Design on Google+

Read articles on CellPerformance

Data-Oriented Design book - online beta

FIRST PREV : PAGE 0 : NEXT LAST

Booleans as parameters can be seen as a code-smell 23/07/2012:10:57:26

Boolean parameters are usually used to control code flow inside a function from without. With no further information it should be a simple case of deduction that this is an unnecessary waste of time in almost all cases. If the code flow is meant to be controlled from without, then why not introduce two different functions. If there are multiple boolean switches of code flow, then it's probably true that the callee does too much.

Booleans as arguments are an alternative to having a function do what it says it does. The Ronseal-rule, a very good rule, forbids this.
http://ernstsson.net/post/27787949222/boolean-parameter-elimination