3 ms·
Well then, that's your problem: C++ is trying to be both low-level and high level at the same time. This isn't a good idea, IMHO. What I mean is that while som
by qwertyuiop924 10y ago
Well then, that's your problem: C++ is trying to be both low-level and high level at the same time. This isn't a good idea, IMHO.
What I mean is that while some amount of RAII is a common idiom in C++, It's rare for a program to use RAII fully, as many C++ idioms conflict with it. Mind, I'm not an expert, so I might be wrong, but that was my understanding. AFAICT, if RAII was used all the time, idomatic C++ would look a lot more like Rust.
- pjmlp 10y ago> Well then, that's your problem: C++ is trying to be both low-level and high level at the same time. This isn't a good idea, IMHO. It is a very good idea and C++ isn't alone there. Professional Basic dialects, Turbo Pascal, Delphi, Modula-2, Modula-2+, Modula-3, Ada, D, Rust, Mesa/Cedar all share this idea that you can program at both levels, depending on the needs of the use case.
- qwertyuiop924 10y agoC++ has less distinction though, and it's so huge that even Bjarne can't keep the whole language in his head. The net result is that many people use the low-level parts of the language for high-level work and vice-versa.
- pjmlp 10y agoThe same applies to the languages I listed, given the amount of years they have. C++ main issue has always been C's compatibility and the C subculture. The copy-paste compatibility was necessary to bring C developers over the fence to C++, with minimal changes to their tooling. So C++ inherited all the flaws and UB from C. Then many of those kept using C++ as plain C with Classes, which influences many of the design decisions regarding language semantics, specially given backwards compatibility as no one wants to repeat Python's error. Having said this, although I enjoy playing with template metaprogramming, I hope never have to deal with SFINAE, declpspec and function return arrow syntax in production.
- qwertyuiop924 10y ago...But that's not often how those languages are used. And most of those "flaws" aren't flaws in C: They were deliberate design decisons. Arguably bad ones, yes, but they were made a reason. By C++, most of those decisions didn't have any reasons, or were actively against C++'s goals, if not C. I know you hate C, but blaming C for C++'s problems is like blaming dogs for the monstrous dog demon that someone made with gene editing. C compatability was a bad idea, but you can't blame C for that. Also, it's overly baroque. But yeah, I think we can all agree that complex TMP is kinda sucky.
- pjmlp 10y agoThose decisions are documented in "The Design and Evolution of C++".