This is a normal practice for applications, and allows you to pre-compile that header for performance. I don't think it's a bad enough practice to warrant complaining, but it's good for people to know the advantages or disadvantages.
Re:Ray Tracing in One Weekend
by kookamamie on Thursday January 02, 2025 @08:35AM
(#42574267)
See this: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines...
Technically, headers are just copy-paste, obviously. However, there's value to keeping them as standalone as possible.
Re:Ray Tracing in One Weekend
by on_the_train on Thursday January 02, 2025 @08:52AM
(#42574384)
Headers should still be self contained, although precompiled headers are used. Those things are mostly orthogonal
Not a great practice. Header files shouldn't assume anything from previous inclusions of other headers.
Sure, this works as a weekend hack, but it would be nice if book (article) would promote good conventions.