4 ms·
> But in this case C isn't even any different, so this tangent is irrelevant anyway. If you take a struct by value in C it, drum roll, copies it! You’re absolu
by jay-barronville 4y ago
> But in this case C isn't even any different, so this tangent is irrelevant anyway. If you take a struct by value in C it, drum roll, copies it!
You’re absolutely correct, but I also don’t have to worry about copy versus move semantics and all that other jazz in C — the mental model is simply value copies or pointer copies, that’s it.
- kadoban 4y agoBy the time you actually add enough libraries to be able to get something done, you have to worry about the same concepts, the names are just different and it's less consistent since the language doesn't help or have a position on how it works. C is a simple language the same way my car is simple if I take the engine out.
- jay-barronville 4y agoWhat a false equivalence. I don’t understand the need to pretend like C++ isn’t a minefield of complexity (especially compared to C). I don’t hate the language and C++ programmers tend to be some of the smartest programmers I know/encounter, but can we please not be deliberately obtuse here?
- kllrnohj 4y agoC is a minefield of complexity, though, why are you so desperate to pretend it isn't? The reality is that much of the language complexity of things like C++ or Rust is because the problem space is actually complex. C's language just doesn't help you with the inherent complexity. In fact it actively encourages bugs as a result. That's not a simple language, it's a bad one. It was fine for the constraints of the time, but it's not anymore. C is easily the least defensible language choice of the commonly used languages. There's so many just obscenely better options it's not even funny. See also why even "intentionally C-like" languages like Zig are growing increasing complexity https://github.com/ziglang/zig/issues/7769 https://github.com/ziglang/zig/issues/7769 Or why things like D's betterC adds all the same "objectionable" stuff C++ does - RAII, operator overloading, etc...
- kadoban 4y ago> I don’t understand the need to pretend like C++ isn’t a minefield of complexity (especially compared to C). C++ is a minefield. So is C though. Comparatively they're pretty much in the same boat for me. Sorry I guess?
- jstimpfle 4y agoWhat a weird analogy. The truth is that you can't explore a C++ codebase without actually stepping through it with the debugger. You literally can't see all the places where you end up. A mechanism to do the type resolution is needed, and that is a much, much bigger mental load. In C you can see each and every jump by default (unless someone does terrible hidden macro magic etc). Maybe add a code browser for convenience. You can often get a pretty good idea of a codebase just by browsing it. These are definitely diferent qualities. What's to say for C++, it's harder to misuse libraries because you don't have to understand libraries as well, and some constraints to using them are better enforced, because of RAII and other mechanisms. But as Stroustroup said himself, "C++ makes it harder, but when you do it blows your whole leg off". It's far from impossible to misuse C++, and when you do, it can be much harder to find out what's wrong. Anecdotally, in C++ it's also much easier to build a castle that ends up being a labyrinth.