Looking through other peoples’ code is fun
September 2nd, 2007I’m playing with the google guice code at the moment. It’s very interesting, and contains some quite neat tricks (although is rather short on documentation so I’m getting very confused). But that’s not what this post is about. I just wanted to share the following fun snippet. :-)
// TODO(kevinb): gee, ya think we might want to remove this?
private static boolean allowNullsBadBadBad() {
return "I'm a bad hack".equals(
System.getProperty("guice.allow.nulls.bad.bad.bad"));
}
September 2nd, 2007 at 8:38 pm
BUSTED!!!!!
damn!
but we really can remove it for the next release. whew. :)
September 2nd, 2007 at 10:17 pm
Out of curiousity, what’s it for (I mean, I think I see what it does, I just don’t see why it’s needed)? I was too busy trying to figure out how to do what I wanted with the rest of the code to follow up. :-)