Blaine tells us Don’t use null or -1 in your unwritten methods, and I have to agree. He's pointing to Tim Bray's error in unit testing.
I have to say this is a great idea, and should be used by everyone. That is, instead of returning null or -1 for an unimplemented method, you should throw a RuntimeException ("Method has not been implemented"). Even better would be to create your own UnimplementedMethodException and throw that.
Good stuff to read for breakfast!
Tech briefs and notes by Jeff Sheets
Friday, January 21, 2005
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment