Hacker News new | past | comments | ask | show | jobs | submit login

We're just going to have to agree to disagree on that. Const by default would have saved me quite a few headaches over the years and C++ syntax is the definition of cluttered. Good C++ code has the majority of function parameters marked const. A non const reference member function parameter is usually a warning to look carefully, isn't it?

"Everything should be made const in your code unless it can't be" is advice metered out by the likes of John Carmack, Scott Myers etc. so it's pretty popular and oft repeated. The prevailing C++ zeitgeist perhaps. Could still be wrong, absolutely, don't stop thinking there by any means. Constification of a codebase can be a major pain in the butt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: