Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@PublicByte yaa! Agreed!
I had an argument on this with my mentor! So Hopefully it's under correct section! -
C0D4669025yThey are optional, but you are then relying on the JS engine to insert them accurately for you.
The compiler or engines job should be to compile you're code, not rewrite it so it actually works - but that's my opinion.
99% of the time it will get it right and you will forgot about that 1%, but then you're going to bitch about that 1% for days when you do manage to have the compiler throw errors because you forgot the ; for that handful of places you actually needed it.
Also, adding a semi colon at the end of the line is generally required by other languages. So for anyone who works across multiple languages it becomes pretty standard and habit to add them anyway. -
Root797615y@C0D4 They're only required in two places: before IIFEs and array/json literals.
Personally I think JS looks cleaner without semis, but that's just personal preference. -
C0D4669025y@Root I don't mind JS without them, but it comes down to preference and since I jump between php, js, and java on a daily basis, the semi colon haunts me in most of my work 👻
-
I prefer semi-colons, but also don't really care and go with whatever the code standards are with the expectation I can lean into the linter for auto-fixing.
Related Rants
-
AlgoRythm25Dude chaining in JavaScript is so fucking ugly but so trendy. thing.doStuff().doThing().then().doMoreStuff()....
-
netikras14No, listen to me. I cannot approve this PR because your code does not comply with our code style. All the impo...
-
Coffe2Code7Let's comment out this block of code so later we know we have this feature and bring it back if we need it. L...
To put Semicolon in JS;
rant
wk190