| I have given a variety of arguments why I think the C++ RAII specifically has downsides. I don't think you did, I think you just said it has downsides over and over. Once again you're explaining beginner C++ do me. Don't ask for basic knowledge then get upset when you get it. My response to this was and is, if you have primarily stack scoped lifetimes, you are writing beginner programs. This is what the vast majority of values have. Some escape one scope and get cleaned up in another one. This also includes values inside data structures. It's not something I want in general, I think it has more downsides than upsides for the code I'm writing. I've actually tried to use RAII many times and I've concluded it doesn't work for me. Again, this isn't an explanation, it's just you saying "I don't think it's good, I don't like it", but you aren't explaining why. This isn't evidence, it's just you restating "this is bad". Why is it bad? "I told you it's bad!!". thus enabling exceptions and implicit or uncontrolled control flow Exceptions aren't uncontrolled flow and you can also not use them. Something else being enabled doesn't mean the unrelated feature is bad. This also implies that every other language that isn't C is terrible because they have some sort of automatic cleanup. Now java and python are unstructured by your own definition? If I were you, my response would be: The burden of proof is on you, show the evidence. You don't have an explanation of why the burden of proof is on me. Everyone uses these techniques in system software now. You are the odd person out, that's why the burden of proof is on you. I also gave you a very good explanation and you said "you're explaining basic C++ to me". I am, you asked for it and you didn't poke any hole in why it's wrong. the issues caused by manual cleanup are also somewhat exaggerated by C++ people It means memory leaks and crashes which everyone has been fighting for 50 years. This should be plenty evidence to a reasonable mind, but that isn't you. Someone running a marathon without shoes doesn't mean shoes are bad. Just because an old program is written in C, that has no bearing on if other tools are good or not. This is not a logical conclusion. Unix was written in C too, does that mean destructors are bad? No one said it's impossible to write a program in C now that C++ exists. Why can't you give a single basic explanation instead of making the same claim over and over? |
"Please give me examples of great systems software written in plain C or C style procedural C++"
"Please give me examples of great systems software written in modern C++, as opposed to procedural C style C++ or plain C".
Why does it seem like the majority of core infrastructure, like Linux kernel (also vast parts of Windows/Mac OS), PostgresQL, Sqlite3, Git, OpenSSH, GCC, but also e.g. MS Office/Excel, are written in plain procedural code and not in modern C++? For the latter, I get stuff like "ScyllaDB NoSQL database" or "Envoy Proxy" or whatever, what is that even and why should I care or how do I know they're actually technically solid products and not just hype?
My claim: The arguments that I've given (but you keep insisting I didn't give them) play a huge rule in why that is so. You can use C++ RAII for plumbing and high-level stuff. But if you try to actually implement technically interesting things, it won't help you at all, it's just getting in the way.