DEV Community

loading...

Discussion on: Semicolons in JavaScript: To Use or Not to Use?

Collapse
somedood profile image
Basti Ortiz (Some Dood) • Edited

Personally, I write all of my code with semicolons. Not only because I have grown used to it, but it's also more readable for me because I don't have to think about where statements end. There's just this subconscious part of me that can't interpret code unless there are semicolons. It's analogous to how difficult it is to read a paragraph without proper punctuation, particularly the period.

But then again, that's only my opinion. That's simply how my brain works. We all have different ways of thinking. Using semicolons should not only be a matter of style and consistency but also a matter of lessening the cognitive load of programmers for the sake of productivity and overall happiness.

Collapse
zyzmoz profile image
Daniel Cunha (he/him)

I totally agree, using semicolons make you code more readable! Maybe, in case of new developers, it is just a matter of get used to it!

Collapse
brigittavarga profile image
Brigitta Varga

I agree with this, I also use semicolons every time. I guess I‘m also used to it, but also because (to me for sure but I think also for others) it‘s more readable.

Collapse
adriennemiller profile image
adriennemiller Author

I agree! Coming from Ruby, I find the semicolons and parenthesis in JavaScript comforting and helpful for readability.