Live data from Hacker News

Thoughts on Modern C++ and Game Dev

elbeno.com

121–130 of 143 posts

Re: Thoughts on Modern C++ and Game Dev

#121
post #91

Earlier quoted context omitted.

I've never really bought this argument. If you want to contribute to theoretical physics and be taken seriously it's expected that you have a solid grounding in physics. This principle is generally fairly widely applied. There are people on the standards committee who represent their companies and part of their role is to speak for the needs of the 'regular' programmers at their companies who may not be as well infor…

I wasn't talking about participating directly in the standards committee (and neither was the OP). It seems that the people who are supposed to be speaking for the regular programmers aren't doing a particularly good job.

> It seems that the people who are supposed to be speaking for the regular programmers aren't doing a particularly good job.

I agree with this. The people at CppCon are very smart, very informed, and very very pro-C++. It's silly to think that such a person (people on the committee, no less), would be a good spokesperson for your everyday programmer.

However, that's certainly not the main problem keeping C++ complexity high. Even though the committee genuinely wants improvement in this area, there is too much fear of breaking legacy code, and too many early design mistakes to overcome on the path back to a simpler C++.

Re: Thoughts on Modern C++ and Game Dev

#122
post #107

Earlier quoted context omitted.

Arandr0x hasn't demonstrated his/her ignorance. I'm not sure what you hope to achieve by harping on the ignorance of unnamed persons who aren't participating in this discussion.

Yes, Arandr0x did demonstrate ignorance - "a lack of knowledge" - and that was what I was responding to in my original reply to him.

Arandr0x didn't say anything inaccurate about C++. Giving people a hard time simply for showing a modicum of humility is a pretty shitty thing to do.

I also note that you yourself are perfectly willing to complain about things in areas where you lack an in-depth understanding:

https://news.ycombinator.com/item?id=18372370

Re: Thoughts on Modern C++ and Game Dev

#123
post #122

Earlier quoted context omitted.

Yes, Arandr0x did demonstrate ignorance - "a lack of knowledge" - and that was what I was responding to in my original reply to him.

Arandr0x didn't say anything inaccurate about C++. Giving people a hard time simply for showing a modicum of humility is a pretty shitty thing to do. I also note that you yourself are perfectly willing to complain about things in areas where you lack an in-depth understanding: https://news.ycombinator.com/item?id=18372370

Inaccuracies that could have been corrected by watching freely available CppCon videos:

- Papers "written in a way that's deliberately inaccessible"

- "I'd be marginalized for not using template metaprogramming" - a major topic is how to get the benefits of template metaprogramming techniques without the ugly syntax that everyone dislikes.

- "I'd be marginalized for ... not knowing the new hotness by heart" - a major purpose of CppCon talks is to explain the new hotness.

- "it's led by academics who think the concerns of working programmers like me are beneath them" - the majority of speakers at CppCon and members of the standards committee are working programmers, not academics and none of them show any evidence of thinking the concerns of working programmers are beneath them, quite the opposite in fact.

And unicode is still insanely complex.

Re: Thoughts on Modern C++ and Game Dev

#124

Earlier quoted context omitted.

Thank you for replying in-depth, I didn't expect it. I actually agree with you re: 2D graphics(I was aware of it already), I just think geometry is different because it has wider applications. Your viewpoint is consistent though. Again, I think concurrency is one of the parts the standard library does best. (And I think part of the specifics of this is it has primitives like async and future that are higher level and…

I have no threshold for when someone is worthy to talk about C++ on the Internet. What I don't particularly like is people complaining about things they don't seem to have made much effort to understand. I'm happy to answer questions for people who genuinely want to learn about C++ (my top 5% ranking for C++ answers on Stack Overflow attests to that I think). There's never been a better time to learn C++ - there's a…

> I think if you want a long term career in this industry you need to dedicate at least ~5 hours / week of your own time to professional development on an ongoing basis. If you work with C++ on a daily basis then spending some of that time working through CppCon videos (I like to watch at 1.25x speed) and other free online resources is a good idea IMO.

Then I know what I'm doing tonight. I like the computational geometry aspect much better than the programming language part. The thing with C++ is very often the stuff you don't know sneaks up on you at the worst time when starting on a new library, or trying to reuse code more complex than you're used to. It's strange to think of it as something to study, but 5h/week is something I could do instead of more overtime.

>What I don't particularly like is people complaining about things they don't seem to have made much effort to understand.

The main thing I was complaining about was C++ takes (relatively to e.g. Python) a ton of work to understand accurately, but also to explain properly to other people. You must know that from answering on StackOverflow too. (There are features of C++ I don't use because I/my coworkers don't yet know them, and studying will help me with that, but I can't complain about them yet!) StackOverflow is actually great for C++ though, so thank you for answering on it. Usually there's always an answer with a detailed explanation even for strange code samples. Often it's through reading the other people's questions that I can understand how a construct can be useful in practice.

Re: Thoughts on Modern C++ and Game Dev

#125
post #122

Earlier quoted context omitted.

Arandr0x didn't say anything inaccurate about C++. Giving people a hard time simply for showing a modicum of humility is a pretty shitty thing to do. I also note that you yourself are perfectly willing to complain about things in areas where you lack an in-depth understanding: https://news.ycombinator.com/item?id=18372370

Inaccuracies that could have been corrected by watching freely available CppCon videos: - Papers "written in a way that's deliberately inaccessible" - "I'd be marginalized for not using template metaprogramming" - a major topic is how to get the benefits of template metaprogramming techniques without the ugly syntax that everyone dislikes. - "I'd be marginalized for ... not knowing the new hotness by heart" - a major…

None of those is a statement about C++. They’re all fairly subjective statements about people’s thoughts and motivations. You may disagree with them, but you can’t seriously suggest that these statements are a fair basis on which to conclude that arandr0x is too ignorant of C++ to contribute to any discussion about the language.

It's particularly discouraging to see you use someone's understandable nervousness about attending a conference as a basis to attack them for their "ignorance". Ironically, that just confirms that arandr0x is right to be a little nervous!

If you transpose your attitudes to the complexity of C++ and the complexity of unicode (“you suck because you don’t understand C++” vs. “unicode sucks because I don’t understand it”), then you might see what arandr0x is getting at.

Re: Thoughts on Modern C++ and Game Dev

#126
post #60

Earlier quoted context omitted.

You just mentioned 2 garbage collected languages on a game dev topic. I don't think they're adequate. Remember how the article was very insistent about being able to control memory and CPU resources. Those are one of the few reasons C++ is not dead. Rust? I don't see it either.

A big part of this is ecosystem. You have so many game libraries and software that are written in C and C++. To many gamedevs, Rust is just a systems language Go. It doesn't bring anything significant to the table compared to just using a limited subset of C++.

The big game mills don't care about languages, they care about the bottom line. If you can churn out the same quality product with more junior engineers because the language is less difficult to master it is going to happen rather soon.

Re: Thoughts on Modern C++ and Game Dev

#127

Earlier quoted context omitted.

I have no threshold for when someone is worthy to talk about C++ on the Internet. What I don't particularly like is people complaining about things they don't seem to have made much effort to understand. I'm happy to answer questions for people who genuinely want to learn about C++ (my top 5% ranking for C++ answers on Stack Overflow attests to that I think). There's never been a better time to learn C++ - there's a…

> I think if you want a long term career in this industry you need to dedicate at least ~5 hours / week of your own time to professional development on an ongoing basis. If you work with C++ on a daily basis then spending some of that time working through CppCon videos (I like to watch at 1.25x speed) and other free online resources is a good idea IMO. Then I know what I'm doing tonight. I like the computational geom…

In my experience C++ may seem more complex to understand initially than something like Python but once you invest some time to really understand it then it is much less mysterious / less of a black box than an interpreted or JITed language, particularly when dealing with anything performance sensitive, because nothing is hidden from you under layers of abstraction that persist at runtime yet are relatively opaque to your debugging or profiling tools.

One of the nice features about C++ IMO is that there is very little "magic" in the standard library. Unlike some languages, all the features of the standard library can be implemented with standard language facilities that are available to you for use in your own code. Some of the more complex areas of the language however are there primarily to support library authors writing very general code and you don't need to fully grok them to be an effective user of the language. Learning about some of them over time however will likely pay dividends for your own code even if you are not writing widely used libraries.

Re: Thoughts on Modern C++ and Game Dev

#128
post #108

Earlier quoted context omitted.

Similarly, on a game I worked on we had a “controller monkey” that would spam all possible player actions (move, jump, attack, special powers) rapidly and randomly. We then had the testers record multiple paths exploring through each level. Every few seconds the monkey-controlled player character would be teleported a bit further down the path to ensure progress and coverage. Dozens of people would set the monkey to…

I feel like when people just say "tests" there's a lot of conflating. Usually, on a site like this or on a blog post, "tests" are referring to automated unit-testing or talking about TDD...which is probably most rare and most fought against in game dev (from what I've seen from an adjacent industry). Testing, in general, is pretty essential to writing code that does what you want. Test code is just automating what yo…

> Testing, in general, is pretty essential to writing code that does what you want.

Shipped 17 games, several AAA games with no automated testing. Not saying that was good only that it happened and so is at least some evidence that automated testing is not essential.

The problem with automated testing in games is most of it will be content specific and the content changes multiple times a day. A product like say GTA5 has 20-30 programmers and 300 artists and game designers. Those 300 artists and game designers are adding new content and or changing old constantly. Often they also use a scripting language or a blueprint like visual language to setup in-game logic like "open blue door if player has blue key". There's just too much to test. Every day 1000s of tests would have to be re-written because some boxes, doors, etc were moved .5 units to the left.

There isn't zero value in automated testing (see above) but my experience with testing on a large project, Chrome, was that it really slowed down my velocity. Easily by much more than 50%. Of course Chrome is a platform and absolutely needs the tests IMO. I think a game engine would benefit from lots of automated tests. The game itself though it gets harder to figure out where the balance is between automated testing and manual testing.

As others pointed out as well big teams, like an OS team or a browser team often have dedicated staff to setup and maintain a testing infrastructure. Game teams rarely have this. Maybe they should but few games are given the budget.

Re: Thoughts on Modern C++ and Game Dev

#129

I'm not in games but my industry is adjacent and I have the same gripes with c++. (Which the author characterized very well.) Although build and debug times definitely are an issue regardless of the performance of the hardware. I find reading C++ "standards" papers onerous and feel like they're written in a way that's deliberately inaccessible. I don't much like the idea of going to CppCon -- even if my company funde…

It's nice to hear this kind of concerns; don't be afraid! At last, C++ committee members are just people like you, hopefully nicer than expectation.

> I find reading C++ "standards" papers onerous and feel like they're written in a way that's deliberately inaccessible.

Sadly, it's somehow true; standard wordings are typically not readable for laypeople because its primary purpose is unambiguous specification but not education. Generally, I find that it's a good idea to avoid "wording for ~~" proposals if I haven't followed that specific line of proposals from its beginning.

But many proposals are still fairly readable technical papers; for instance, Herb Sutter's proposals are generally easy to follow. (ex. https://wg21.link/P0709)

> I feel like I'd be marginalized for not using template metaprogramming, not knowing the new hotness by heart, and generally being a proponent of C-with-classes.

https://www.youtube.com/watch?v=rX0ItVEVjHc

Don't worry. Mike Acton is not known to be a strong proponent of "Modern C++", but his session[1] is one of the most popular CppCon video on Youtube. Even if you don't like templates, people will generally respect you.

> I just feel like so much of the C++ "standards" work feels like it's led by academics who think the concerns of working programmers like me are beneath them.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n479...

You can find the list of the participants for the last meeting. Most of them are just engineers and even Bjarne is now working for Morgan Stanley (I think most of "designed by Ivory Tower" concerns can be generally credited to Bjarne being a professor before) They're just writing C++ code as their daily job like you (and very likely suffering from C++ as well). That's why they're writing proposals to improve the language.

Some tangential story: except for few exceptions, PL academics are generally not working on languages like C++ because it typically doesn't align well with their interests. Usually they tend to use more elegant, academic friendly languages like Haskell or ML. Or even fancier languages like Coq, Adga, Idris, depending on topics. Or design their own languages. For formal verification researches, maybe C or Java. But C++ is typically considered as a complex, inelegant beast for researches.

Re: Thoughts on Modern C++ and Game Dev

#130
post #17

I am a bit puzzled by this: "Before about the early 90s, we didn’t trust C compilers, so we wrote in assembly." There a lot of games released during the 80's, were they really all written in assembly ? https://www.myabandonware.com/browse/year/ I don't have experience in the game industry at all, I must add.

I can support the trust issue with C compilers. I did my CS degree in the 80s and every C compiler I used had severe bugs. These weren’t on Unix to be fair, they were to run on PCs or to program embedded systems, but they were awful. I remember one (Aztec C?) crashing out because one of my statements had two lines of whitespace before it instead of one (or maybe it was an extra space in a blank line? I forget), which…

In the '80s I used a cross-compiler that ran on DOS and produced code for 68K. We probably ran into a compiler bug monthly on average. We always got great turnaround on our bug reports though - I think it was a one-man shop.
Post reply on HN