logoalt Hacker News

flohofwoetoday at 8:08 AM3 repliesview on HN

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...


Replies

herr_shieldtoday at 8:40 AM

I fully agree. In my personal project, I ended up using the STL to get off the ground, but in the end I replaced pretty much everything with custom-written code.

Once you get rid of the STL, compile times get so much better. With modern c++23 features, templates actually become really convenient to write, and at the core there is a really useful and pleasant to use language.

I try to avoid c++ libraries and instead rely on c-style APIs. Usually the c++ style libraries force you into using the STL, which comes with a heavy tax on compile times, without much benefit in comfort of use.

show 1 reply
samivtoday at 8:19 AM

If you don't use the STL you end up re-implementing it yourself. Usually poorly.

show 4 replies
Chaosvextoday at 8:15 AM

That article probably isn't the best source to cite. You can look at the discussions on it elsewhere, although I'd just dismiss it as slop.

The standard library is mostly fine to use unless you have specific needs.

The bit about libraries is nonsense, sorry.

show 1 reply