4 ms·
To be fair I think most languages don't have pitfalls as defaults in the C++ sense :D
by moonchrome 11y ago
To be fair I think most languages don't have pitfalls as defaults in the C++ sense :D
- Daishiman 11y agoThe amount of things in C++ to avoid practically constitute a language by itself.
- moonchrome 11y agoAnother amusing part is that it's a moving target - some parts of the language actually got better with implementations and spec improvements - so there's a large number of people avoiding useful features on outdated practices (they learned "don't use X" without the reasoning behind it :) )
- dragontamer 11y agoBut most languages that have seen prominent use have obscure corners that no one should ever visit. PHP has absolutely awful parts for example. (Magic Quotes anyone?) Even relatively "clean" languages like Java or C# can be completely mucked around if you abuse reflection or do dumb things (ie: have property getters / setters in C# do something insane... like get {return blah++;} ) I mean, any language that has mutexes (ie: all of them) can more or less lead to absolutely dangerous situations. C++ RAII may not be the best (compared to D or Rust or whatever), but C++ is the most widespread language that has complete RAII support. If you even learn the most basic of C++ patterns: shared_ptr<>, RAII destructors... (which are useful concepts in C++'s "replacements" anyway), C++ becomes not only a manageable language... but one of the most widespread useful languages current right now.