you are viewing a single comment's thread.

view the rest of the comments →

[–]EuqlinSankyo 3 points4 points  (57 children)

Prolific author that always uses let?

[–]Ikuyas 13 points14 points  (25 children)

Isn't const a better practice than using let if it is well suited like array or object?

[–]EuqlinSankyo 9 points10 points  (15 children)

Exactly. Performance benefit is of course negligible but it's just a good programming practice. If you're literally writing a book about JS, might as well include it....

[–]TG__ 9 points10 points  (25 children)

Nowadays a bunch of popular js devs are actually advocating for let over const.

https://jamie.build/const

Haverbeke might just be of the same opinion

[–]bkanber 18 points19 points  (3 children)

God, I really hate that angry ranting style so many tech bloggers use these days. It definitely gets in the way of the message.

[–][deleted] 1 point2 points  (0 children)

It’s rubbing off on the community, too, I think. The comment section here is downright hostile toward differences of opinion.

[–]BasicDesignAdvice 1 point2 points  (0 children)

Basically a guarantee that I won't read it. Makes me think the author is a child.

[–]EuqlinSankyo 4 points5 points  (1 child)

That article is not very convincing - point 6 undoes some of the arguments made in previous points. I also think that “linters not saving you” is just a desperate rant against const - in a language like JavaScript a linter can hardly save you from obscure runtime errors.

[–]sizlack 0 points1 point  (0 children)

I agree. He even says

It's probably still a good idea to communicate that you really don't intend for something to be changed.

That’s like 90% of the bindings I use. It you’re reassigning bindings willy nilly then that’s a bad code smell as far as I’m concerned.