Monday, March 29, 2010

Flag Arguments & Clean Code

Flag 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 one thing if the flag is true and another if the flag is false!


--Clean Code by Robert C. Martin

No comments:

Post a Comment