|
|
|
|
|
by magicalhippo
1120 days ago
|
|
> The worst part of OOP is that all the properties of an object can be a mishmash of values and are mutable. Const-ness is one of the things I really miss from C++. I could look at an object and be reasonably sure I wasn't mutating it by calling foo.length() for example. |
|
Sometimes I want to add one little extra thing that gets mutated in an otherwise "const" method, e.g. for debugging purposes. If the compiler doesn't let me do that because I valued the ideal of const-correctness higher than practical concerns, I know I've done something wrong.