flâneur — a map of the web's best reading

Why Const Sucks

jmdavisprog.com · 6,822 words · saved by 1 readers

As could easily be guessed by the title, this article discusses the issues I have with const - primarily with an eye towards D but also with regards to C++. My view of const has changed considerably over the years, and this talks about that. In fact, the situation with const is part of what led me to D. I originally come from a C++ background. It's what I used on my own before programming in school and what I originally used in high school and college. I read books like Effective C++ and C++ Gotchas about good and bad practices (I've always been a bit surprised that many programmers don't think that the correct thing to do when learning a language is to read a bunch of books about it to learn it through and through), and one of the things that I definitely bought into was const-correctness - that is, the idea that any function that is "logically" const should be marked as const and that as much as possible should be const. As such, when I later ended up using Java for school and work,

Why Const Sucks Jonathan M Davis: The Long-Winded D Guy Home Articles Talks Projects About rss Why Const Sucks As could easily be guessed by the title, this article discusses the issues I have with const - primarily with an eye towards D but also with regards to C++. My view of const has changed considerably over the years, and this talks about that. In fact, the situation with const is part of what led me to D. A Bit of Background I originally come from a C++ background. It's what I used on my own before programming in school and what I originally used in high school and college. I read books

Explore this link on the map →

related reading