DEV Community

Discussion on: How do you order your functions?

Collapse
 
eljayadobe profile image
Eljay-Adobe

"...no semi..." as in no semicolons?

I use JavaScript Standard Style, which omits optional superflouous semicolons.

Ever since Douglas Crockford called Bootstrap's omitting semicolons "That is insanely stupid code. I am not going to dumb down JSMin for this case." I was convinced that omitting optional superfluous semicolons was the right thing to do. Then, reinforced after Brendan Eich agreed with Douglas Crockford in spirit and tone regarding semicolon omission as poor style.

Right or wrong, automatic semicolon insertion is part of the language, and has to be taken into account for both those in favor of putting semicolons in explicitly, and for those in favor of omitting semicolons where possible which means that are inserted implicitly.

The "where possible" is the crux of the matter, and can burn both sides.

Semicolons in JavaScript are not optional. When omitted — where it is possible to omit them — they are implicit, and automatically inserted for you.

Being aware of the edge cases where they are needed is the important part.