Hacker News new | ask | show | jobs
by izackp 1465 days ago
I would definitely prefer swift's 'var' or JavaScript's 'const' here.

The solution in the link adds to cognitive complexity. Imagine you had bad code (Worst case scenario; which always happens). A function with 400+ lines of code. You would have to scan the entire function just to figure out if a variable is mutable then you would have to force yourself to remember _all_ the variables that are mutable when evaluating behavior.