4 ms·
I find it interesting that other commenters are finding those trivialities convoluted and unreadable while at the same time constantly championing languages whi
by mgaunard 4y ago
I find it interesting that other commenters are finding those trivialities convoluted and unreadable while at the same time constantly championing languages which are genuinely complicated.
- spoiler 4y agoI think the main issue is the quantity and density of complexity in the language (which is just a side effects of its long existence). A lot of it is hidden, or implicit; probably why people call them footguns, too. I used to write C++ for a few years, and the mental burden is real, you just stop noticing it. Having come back to C++ for an old project a few months ago, and writing it felt like a chore. Maybe I just never liked it without realising, and it's only just surfaced, though!
- hot_gril 4y agoI think the flaw with C++ is that it's too low-level for high-level applications, and it's too complex for performance-sensitive applications. I don't know what it's really good for. It feels far easier to use either extreme of C or Python/JS depending on the job. C++ seemingly grew to fill the high-level space that others have already filled better by now.
- sakras 4y agoFor what it’s worth, I treat C++ as C with a basket of goodies that you can use if it makes your code better (at least in the context of performance-sensitive stuff). Things like templates and classes can help if you don’t overuse them. STL is nice for rapid prototyping and writing tests. But I agree with you it’s often the case where people go overboard with the abstraction and cause an incoherent, slow, buggy mess
- hot_gril 4y agoYeah, that discipline works when you're solo, but in a team each person will have their own ideas. Mine would be to avoid using classes, and someone else would OOP it up.
- tragomaskhalos 4y agoI worked on a C++ codebase that was essentially C with a few obvious domain classes and the addition of std::string and std::vector for convenience. I suspect that this is quite a common space, and it's immune to the march of the whizzy new features that are being added. Probably the only remotely modern bit of C++ that we could have benefited from is a salting of std::moves to remove some redundant copying, but this wasn't really worth the candle tbh.
- mgaunard 4y agoC++ lambdas behave exactly like functions in any other functional language. In OCaml, for example, you can't do recursion for the same reason without the special "let rec" construct.
- mgaunard 4y agoC++ is a swiss army knife that can do everything, it's designed so that you don't need any specialized language at all. If you do, you can just make an embedded domain specific language, since it supports that too.
- viktorcode 4y agoThere are complex languages and there are readable languages. One language can be both at the same time, like Swift. The syntax examples here is what makes C++ hard to read: scores of special symbols hiding rather simple underlying mechanism.