4 ms·
You wouldn't declare your in-scope variables as `const` in C/C++/C#/Java wold you?
by romanovcode 9y ago
You wouldn't declare your in-scope variables as `const` in C/C++/C#/Java wold you?
- clappski 9y agoIn 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.