John Carmack On Modern C++

Winter break homework from John Carmack. Gamasutra reprint article "In-depth: Functional programming in C++":

A large fraction of the flaws in software development are due to programmers not fully understanding all the possible states their code may execute in. In a multithreaded environment, the lack of understanding and the resulting problems are greatly amplified, almost to the point of panic if you are paying attention. Programming in a functional style makes the state presented to your code explicit, which makes it much easier to reason about, and, in a completely pure system, makes thread race conditions impossible... (full article)

Also "Lessons to learn from Oculus development team when using the “Modern C++” approach":

Modern C++ doesn’t imply necessarly the overuse of templates

Andrei Alexandrescu says about the Modern C++ design:

"Modern C++ Design defines and systematically uses generic components - highly flexible design artifacts that are mixable and matchable to obtain rich behaviors with a small, orthogonal body of code."

Modern C++ has a close relation with generic programming; probably it’s the reason that makes many developers neglect the modern C++ approach. They think that the code will be mostly implemented as templates, which makes the code difficult to read and maintain.

In the SDK, the templates represent only 20% of all types defined and most of them are related to the technical layer... (full article)

Comments (0)

This post does not have any comments. Be the first to leave a comment below.


Post A Comment

You must be logged in before you can post a comment. Login now.

Featured Product

How cameras deliver sharp images despite changing distances

How cameras deliver sharp images despite changing distances

IDS Imaging Development Systems offers a range of models, from a webcam-like camera in industrial quality to a tiny autofocus camera that weighs just12 grams. The 13 MP autofocus camera uEye XC closes the market gap between industrial cameras and webcams. Setting up and operating only requires a cable connection. After that, the autofocus camera immediately delivers high-resolution, detailed images and videos. With the optionally available, quickly exchangeable macro lens, users can easily shorten the minimum object distance of the camera. This makes it also suitable for close-up applications. Focus from a distance of just 10 cm. The uEye XS is even more compact and fits into almost any application with its size of just 26.4 x 23 x 21.7 mm. Thanks to its autofocus and 5 MP CMOS sensor, it delivers consistently sharp images and videos from a distance of just 10 cm. When it comes to image quality, natural color reproduction and harmonious contrast are also decisive factors. IDS has therefore equipped the uEye XS with many other practical automatic features familiar from consumer technology. This includes white balance, exposure and gain. As a result, it delivers the best possible result in every situation.