logoalt Hacker News

jdw64today at 7:31 AM12 repliesview on HN

It's surprising that C++'s development trend continues.

When a game or program is made with C++, it's usually nice because performance is mostly guaranteed. But if someone told me to write C++ myself, I'd cry. There's too much to memorize, and the standards are too varied. When I go to a project site for maintenance and it's a C++ project, I instantly lose energy — because it's just too difficult.

I'd be happy if someone else wrote it, but it's not a language I want to write myself


Replies

bayindirhtoday at 7:33 AM

Personally I don't find programming with C++ that hard. The downside is it needs a brain warm-up, and this is per project, but once that flywheel is spinning, I find it almost effortless to write code.

I have to go through the same warm-up more or less for any language I work with, so it's not that different than writing Python, Go or Java for me.

show 4 replies
flohofwoetoday at 8:08 AM

For games, C++ becomes a much simpler language since game code bases usually ignore the C++ stdlib (at least mostly, and for good reasons, e.g. see [0]). And without the stdlib C++ is actually kinda-sorta okay-ish.

Related, the main problem with the C++ ecosystem is that everybody carves out their own language subset, so it's not one ecosystem but many ecosystems with contradicting styles and language/stdlib subsets. This makes code reuse via libraries much harder than it should be.

[0] https://hftuniversity.com/post/the-c-standard-library-has-be...

show 4 replies
fasteriktoday at 5:54 PM

I don't really understand this perspective. You don't need to memorize anything to learn a new programming language. You choose a medium-sized project you've already done in another language, start with "Hello world," and add one line of code at a time until the project is done. When there's something you need that you don't know how to do, you look it up.

You'll end up with a strong understanding of the subset of the language that's actually useful for the thing you want to build.

samivtoday at 8:24 AM

You're right that C++ has a lot of features. But like mentioned elsewhere most projects define their own conventions and the subset of features that they use.

Also the nice thing about having a large set of features is that C,++ allows you to write very nice abstractions (or not) at both very low or at very high level. In other words you can be very low level with online ASM and bit operations and bit and direct memory manipulation or very high level almost like a script language. Whatever the problem domain needs C++ has got you covered.

randusernametoday at 2:53 PM

One of my hobbies is rummaging around thrift stores appreciating tacky things from bygone eras, sifting through ill-conceived modern junk, and delighting in simple, solid tools where I can find them.

That's what it's like to be a C++ programmer.

zerrtoday at 8:06 AM

You can be pretty productive even with 70% of the language :) It is a common misconception that C++ is suitable only for game engines and similar domains. It is perfectly fine for applications domain as well.

As a side note, regarding your profile info, unless you are based in North Korea, please at least add one 0 to your rate. You'll get more long-term and high-quality clientele.

show 3 replies
pjmlptoday at 9:15 AM

Not really, despite all its warts, it is exactly because of them that many reach out to C++.

Many of us don't like C, it was already too little and too unsafe, when the first C++ compilers started to hit the market in early 1990's, hence why all desktop OSes moved into C++ for their frameworks.

The return to C has caused by the rise of FOSS, UNIX winning the server room, and early GNU coding standards to use only C as main compiled language.

Additionally as many other programming language ecosystems have discovered, it is easy to beat C++ in version 1.0, and eventually all of them grow to get the complexity of their own.

I reach for C++, because the language runtimes, compiler tooling, and GPGPU frameworks I care about are partially written in C++, and I am not in the place to be writing new ecosystems myself.

kllrnohjtoday at 3:15 PM

> But if someone told me to write C++ myself, I'd cry. There's too much to memorize, and the standards are too varied

If someone tells you to write a web app, do you also cry? Surely there's more JavaScript frameworks than subsets of C++ at this point, no? Do you also go memorize all of them? Or do you just quickly pick one, and then only learn that one, and forget the rest exist? Because that's kinda how you approach C++. You pick a subset (like, say, just modern C++, only caring about C++17 & later or whatever), and just use that. And move on with your life. There's absolutely no reason to learn how std::auto_ptr works because it's dead in the same way you aren't learning how PHP & CGI works if you're making a modern web app. They're dead relics of the past that you can just pretend don't exist.

tenderfaulttoday at 8:32 AM

funny, I think the same about rust.

show 1 reply
nnevatietoday at 7:43 AM

The language is fine, mostly, nowadays.

The ecosystem isn't fine - just to get a project going requires picking a non-trivial set of tools and approaches, none of which the C++ standard enforces or guides to.

For example, will you manage dependencies via packages? If so, with what? What will you use for building your project? The list goes on and on.

show 2 replies
logicchainstoday at 8:03 AM

>There's too much to memorize, and the standards are too varied. When I go to a project site for maintenance and it's a C++ project, I instantly lose energy — because it's just too difficult.

If you'd already been using it for 10+ years you wouldn't feel that way, because you'd already have memorized a lot of it.

show 1 reply