On let vs const — overreacted
13 hours ago
- The author's previous post advocating for 'let' over 'const' sparked controversy, with the majority favoring 'const' wherever possible.
- Arguments for preferring 'const' include reducing mental overhead, preventing bugs from reassignments, teaching immutability concepts, and detecting meaningless assignments like in React Hooks.
- Arguments against include loss of intent communication, confusion with immutability, pressure to avoid 'let' leading to awkward code, and the fact that reassignments rarely cause bugs in practice.
- The author concludes they don't care and recommends following existing codebase conventions, using linters to automate decisions, and deleting any annoying lint rules.