Thanks for the post. I use const only for constants in top-level scope like const URL = 'https://example.com'.
For other scenarios I prefer to use let. It's just annoying to change const to let every time you need to make a variable mutable.
This post by TC39 committee member Jamie Kyle is rude, but resonates with my view on let vs const battle.
I'm not sure I can fully agree with Kyle. Most of his points are fair, but the main goal of const is to communicate intention. Yes if I didn't reassign my variable, then I intend on it not to change. Later on when I come back and want to change it that's fine, I just know that it's not being changed currently so I can be more aware of that.
Full stack web dev.
Studying FP web development approaches, while helping Mission Bit create paths to programming for underserved public school kids.
Previously @ Gradescope.
Why am I not surprised that someone like that is on the language committee? (I'd say JS culture is basically worse is better, but somehow its movers and shakers manage to screw up even that up.)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the post. I use const only for constants in top-level scope like
const URL = 'https://example.com'
.For other scenarios I prefer to use
let
. It's just annoying to changeconst
tolet
every time you need to make a variable mutable.This post by TC39 committee member Jamie Kyle is rude, but resonates with my view on
let vs const
battle.Thanks for sharing that post.
I'm not sure I can fully agree with Kyle. Most of his points are fair, but the main goal of
const
is to communicate intention. Yes if I didn't reassign my variable, then I intend on it not to change. Later on when I come back and want to change it that's fine, I just know that it's not being changed currently so I can be more aware of that.Agreed, that post misses the point.
Why am I not surprised that someone like that is on the language committee? (I'd say JS culture is basically worse is better, but somehow its movers and shakers manage to screw up even that up.)