Micosoft's DirectX SDK examples are literally garbage code. 200+ line functions, 30+ global variables, unnamed constants, over 90% badly written C that is supposed to be C++, tons of macros - all of these in each example! How are we supposed to learn from this?

Yeah, that's true. I really do suppose that at the end of the day there's not much one can do about it because the Windows APIs are huge and old. Obviously at the time the C++ Core Guidelines didn't exist. But does anyone want to go through refactoring it all? Nope.

And yeah some of the rules do make you use the GSL. I can understand not wanting to use that (more library hassles YAY, the best part of C++ is sorting that shit out...), but most of the major rules that can really influence your code don't require it.

My original comment was talking more about not using the Windows API examples for learning good C++ style. Cos they don't have it.

/r/programming Thread Parent Link - github.com