4 ms·
"This isn't relevant. The standard is for compiler writers and library writers who use advanced meta-programming." It is. It is a metric of how ungodly complex
by DoctorDabadedoo 3y ago
"This isn't relevant. The standard is for compiler writers and library writers who use advanced meta-programming."
It is. It is a metric of how ungodly complex the language is. You can infer by this that having a comprehensive mental model of the language is difficult, do's and don'ts are all over the place and even a thing "simple" as a cast can lead to UB, but this flies under the radar of a lot of developers. You don't need to be a compiler engineer to make good use of such information.
"That depends. Some pitfalls just disappear like std::auto_ptr but I doubt anyone complains. Big changes came with c++11 and c++20, that is once in 10 years. While c++11 added move semantics and new initialization syntax that are somewhat complicated and hard to ignore, c++20's additions only make you glad that your life has become easier."
True, but it takes time to be proeficient with the changesets, for the projects to be transitioned to newer versions, if they are at all, and then to map what is valid in which version if there are reworks everywhere (e.g. I'm involved with some that are still c++14, "Do we have structured bindings available here? Oh, no, too bad.").
I appreciate thing gettings better/easier, but c++ seems to be all over the place (just checked the compiler support for c++20 and there is still partial support for some features in major compilers, even though work on c++23 has already started).
- protomolecule 3y agoIt is ungodly complex, but no one needs to understand all this complexity just to use the language to write application code. "do's and don'ts are all over the place and even a thing "simple" as a cast can lead to UB" And most of these things were present in the first revision of the C++ standard or even in C. "You don't need to be a compiler engineer to make good use of such information." Why do you think that a programmer has to learn C++ by reading the standard? One does need to have a good mental model of what's happening but it's enough to have a much much simpler mental model than the standard. "and then to map what is valid in which version" That's where skills acquired 5-10 years ago are most relevant)
- DoctorDabadedoo 3y agoApplication devs don't need to know the spec, but someone in the committee having a hard time of knowing the language in full is an interesting fact of how complex the language itself is. "Why do you think that a programmer has to learn C++ by reading the standard?" If your application seg faults due to an ill type deduction caused by `auto`, why did it fail? What kind of type deductions auto covers? Experience by trial and error will hardly help you here. End user developers will acquire that knowledge probably by reading digested material from experts either focused on language tidbits or working closely to the standard (Effective C++, Effective Modern C++, blogs, etc.), the root source is still the spec, the more complex the spec is, by transitivity, the more complex is anything that comes out of it. I guess the bottomline is that we agree the language is complex and I'll leave it at that.
- protomolecule 3y ago"the more complex the spec is, by transitivity, the more complex is anything that comes out of it" Yeah, that's why so many languages don't have spec at all.