Original Post
Hi all, I am currently in the process of making some critical decisions for my game's code, and deciding on paradigms that I am going to stick with throughout the project and I just wanted to get some opinions on this subject. As far as I can tell, there are positives and negatives to both of these methods. I've done some research around the internet, and it seems to be a pretty split decision about which practice is better in general, so I put the question to all of you, which practice do you prefer and use in your games, and do you differ the practice used based on situation?
For those who are not familiar with this terminology:
One-Step Initialization - Constructor sets up the entire class and throws an exception on failure
Two-Step Initialization - Constructors simply allocates the object and all initialization is done through a separate method, which will usually have a return value of a boolean or some error code.
Thanks all.
For those who are not familiar with this terminology:
One-Step Initialization - Constructor sets up the entire class and throws an exception on failure
Two-Step Initialization - Constructors simply allocates the object and all initialization is done through a separate method, which will usually have a return value of a boolean or some error code.
Thanks all.