As of 4.17, the TankPlayerController.cpp file won’t compile if anything other than #include "TankPlayerController.h"
is the first header file included. This means that Ben’s build at 5:20 in this video will also fail to compile with the error:
Expected TankPlayerController.h to be first header included.
Additionally, the forward declaration video was a couple of lectures ago, and the next lecture doesn’t seem to talk about the issues raised in this video at all.
In regard to forward declarations, I still don’t really understand why we use them. I understand that it increases compile speed, but from what reading I’ve done around the subject, the general consensus seems to be to favour #include
s over forward declarations. The Google C++ Style Guide explicitly advises against their use whenever possible, with the only benefits being a quicker compile time.
I understand that forward declarations are a feature of the C++ language, and as such, it’s an important learning exercise to be exposed to them in our code, however I feel that they’re introduced in the videoes, without really discussing any of the benefits and drawbacks (although there may be discussions on this in future lectures, I’m only up to this video so far!).
I absolutely love this course, and have been having a blast, but I feel the structure of the last few videoes has been a bit messy. I’d recommend moving this video to before the “Using Forward Declarations” lecture (I think it should be anyway?), removing the obsolete part from 3:54 onwards, and replacing it with an introductory discussion on forward declarations and why and when we would use them. I think that this would greatly increase the flow of the learning process, as well as allowing us to expand our knowledge of forward declaration, which I feel we are currently lacking.