Monday, May 11, 2009

Comments are not comments unless they are comments

The concept of comments is clear to everyone, so it would seem. We developers use them all the time to comment-out code that we'd like to skip temporarily, to better document our intentions. Comments are just plain old descriptions, inactive elements in the code. So it would seem...

Apparently the creators of Facelets didn't think that this is the case. Once you comment out a piece of code (again, for whatever reason) it does not mean it is actually not running!

Some one brave enough decided that the default behavior of comments should be the one of the ordinary template, meaning all the elements that are active (so to speak) are still running! All the references to beans, all the references to resource bundles and what have you are still being used to produce a nice comment!!!

There's of course an option to turn this insane behavior off (facelets.SKIP_COMMENTS) but the default behavior might give you a nice head spin.

1 comment:

  1. Rick Hightower posted an article about how good facelets fits JSF at http://www.ibm.com/developerworks/java/library/j-facelets/.

    I wonder if that's the boxing glove that gave me a nice spin today.

    ReplyDelete