Link Details

I'm serious! Boolean parameters can be evil because they don't communicate their purpose (or make it harder to understand the purpose of the methods using them.) The problem isn't really understanding a method signature. After all, we can give the boolean parameter a decent name and we can also add a Javadoc comment. For example

Posted by bloid  |   Nov 15 2007 / 16:55

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Comments

User 231279 avatar

wanghy replied ago:

In IE, the dzone widget in the blog post shows "3 votes down" and in FireFox "3 votes up"...there might be a bug in the dzone widget

Reply 0 votes
User 209464 avatar

willcode4beer replied ago:

the comments in this one are worth the read

Reply 0 votes
User 169096 avatar

fijimf replied ago:

The comments are not worth a read. Nor is the post. Really.

Reply -3 votes
User 134694 avatar

alruiz15 replied ago:

Wouldn't it be helpful to know why the post and/or the comments are not worth a read?

Reply 0 votes
User 189024 avatar

kieronwilkinson replied ago:

The article makes an excellent point. A nice simple solution for better code readablity.

Reply 0 votes

Recommended Links

Scala
Written by: Ryan Knight
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Play
  3. Akka
  4. Debugging JavaScript
  5. Design Patterns
  1. Apache Hadoop
  2. REST
  3. Java
  4. Git
  5. Java Performance
Connect with DZone