@khoshtip
As I think you know, the braces aren't needed for one statement of if. Trust the compiler! It's better.
|
The reason I always use braces (even for 1 statement), is because it will save me one day when I add more code.
L B's idea for null statements is better.
Sure, I can trust the compiler, but it's humans that cause problems!! Ideas that we are talking about, are designed to help prevent problems. It's better to prefer methods like this rather than something that might lead to problems.
I don't know anything about Windows & Ctrl-Z. I know this much though -
cubbi does know what he is talking about. If no one has said anything after this amount of time, then I would suggest that he is right.
cubbi seems very rarely to be wrong (if at all), he is a software engineer after all.
@L B
Yes, I can see that the braces are more obvious than the null statement comment. Thanks for that.
My IDE does closing braces, parentheses & chevrons automatically, so I had to train myself
not to type the closing brace straight away, after having done this for the last 25 years. Lisp programming with an ordinary editor teaches one these old techniques.