Hacker News new | past | comments | ask | show | jobs | submit
Sorry, but I did not "forg[e]t a comma after the last item". I intentionally did not put a comma there. The list of the "important numbers" in my example is already complete and perfect, and is not supposed to ever change. I wanted to emphasise this fact by specifically omitting the comma there, in the hope that intelligent people in the future would get this message exactly as I intended for it to be.
I think all of us have worked on code that other people thought was perfect or will never change. Personally I love this rule because it saves me from looking at one extra commit (adding the comma when the next value gets added) when I'm trying dig through line history.
The trailing comma rule is to avoid errors when devs copy/paste a line or dump a new line at the end. This matters particularly for arrays in languages with implicit string concatenation, where the missing comma won't trigger a compile error.
loading story #49060056
You will find that pretty much every rule we have in any possible context will have some exceptions that are justified under some conditions.

Taking that as a reason to not have those rules in the first place seems like a logical fallacy that intelligent people should not make.

Must be nice to write code with the hopes that only intelligent people will read it.
[flagged]
loading story #49061106