paint-brush
An Open Letter to JavaScript Leaders Regarding No Semicolonsby@WebReflection
14,652 reads
14,652 reads

An Open Letter to JavaScript Leaders Regarding No Semicolons

by Andrea GiammarchiFebruary 5th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Let’s be honest and face it. If you need <a href="http://standardjs.com/rules.html#semicolons" target="_blank">an entire section</a> to explain what could go wrong and what are the special cases you need to fix, you might as well stop telling the story that enforcing semicolons is <em>FUD</em>, because enforcing no semicolons is even worse.
featured image - An Open Letter to JavaScript Leaders Regarding No Semicolons
Andrea Giammarchi HackerNoon profile picture

one of many developers bitten by the rule

No semicolons has side effects.

Let’s be honest and face it. If you need an entire section to explain what could go wrong and what are the special cases you need to fix, you might as well stop telling the story that enforcing semicolons is FUD, because enforcing no semicolons is even worse.

The semicolon or semi-colon[1] (;) is a punctuation mark that separates major sentence elements. A semicolon can be used between two closely related independent clauses, provided they are not already joined by a coordinating conjunction. — Wikipedia

As simple as it sounds, using semicolons is a single, semantically correct, rule to remember, that will never fail your expectations as developer.

And if you want to be that good developer that doesn’t fall for FUD, you know already what sentence is going to follow this paragraph, don’t you?

If a feature is sometimes dangerous, and there is a better option, then always use the better option. — Douglas Crockford

So how come among experienced and ultra-opinionated developers there’s even a debate about this, and even worst, a need to enforce such rule?

Where is your focus ?

Do you really want to pay attention to not even so edge cases like these?

the semicolon way is always consistent

Moreover, where is code style consistency? Why cannot developers just write JavaScript that works? Are we sure people using a side-effect prone code-style aren’t actually those feeling a bit too clever about their code?

And how can be considered even logical that a linter rule is telling that a counter-linting rule as “always semicolons” would have “less easier to notice” style? Isn’t the whole point of a linter to bring developers to put attention to what they didn’t notice?

So how come with this no-semicolons rule developers are not alerted about the possible issue and documentation needs to explain how to solve that?

If I understand correctly, my conclusion is that we have a stubborn rule with side effects that is not solved on tooling world. How professional is that?

But “we using semicolons” are those too clever, right?

is it clever at all to avoid semicolons?

A Nobel intent with arrogant results

If your main logo, your name, and your ideas, are sold as Standard, you really must have some gut to talk about other developers FUD.

Standards are defined by specifications, not opinions!

But despite the unfortunate choice for the name and the project logo, it is good to agree across developers about some de-facto standard rule to adopt.

The problem here, is that nobody agreed on this one, but many bought it.

Please drop the FUD about no semicolons

I’m not asking to this project to do anything but change its rule about this side-effect prone choice about semi colons.

The whole project seems to be focused on explaining why no semicolons are fine, but new comers might fall in all the actually common edge cases that really shouldn’t need to be explained and shouldn’t exist in the first place.

I understand many from Ruby or Python came to JS and thought it’s bad, ugly, pointless language and “yada yada”, but when I’ve learned other PLs, before or after JS, I’ve tried to learn first all possible error prone patterns and as result, I often unlearned from previous languages to embrace the new PL way and its specifications.

As summary: since there is documented evidence of side effects without semi colons, can we please change the rule and the mindset about this topic so that anyone can decide if they want to adopt always semi colons, never semicolons, or sloppy semicolons, for the sake of programming robust code?

’cause I’ve always thought that’s what developers should do, instead of finding issues that didn’t exist.

Thank You!