Friday, October 17, 2008

Silly String

Coworker 1: Should the code check whether the value equals null, or should it check if it equals the empty string? Or both?

Coworker 2: It should check whether it equalsIgnoreCase the empty string.

Me: Right, because that way it still works even if the user had Caps Lock on when they typed in nothing.

No comments: