Why you should enforce Dangling Commas for Multiline Statements
Nik Graf
1.3K22

I’ve been involved in the web development for nearly 10 years. And with all due respect, I strongly disagree with “enforcing dangling commas.”

Not only for Javascript, but for any kind of language in the world — those all develop as time goes by. Rather than being considered as some set of calculated rules, concrete science or an efficient methodology, linguistics are always viewed as an art. That means, each language should focus on its look and feeling first in order to survive.

Nobody would disagree with the fact that “trailing commas” are ugly enough. Is it efficient in terms of Clean Diffs and Code Manipulations? Yes, looks like it. However, the overall effort spent on the no-trailing-comma development is no way close to the pains that we receive from syntactically incomplete, emotionally unstable, theoretically deficient trailing-comma technique. Looks cleaner in git? Who cares? Nobody gives attentions to such two-line changes. We developers are built to ignore it.