Let’s take this off poor @pamelafox’s mentions, y’all. She’s suffering enough with this needless debate within her own company!
-
-
Replying to @littlecalculist @wycats
Sure, but am I reading your reply correctly in that the regret is `let` vs `const` is a source of debate? I still don't get it.
2 replies 0 retweets 1 like -
Your preferred style is indeed a popular one, possibly the most popular one. However IMO it leads to considerably worse code. 1/
2 replies 3 retweets 7 likes -
People tend to think "letting readers know whether my local binding is mutated is important enough to signal with a keyword." I disagree 2/
3 replies 1 retweet 2 likes -
Mutation is difficult to manage *in the large* and deserves careful annotation. Const doesn't help with this. 3/
2 replies 1 retweet 7 likes -
In the small, it's much less useful. It's distracting to the reader of the code to be constantly informed "this binding is not mutated" 4/
2 replies 1 retweet 12 likes -
Worse, it's confusing people because it's not telling you the value is immutable, just the binding. 5/
2 replies 3 retweets 10 likes -
In fact, the traditional meaning of the keyword `const` is "this *value* is a constant." I.e., deeply immutable values only. 6/
1 reply 1 retweet 7 likes -
So the benefit is low, the added noise level is high, and the code doesn't say what it means. 7/7
5 replies 1 retweet 19 likes -
Haha easy when rust has deep immutables
1 reply 0 retweets 1 like
Yep, and even in Rust some of the core team occasionally regrets "not-mut by default"
-
-
I dunno I feel like I'd loooovvcee it.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.