Echo JS 0.11.0

<~>

chris-l 2431 days ago. link 2 points
> const does not imply any kind of immutability of the value itself, it only implies immutability of the binding.

So you expected that `const` did the same work as `Object.freeze`?

Since in the post he never mentions Object.freeze, maybe he doesn't know about it?
pselviakcay 2432 days ago. link 1 point
And here is yet another developer having hard time understanding the difference between references and values. 

Putting f**ks around statements of common knowledge and ranting doesn't make anything entertaining.
amitport 2432 days ago. link 1 point
I'm pretty sure he understands the difference... he's just saying that if it doesn't make the object immutable then it is not that useful.

(I disagree with him. I think minimal variables reassigning makes code easier to understand and 'const' helps to encourage that)
pselviakcay 2432 days ago. link 2 points
But he thinks that is not intuitive. It is intuitive as f**k is all I'm saying. It sounds ridiculous when you make something that fundamental as a base for your rant.

"So you wake up every day and think that you can go on forever? NOPE! We all die in the end! F* that sh**!!"
jaleksic 2432 days ago. link -1 point
Well const does not make objects immutable, only primitive values. It's that easy ^^
timoxley 2432 days ago. link 2 points
more accurately, only the reference is immutable. Nothing special happens that changes how const works with primitives vs objects.
gotofritz 2431 days ago. link 0 point
I totally agree with the general feeling of the article, and I like the suggestion to only allow const / disallow let at the top level 

I find that I often write a function which manipulates, say, an array with push or shift. Then I want to change the algorithm to use concat - oh wait I have to change `const arr = ...` to `let arr = ...`, because that's how concat works. It seems ridiculous
kirilloid 2423 days ago. link 1 point
You just need to spread on push—it accepts multiple arguments.
ianwalter 2432 days ago. link -1 point
Honestly, I was ready to disagree with him but everything he said is (probably) true. I think it might have been easier to read if he presented his main point upfront: don't set up linters to cry fowl when using let instead of const or automatically convert to const.