PuppyBlender pb = new PuppyBlender();What on earth does that “true” parameter mean? The only way you can find out, given the code above, is to go look at the documentation or source code for the PuppyBlender class.
Puppy pup = new Puppy("Fido");
pb.blend(pup, true);
There's an easy way to write such code without the ambiguity:
PuppyBlender pb = new PuppyBlender();One little extra line of code, and now we've made the purpose of that parameter quite clear. Modern compilers will optimize that variable out, so there's no performance impact at all.
Puppy pup = new Puppy("Fido");
boolean pulseMode = true;
pb.blend(pup, pulseMode);
Just clarity.
Don't know where to leave this comment so I will make it here.
ReplyDeleteInteresting new anti-casino blog started last week:
http://crankyaboutcasinos.blogspot.com/2008/03/introduction.html
Worth a look and a link?
Mike Weber