File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Blatant Advertising and the fly likes the case for/against Guard Clauses Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Blatant Advertising
Bookmark "the case for/against Guard Clauses" Watch "the case for/against Guard Clauses" New topic

the case for/against Guard Clauses

M Easter
Ranch Hand

Joined: Feb 11, 2007
Posts: 133
In case anyone finds it interesting... I'm blogging on the case "for" and "against" the use of guard clauses (see as a reference). The blog is at

I've only just finished the case "for" guard clauses but thought I'd post a heads-up.

Personally, I'm against guard clauses but I realize that it's gonna be a tough battle: I'm going against conventional wisdom and fashion.


M Easter
Software Composer -
M Easter
Ranch Hand

Joined: Feb 11, 2007
Posts: 133
FWIW, the case against guard clauses has been posted on Code to Joy.

Please give your feedback! It will help settle a debate between a friend and I...

ps. I wonder if I can post a non-blog-referencing version of this debate on Java Beginner or something. I have chosen this forum since it is an explicit link to the blog.
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11952

I think it might be an interesting discussion topic in either JiG Beginner or Intermediate - I'm just not sure which one. I don't even think there would be a problem with referring to you blog, as long as there was more than JUST a reference to your blog. We like to discuss fun things like this here.

So I say, pick one forum and start a debate.

Note for full disclosure: M Easter and I have known each other for many years in MeatSpace.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: the case for/against Guard Clauses
It's not a secret anymore!