4 ms·
I find it surprising that anyone could imagine that the creator of C++ is unaware of its issues. I’m sure he appreciates them better than almost anyone else an
by Negitivefrags 5y ago
I find it surprising that anyone could imagine that the creator of C++ is unaware of its issues.
I’m sure he appreciates them better than almost anyone else and would be the first to acknowledge them.
But compromises have to be made to create a useful langague and path dependency means that sometimes the sub-optimal long term choice is still the right choice to make right now.
- mjburgess 5y agoIt's more the attitude of various creators. Some have a jobsian "this is how you should do it"; others frenetic, "next time it'll be perfect", others, "you dont really need this!". Etc.
- mtzet 5y ago> I find it surprising that anyone could imagine that the creator of C++ is unaware of its issues. While C++ adds a lot of new features, it does very little to solve the problems inherited from C. The lack of static introspection, a real module system and tagged unions are all inherited from C. I do think it's fair to think that if a problem is not addressed in 30 years, it just might not be considered important. Adding tagged unions is not a sophisticated language feature. Fat pointers (c++20 std::span) also seems like a no-brainer. Maybe I'm biased by hindsight, but these features were implemented by contemporaries like Pascal? Actually, the paper also contains a great section about fat pointers: > The obvious solution is to supply an abstraction that holds a pointer plus a size. For example, in 1990, Dennis Ritchie proposed that to the C standard committee: "'fat pointers' whose representation will include the space to store the adjustable bounds at run-time" [Ritchie 1990]. For various reasons, the C committee didn’t approve. At the time, I heard the priceless comment: "Dennis isn’t a C expert; he never comes to the meetings." It is probably good that I don’t remember who said that.
- pjmlp 5y agoWe are on the early days of module system, but it kind of works, at least on VC++. You can get tagged unions via std::variant.