100DaysOfGameDev: Day 15

Finally, it covered linker and how to divide the program into separate headers and file units. Again coming back to my compiler design class, I can safely say that linker is an ass. There are so many cases when linking can go wrong and you will not even be notified until the program crashes somewhere silently. And the worst is that the author himself says, “Mostly the major linker implementations handle some of those cases”. Mostly? Are you serious? However, having a safe linker is contradictory on its own, since it is a core issue. Nothing to say much for this chapter, except that you should definitely break the code into several files and header files in case the codebase becomes large. You can even go further and split the header file into two header files, where one interface is for the user and another _impl.h, for the developer implementing the interface. Make sure to have only one definition in a program, use guards, but don't overdo with #includes. Also, while writing this I felt, that I am starting to type like the author of the book. Don't do this, remember to do that, pay attention to this, hopefully, this will not break, etc. I will probably switch to some other topic for a couple of days to give my brain a rest from this book and come back. See you!