General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Mikko Rantalainen
Theo - t3․gg
comments
Comments by "Mikko Rantalainen" (@MikkoRantalainen) on "`const` was a mistake" video.
21:05 I think the reviewing code is the most important part. Most of the code that's actually maintained in long term will be read many times more than it's written (computer effort doesn't matter for this discussion, only human effort). In addition, the code will be read by other people but the original author so it's about communication. Because using const can help readability and understandability of the code, you should use it for those purposes. However, don't expect to see similar safety benefits that C++ can provide with const, where const reference to object is honored recursively in function context. For write-once toy projects where the code is never used again for anything important, sure, use "let" for everything. But don't forget that nothing is as permanent as a temporary solution that seems to work for now.
1