DEV Community

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

Collapse
 
somedood profile image
Basti Ortiz • 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
 
adriennemiller profile image
adriennemiller

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

Collapse
 
hasnaindev profile image
Muhammad Hasnain • Edited

This is a stylistic choice. Someone coming from a Python background won't use it. I've worked on codebases from large companies that DON'T use semi colon and I have no issue with the readability because code readability has nothing to do with semi colons and everything to do with the "good code/bad code" philosophy.

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.