posted 13 years ago
here's another way to do it:
since you don't do anything different if a >= b, it's just like doing nothing at all
On a more serious note, if you have to do something like this, i would always go with the latter. it is EXTREMELY easy to overlook that semi-colon later on when you come back and decide you DO want to do something when a < b. If you put in the braces now, it's relatively trivial to drop in your new code.
If you don't, odds are high that at some point, you will come back, add the braces, overlook the semicolon, and pull your hair out for a while when your code doesn't work how you think it should.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors