312 reputation
138
bio website
location
age 30
visits member for 3 years, 9 months
seen 2 days ago

Jul
21
answered Why use getters only as opposed to marking things final?
Apr
23
awarded  Famous Question
Nov
7
awarded  Notable Question
May
10
awarded  Scholar
May
10
accepted Is it wrong to use a boolean parameter to determine behavior?
May
10
comment Is it wrong to use a boolean parameter to determine behavior?
The question is not about what is preferable to a behavior determining flag, it's whether such a flag a smell, and if so, why
May
10
awarded  Popular Question
May
10
comment Is it wrong to use a boolean parameter to determine behavior?
Very nice explanation of cohesion and it's application. This really should get more votes. And I do agree with the security issue as well... though if they are all private methods it's a smaller potential vulnerability
May
10
awarded  Good Question
May
10
awarded  Yearling
May
10
awarded  Editor
May
10
revised Is it wrong to use a boolean parameter to determine behavior?
changed language to Java instead of C
May
10
suggested suggested edit on Is it wrong to use a boolean parameter to determine behavior?
May
10
awarded  Commentator
May
10
revised Is it wrong to use a boolean parameter to determine behavior?
removed java tag
May
10
comment Is it wrong to use a boolean parameter to determine behavior?
Rob, would you give some explanation of what Cohesion is and how it applies?
May
10
awarded  Critic
May
10
comment Is it wrong to use a boolean parameter to determine behavior?
I'm partial to your solution as a big Guava lover and evangelist... but I can't give you a +1, because you skip over the part I'm really looking for, which is what is wrong (or smelly) about the other way. I think it's actually implicit in some of your explanations, so maybe if you could make that explicit, it would answer the question better.
May
10
comment Is it wrong to use a boolean parameter to determine behavior?
Thanks for calling out the term "code smell"--I knew it smelled bad, but couldn't quite get at what the smell was. Your example is pretty much spot-on with what I'm looking at.
May
10
awarded  Nice Question