5 ms·
The informal and single easy rule is to prefix lines that begin with punctuation with a semi. In practice only [ and ( crop up, almost nobody begins lines with
by sjs 15y ago
The informal and single easy rule is to prefix lines that begin with punctuation with a semi. In practice only [ and ( crop up, almost nobody begins lines with a prefix increment or decrement. If you use += 1 and -= 1 instead you sidestep that case.
- felipemnoa 15y agoOr, you could just add a semicolon. KISS at work.
- sjs 15y agoThat's perfectly fine as long as you're honest about why you do it. Most people here are misinformed.
- einaregilsson 15y agoYes, you could just add a semicolon in front of lines that start with punctuation (tiny percentage of all lines) or you could just stick them at the end of every single line...
- eropple 15y agoYes, you could put them at the end of every statement. Because consistency is a good thing.
- einaregilsson 15y ago@eropple: So you put semicolons after every line? Even after block statements {} ? Why not, if the goal is to be consistent?
- burgerbrain 15y agoYou should use the reply button.
- einaregilsson 15y agoIt wasn't visible for me on that one comment. I don't know why, I thought it was too deply nested or something, but now I see it. Weird.
- sjs 15y agoThe Reply link doesn't show up for a minute or two. I guess it's supposed to force you to think instead of firing off a hasty response. Kind of pointless for one liners but hey...