The deeper I get into it, the more convinced I am that C++ is a terrible language.
It's still probably my favourite language, for all its faults, and if you steer clear of all the 'here be dragons' parts it can be very useful. But there are so many things about it that (if you adhere strictly to the spec rather than just going with "what real compilers do") are pure pants-on-head.
I think part of the problem is that C++ isn't a well-defined language in its own right. It's a systems implementation language, and it's designed to be as flexible as possible, so you can't really talk about "C++" on its own. You have to talk about "C++ on [specific hardware] using [specific compiler]". As soon as you do this, all the undefined stuff goes away and you have a real language.
I've been using C++ for years now and I'm absolutely convinced it's a terrible language for not the same reasons you do. C++ sucks because it allows clever people to write code that is damn near unintelligible. I once worked with a guy who, by all accounts was very intelligent, but when he got his hands on a c++ compiler would write shit that not even Turing himself could interpret. C++ isn't crap because it's different per platform. That's actually the most clear part of programming with it. C++ sucks because it gives shitty people too much rope to hang everyone else on their team with. The more features to a language the more bullshit people will try to pull. I stick with C and ASM and that's all anyone needs.
I stick by my criticism of C++'s minefield of undefined behaviour, but I totally agree with your reasons as well. Of course, a sufficiently ingenious fool can make a hash of a job in any language, but C++ is particularly vulnerable to a certain kind of clever-yet-clueless coder, the kind who turns any task into an opportunity for mental masturbation and so ends up producing a giant pile of intricate, carefully crafted, very clever, yet mostly useless crap.
Exactly. The idea behind it is that everything is "reusable". But the practicality of it is that all of your code and development time goes towards ensuring that code can be reused. Then you end up with a monster so big that only the people who wrote the damn thing can actually reuse the code. Everyone else just ends up writing their own versions. Again though, after years of programming on a system, you can "get the hang of it" on their particular flavor of insanity. Then everything works as planned. But who needs that? I can go to the Linux kernel right now and find exactly what I need because those guys don't fuck around with trying to be overly clever with their overall design and "reusability". Sure there's some dragons down there, but I'm much more comfortable in a world where the language itself isn't designed to fuck me at every turn.
12 comments
2 u/tame 20 Dec 2016 23:26
The deeper I get into it, the more convinced I am that C++ is a terrible language.
It's still probably my favourite language, for all its faults, and if you steer clear of all the 'here be dragons' parts it can be very useful. But there are so many things about it that (if you adhere strictly to the spec rather than just going with "what real compilers do") are pure pants-on-head.
I think part of the problem is that C++ isn't a well-defined language in its own right. It's a systems implementation language, and it's designed to be as flexible as possible, so you can't really talk about "C++" on its own. You have to talk about "C++ on [specific hardware] using [specific compiler]". As soon as you do this, all the undefined stuff goes away and you have a real language.
1 u/superpewpew 21 Dec 2016 02:43
I've been using C++ for years now and I'm absolutely convinced it's a terrible language for not the same reasons you do. C++ sucks because it allows clever people to write code that is damn near unintelligible. I once worked with a guy who, by all accounts was very intelligent, but when he got his hands on a c++ compiler would write shit that not even Turing himself could interpret. C++ isn't crap because it's different per platform. That's actually the most clear part of programming with it. C++ sucks because it gives shitty people too much rope to hang everyone else on their team with. The more features to a language the more bullshit people will try to pull. I stick with C and ASM and that's all anyone needs.
2 u/tame 21 Dec 2016 04:16
I stick by my criticism of C++'s minefield of undefined behaviour, but I totally agree with your reasons as well. Of course, a sufficiently ingenious fool can make a hash of a job in any language, but C++ is particularly vulnerable to a certain kind of clever-yet-clueless coder, the kind who turns any task into an opportunity for mental masturbation and so ends up producing a giant pile of intricate, carefully crafted, very clever, yet mostly useless crap.
0 u/superpewpew 21 Dec 2016 13:20
Exactly. The idea behind it is that everything is "reusable". But the practicality of it is that all of your code and development time goes towards ensuring that code can be reused. Then you end up with a monster so big that only the people who wrote the damn thing can actually reuse the code. Everyone else just ends up writing their own versions. Again though, after years of programming on a system, you can "get the hang of it" on their particular flavor of insanity. Then everything works as planned. But who needs that? I can go to the Linux kernel right now and find exactly what I need because those guys don't fuck around with trying to be overly clever with their overall design and "reusability". Sure there's some dragons down there, but I'm much more comfortable in a world where the language itself isn't designed to fuck me at every turn.
Even Torvalds weighs in: https://archive.is/tA75S
1 u/matthewlinton 21 Dec 2016 14:45
I think it makes more sense when Bjarne Stroustrup explains why C++ is the way it is.
1 u/tame 21 Dec 2016 14:52
I love the way that they tagged that as fiction, as if to make sure nobody mistook it for a genuine interview. :P
1 u/kwithh 21 Dec 2016 08:38
Preprocessor for functional programming. Behold, for I am comprised entirely of nope. Keep your monads off me, buddy.
0 u/prairie 21 Dec 2016 10:15
Wow, blast from the past. It's like being back in the late 1990s again!
I haven't kept up with C++, but they've since added a metric ton of things to it, making what it was like then as C was to C++ back then.
0 u/DrJamesA 21 Dec 2016 19:31
Python & Ruby (for Metasploit). That's it.