Khan/live-editor

If Else and other statements

Closed this issue · 4 comments

Why does Oh Noes need a block statement after if, else, etc.
I find it a bit annoying because most of my if statements only have a single statement after them :(

Yes, as Dalendrion says, it helps new programmers to learn good habits and write less-error-prone code by forcing them to write their if blocks with curly statements. It's so often that I've seen a new programmer add an extra line to a single-line if, not realizing it's not actually inside the if.
I'm closing this issue, since it is working as intended.

Don't worry:
I found I could get around it in my code by using
//jshint curly:false

This is still open, but could be closed...