3 ms·
C++ suffers this a lot particularly because its paper system rewards pages of meaning-free implementation details with little to no qualitative discussion. Wher
by Veedrac 7y ago
C++ suffers this a lot particularly because its paper system rewards pages of meaning-free implementation details with little to no qualitative discussion. Where else can you find a random library that lets you template a Mersenne Twister with (I kid you not) 14 template parameters, but that makes it almost impossible for the average programmer to correctly seed one? Who is served by such a system?
Things don't have to be this way. Take a look at the average Python PEP or Rust RFC; they are 90% what-we-want-and-why, and the implementation details, when they do exist, exist principally to make sure that they are asking for something possible.
- lonelappde 7y agoC++ is one of the very few performance critical languages, performance will always be it's #1 feature, even above safety (which can be pushed back to libraries if performance demands it) so implementation details matter a lot more than in other languages.
- klodolph 7y agoThis is not the full explanation. The key problem here is that C++ runs on nearly everything, from your garden variety x86 to bizarre DSP architectures. The many, many template parameters are there so you can simultaneously say “you don’t pay for what you don’t use” and provide a library that works on weird systems.
- Veedrac 7y agoThis absolutely doesn't explain C++'s weirdness. Those template parameters don't make anything faster, its broken seeding ends up pretty slow, and a Mersenne Twister is hardly performance- (or anything-)optimal. Heck, some of those template parameters are probably used by a sum total of zero people in production code.