Hacker News new | ask | show | jobs
by 0x457 1367 days ago
I think not many people ever got properly introduced to C++.

Some probably only saw it during their format education, and it's most likely been taught like C with classes and/or they had to use for stupid things.

There are also many forms of C++, there is your "old and regular" C++, game dev C++, there is modern C++, then there is "I only know C, but sure I can write C++" C++.

Pulling dependencies is not as simple as `npm i boost`.

Communities are small, segmented and not welcoming to newbies.

Absolute madness with build tools. I've never worked with CMake myself until last year, and I haven't so frustrated.

As for how many applications using C++ that's not really an argument — C++ was literally the only choice for many of them at that time.

3 comments

Not really an argument? The C/C++ ecosystem is so well established that even today you don't have a choice in a lot of contexts.

If that doesn't show the power of a language, I don't know what can. I don't really think the community is toxic or unwelcoming, more like people are too used to ctrl+c ctrl+v their way out of problems. Nothing against that, I'm the same way, but it really is a matter of taking your time with the language. I've honestly learned to applaud most rust fanatics because of this, at least they are passionate about learning athe language inside/out.

Where is C++ the only choice? Gamedev seems like the closest—as far as I know, most AAA games aren’t using C, but I think maybe many are using C# via Unity (I’m not familiar with the gamedev space)? In the embedded world, C still reigns supreme. Maybe in the world of high frequency trading? But these seem to be fewer and fewer and Rust seems increasingly likely to be a contender in these domains.
Game engines are one example, there isn't a robust-enough language other than C++ that has the ability to build some powerful abstractions while also giving you the tools to manage hardware more directly. Note that Unity uses C# as a scripting language, but under the hood the core engine is all in C++.
Under the hood some of that C++ code is now the C# subset used by the Burst compiler.
Drivers, data driven system that have higher performance standards, medical imagery, military components heavily employ Ada mixed with C++ interfaces.
I agree that these things all use C++, but the parent’s claim was that there are areas (industries?) where C++ has no alternatives. Drivers and high performance systems can all make use of C, Rust, Ada, etc as well as C++ depending on requirements.
I'm sorry, but Rust still has ways to go before established industries believe on it enough to drop C/C++. I use C/C++ interchangeably, since extending an existing C codebase won't be a problem. Most aren't willing to go as far as Ada either, the reason why that even in military endeavors, C/C++ is used as a more familiar "face".

I think it's pretty easy to forget the foothold these languages have, and their flexibility. We all have seen the perseverance of COBOL.

My original comment specifically said that older languages have staying power, and that Rust will have to mature a bit to become the language of choice for new projects in these niches. But even still, I wasn’t talking about dropping C++ for Rust—I only mentioned Rust as an alternate option.
Horse and carriages had a well established ecosystem. We don't use that for moving people and goods anymore.

Being old isn't a superpower. That said, I don't see C++ replaced in certain areas for loooong time.

Yeah, it'll surely fade out given time. It's certainly not a perfect language.
To be properly introduced to C++ is to be properly introduced to the madness called UB.

Of course not many people ever got properly introduced to C++.

Something that C++ inherited from C. ISO C has about 200 documented cases of UB.
I echo the same sentiment here but mainly for C language as If my memory serves me right, I didn't have any encounter with C++.

My experience was negative overall and traumatic to some extent and I wouldn't rule out that some who were first exposed to the language in college or even HS share the same aversion and feel scarred and haunted forever by that Blue Ghost.