Making the main() Function Look Right
If you are having trouble designing your engine or your code, then write the main() function first. Write it the way you feel it should look, as basic or complex as you think it should be. Then write the functions it has to call. Then write the functions those call. This top-to-bottom method will help you determine what the public interface to each module should be, which will help guide you in deciding what should be visible and what shouldn’t be to the outside world.