8
balte
7y

My cs program at university forces a style "guide", but the best thing is, in order to comply you'd have to rewrite all the default classes. Because apparently, an if statement followed by a single statement needs curly braces.

You'd think these fuckers would know what they're talking about...

Comments
  • 10
    Not to be picky (and I'll probably get shot down for this) but I actually prefer braces after an if statement regardless of the number lines. It makes it much easier to read the code and avoids potential logic errors. I do the same regardless of the language.
  • 1
    @Jonnyforgotten so far, you are not the one getting shot down. that's me.😋

    I personally think that it bloats the code a lot, but I do comply with whatever the project currently uses. (or in this case the style guide)
  • 2
    I prefer the braces for single line statements, too. It is not as easy to destroy when you rearrange lines
  • 2
    I also used to prefer no braces for single lines if statements, but with time I have realized that you don't know when you will have to add more lines, so now I just add the braces
Add Comment