4 ms·
RAII ("classes as resource manager") is one of the nice concepts in C++. My favourite is certainly const correctness. And then there's tons of things that cree
by fhd2 13y ago
RAII ("classes as resource manager") is one of the nice concepts in C++. My favourite is certainly const correctness.
And then there's tons of things that creep me out a bit. Being a multi paradigm language sounds good on paper, but it seems to cause a lot of accidental complexity. The best way to stay sane is probably to pick a certain subset of C++ for your project and stick to that, that's what I tend to do.
Then again, that's not uncommon in simpler languages either. "JavaScript, The Good Parts", lint and all that. Code accessibility matters IMO.
- pkolaczk 13y agoC++ const-correctness is weaker than immutability in, say Haskell or Scala.
- fhd2 13y agoCan't say anything about Haskell, but what Scala has is less flexible then const correctness in C++ IIRC. You can't have an immutable reference to a otherwise mutable object and then call non-mutating functions on it. It's either fully immutable or fully mutable. CMIIW by all means.