It seems like in handmade hero there is a clear seperation between platform layer and game code. I am guessing there is also a renderer in the middle? At least that is what I have understood when I looked at the source code. I was curious why Casey mentioned so many times in the stream to prevent game from calling platform layer. I understand that we have a seperation between them but it's not like a seperation you have between two programs. You don't open any pipes or sockets to connect to each other, you don't have any issues with bandwith over the socket or pipe or whatever. That's just a seperation between two translation units.(I guess not translation units just files because it's a unity build)
I do not understand the benefit of game code not calling platform layer. Let's say on a big game we have some sort of level system where levels contain thausands of assets. Before player walks into a new level we want(probably) some mechanism to start loading assets before. We cannot(as far as I understand) load the assets on game layer because we need some function to open files and write them to a disk which is platform spesific code. But we also cannot do that on platform layer because platform layer shouldn't contain game state, that means we cannot do a switch loop on which level player is on and load that assets because then we check for game layer only things.
I guess Casey some how solved that on some stream? But I don't understand the argument against seperating them with a clear distinction. Why do we give up on the control over the game we had before? Why are we round tripping to other ways to do things instead of directly doing it. I feel like to prevent round tripping we do more round tripping.
I can get the argument of saying well platform layer code can fail and we want as less failure points as possible but you will still need to do the work to get the assets into the game at the end of the day. It shoudn't matter whenever it is done, either you pass a pointer to a huge chunk of memory every frame or just do a direct call.
What advantage do we get exactly because we clearly loose a lot. Also I am not trying to argue or anything if I sound like that I just want to get the reason on why we need something like that.