C++ Logo

sg20

Advanced search

Re: [SG20] SG20 Digest, Vol 6, Issue 3

From: Klaus Wittlich <klwittlich_at_[hidden]>
Date: Sat, 23 Nov 2019 19:21:33 +0100
Hello Guy,

I think, concurrency is a topic you should mention. You have a few chances to do things right and many chances to do things wrong. :-)
An other problem to cover is to show compromises between abstractions and programming near at the metal. Some examples:
1. Multithreading: If you have only one CPU you can slow down by multithreading code and you should not do it (in most cases). If you have some CPUs, you can split the problem and have a performance benefit. If you have too many, you can slow down performance because splitting becomes too expensive.
2. Some other problem oder solution is the pimple idiom. You have higher abstractions, but you have to pay with new and delete. Sometimes the fast pimple idiom is a good compromise.
Sometimes you need machine specific solutions, that can not be abstracted. Perhaps it is worth to teach the asm statement. It shows that you can abstract, but you need not and that not every problem can be solved by abstractions.
If performance matters it is worth to teach constexpr functions and template meta programming: Compromise compile time vs. run time. It is also worth to discuss assembler output to show what the compiler has done with the abstractions. Sometimes they cost nothing and that is often a surprise.

Perhaps it is a valuable pattern to discuss the C++ features by showing compromises: you get / you pay / your risk / your pitfalls. E.g. abstractions may prevent errors, make developing and moving to other platforms easier, but often you pay with specific chances you system offers, you can not use them.

I hope it was helpful to you.

Kind regards
Klaus Wittlich



An other point

> Am 23.11.2019 um 16:54 schrieb sg20-request_at_[hidden]:
>
> Send SG20 mailing list submissions to
> sg20_at_[hidden]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.isocpp.org/mailman/listinfo.cgi/sg20
> or, via email, send a message with subject or body 'help' to
> sg20-request_at_[hidden]
>
> You can reach the person managing the list at
> sg20-owner_at_[hidden]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of SG20 digest..."
> Today's Topics:
>
> 1. I've been asked to write a book (Guy Cpp)
> 2. Re: I've been asked to write a book (Balog Pal)
>
> Von: Guy Cpp <guy.cpp.wg21_at_[hidden]>
> Betreff: [SG20] I've been asked to write a book
> Datum: 23. November 2019 um 15:45:46 MEZ
> An: sg20_at_[hidden]
>
>
> Hello everyone.
>
> For those of you who don't know me, my name is Guy Davidson and I am the Principal Coding Manager at Creative Assembly, the UK's oldest and largest game studio. I have been there for 20+ years and my role has a significant educational component: I help our programmers become better programmers, I visit universities and recruit graduate interns, and I serve on advisory boards.
>
> Particularly, I serve on the IGGI <http://www.iggi.org.uk/>advisory board. This is a doctoral research programme targeting research into game AI. As part of their doctorate, students are placed in game development studios. The professors on the board have all bemoaned the lack of targeted C++ texts that they can point their students to, both undergraduate and post-graduate, and are keen for me to write The Book on learning C++ from a game-developer viewpoint.
>
> I really enjoy writing prose, examples of which you can see on my blog <http://hatcat.com/>, and I am keen to pursue this commission. I have plans and ideas, but of course the committee has a study group devoted to education, and it would be foolish of me not to canvas opinions, advice and even assistance from SG20.
>
> Currently, my approach is to develop a table of contents, pitch to publishers, and write some prose. It's with the first part that I would most appreciate assistance.
>
> Here are some considerations.
> - The approach I would to take is to teach by abstraction; start with the CPU and work upwards: registers and the program counter, objects, functions and function templates, classes and class templates, modules and libraries. While developing this framework I can introduce the remaining topics as tools for supporting these abstractions.
> - C++20 is a big update and a good place to drop anchor. However, there is scope for future editions as the standard continues to mature.
> - Without standard graphics and audio I'm going to have to come up with a suitable sandbox for reader experimentation; the console is not really fit for purpose in this context. The graphics proposal has a web assembly implementation, so I may be able to use a browser-based environment.
> - I will need plenty of exercises for the reader.
> - Game devs are extremely performance conscious. Exceptions and RTTI are not things that we use in game code, although possibly in the tools that we use to make our games. There is an informal dialect of C++ that game devs (and indeed most of the SG14 constituency) use.
> - The standard library has an unfair reputation in this constituency. I will treat it as an equal citizen, while also discussing profiling and highlighting the 80/20 rule.
> - I'm not convinced that I can treat this as an introduction to programming as well as C++. I may have to assume that the reader is already familiar with Python or something similar. However, having visited many code clubs and so on, it does seem that the biggest motivation among school age folk for learning to program is to write games.
>
> This does feel like an utterly insane thing to do on top of my day job and existing committee projects. However, it's a book that needs to be written, a book that I wanted to have when I was learning C++, and a book that I am able to write.
>
> I would welcome any input, and also minutes of SG20 meetings so that I can get up to speed with discussion and become more involved in this study group.
>
> Best regards,
> Guy
>
>
>
> Von: Balog Pal <pasa_at_[hidden]>
> Betreff: Aw: [SG20] I've been asked to write a book
> Datum: 23. November 2019 um 16:52:22 MEZ
> An: "sg20_at_[hidden]" <sg20_at_[hidden]>
>
>
> On 11/23/2019 3:45 PM, Guy Cpp via SG20 wrote:
>
>> The professors on the board have all bemoaned the lack of targeted C++ texts that they can point their students to, both undergraduate and post-graduate, and are keen for me to write The Book on learning C++ from a game-developer viewpoint.
> Don't wanna rain on your parade, but this doesn't sound too promising. IME
> - learning programming
> - learning C++
> - learning game development
>
> are very distinct things. And better not be mixed. Maybe the first two to some level, tut that's it. Especially these days.
>
> It's not very rare that on forums I visit someone pops up with a question like 'I want to write games, I'm a complete noob, how should I start." And after we skip the gut reaction of "just forget about it and get an actual life", the suggestions are like grab a Raspberry Pi and hack something, or get Unity, get a ton of samples, try to do some modifications, do that for a long time until ... Then many years later if the guy is still around and interested he may learn C++ and maybe join a shop that uses it for games too.
>
> Having said that, you writing *a* book can still be a good idea. I just suggest to be very very careful on what scope you grab and what target audience you expect. Lately I see we have serious shortage on good books related to modern C++, also with its application to particular problems.
>
> Lately I tried to lobby for tutorials on the upcoming major C++20 features. With not much success, authors of them agree that it would be great to have, but don't see the resources to make that happen -- maybe you could make a detour in that direction. What would serve a way larger community than game developers.
>
> And if you really want to stay tied to games, I'd probably go with audience already familiar with C++?? (whatever version you believe is mostly used), and write on how to use C++ better in some common challenges, how to modernize, pick up the new stuff, etc.
>
>
>
>
>
>>
>> I really enjoy writing prose, examples of which you can see on my blog <http://hatcat.com/>, and I am keen to pursue this commission. I have plans and ideas, but of course the committee has a study group devoted to education, and it would be foolish of me not to canvas opinions, advice and even assistance from SG20.
>>
>> Currently, my approach is to develop a table of contents, pitch to publishers, and write some prose. It's with the first part that I would most appreciate assistance.
>>
>> Here are some considerations.
>> - The approach I would to take is to teach by abstraction; start with the CPU and work upwards: registers and the program counter, objects, functions and function templates, classes and class templates, modules and libraries. While developing this framework I can introduce the remaining topics as tools for supporting these abstractions.
>> - C++20 is a big update and a good place to drop anchor. However, there is scope for future editions as the standard continues to mature.
>> - Without standard graphics and audio I'm going to have to come up with a suitable sandbox for reader experimentation; the console is not really fit for purpose in this context. The graphics proposal has a web assembly implementation, so I may be able to use a browser-based environment.
>> - I will need plenty of exercises for the reader.
>> - Game devs are extremely performance conscious. Exceptions and RTTI are not things that we use in game code, although possibly in the tools that we use to make our games. There is an informal dialect of C++ that game devs (and indeed most of the SG14 constituency) use.
>> - The standard library has an unfair reputation in this constituency. I will treat it as an equal citizen, while also discussing profiling and highlighting the 80/20 rule.
>> - I'm not convinced that I can treat this as an introduction to programming as well as C++. I may have to assume that the reader is already familiar with Python or something similar. However, having visited many code clubs and so on, it does seem that the biggest motivation among school age folk for learning to program is to write games.
>>
>> This does feel like an utterly insane thing to do on top of my day job and existing committee projects. However, it's a book that needs to be written, a book that I wanted to have when I was learning C++, and a book that I am able to write.
>>
>> I would welcome any input, and also minutes of SG20 meetings so that I can get up to speed with discussion and become more involved in this study group.
>>
>> Best regards,
>> Guy
>>
>>
>
>
>
> SG20 mailing list
> SG20_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg20


Received on 2019-11-23 12:23:59