2 ms·
I don't find commas at the end of line adding any more readability than avoiding them, except for the oneliner counter case. JavaScript has optional separators
by jeroenhd 2y ago
I don't find commas at the end of line adding any more readability than avoiding them, except for the oneliner counter case.
JavaScript has optional separators (semicolons) with some rules to avoid ambiguity. Not everyone like it (I use semicolons in JS unnecessarily because I can't be bothered to learn the three edge cases they're not optional). I think there's something to be said for "commas are optional except in oneliners".
Languages like Go describe structs without commas. It took me some getting used to, but it's really not more or less readable in my opinion.