Re:Making the Most of the JavaScript Language (2016)
by romanovcode on Friday August 04, 2017 @05:20AM
(#14927374)
You wouldn't declare your in-scope variables as `const` in C/C++/C#/Java wold you?
[ Parent
| on HN ]
Re:Making the Most of the JavaScript Language (2016)
by clappski on Friday August 04, 2017 @05:35AM
(#14927423)
In C++ I always do, everything is 'const auto &' if it can be. C# const is different, it's more like C++ '#define'.
Why wouldn't you always go for the most immuatable declaration? Even in C++, where you can have 'const int f(const int y) const;' it's still worth using even though you have to type it a few times.