←back to thread

498 points azhenley | 1 comments | | HN request time: 0.207s | source
Show context
loeg ◴[] No.45768135[source]
Yeah, I also wish it was the default. But it's a little too verbose to just sprinkle on every variable in C++. Alas. Rust gets this right, but I'm stuck with C++ at work.
replies(2): >>45771522 #>>45773574 #
1. veltas ◴[] No.45771522[source]
100%, life's too short.

Ultra-pedantic const-correctness (vs tasteful const-correctness on e.g. pass-by-reference arguments or static/big objects) catches nearly no bugs in practice and significantly increases the visual noise of your code.

If you have luxury of designing a new language or using one with default mutability then do so, but don't turn C coding styles into C++-envy, or C++ coding styles into Rust-envy.