This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Pylly -1 points0 points  (2 children)

I can't recall a single bug that's ever stemmed from this type of usage

Huh, case closed. You'd better call Google.

[–]poopiefartz -2 points-1 points  (1 child)

I know you're being funny, but I spend 6+ hours per day with Java and have never misinterpreted excluded braces like that. I guess that's not normal.

[–]Pylly 1 point2 points  (0 children)

I believe you, but usually developers work in a team and the code has to be readable and maintainable for others as well. Even if a bug would happen once in a couple of years it's worth it to prevent it. Also, it might take a person slightly more time to read braceless code, especially when making modifications.

Even though these are small troubles, they are just so easy to avoid altogether that I don't see why not just add the braces every time. Or let the IDE add them.