Hacker News new | ask | show | jobs
by romanovcode 3241 days ago
You wouldn't declare your in-scope variables as `const` in C/C++/C#/Java wold you?
1 comments

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.