r/javascript • • Oct 24 '16

help The only thing I hate about const ...

... is that it is 5 chars long.

For some reason, let with its 3 chars, looks more elegant.

7 Upvotes

49 comments sorted by

View all comments

-2

u/kevinkace Oct 24 '16

Agreed, for primarily aligning single const declarations, eg:

let thing1 = "thing1",
    thing2 = "thing2"; // nicely aligned

const thing3 = "thing3",
    thing4 = "thing4"; // like this with standard 4 spaces?

const thing5 = "thing5",
      thing6 = "thing6"; // or like this to align?

8

u/konbit Oct 24 '16

If you work in a team using git this is a horrible idea anyway. I can't count the amount of times code has broken after a merge because of this stupid pattern.

-8

u/kevinkace Oct 24 '16

Then you suck at merging.

4

u/adavidmiller Oct 24 '16

That's kind of the point. You shouldn't depend on people not sucking if you don't have to.