Strategic placement of different debug statements
A debug statement is the most important part of any development process. Anything and everything can be tracked and traced through debug statements. However, being a system printing call, each debug statement comes with a cost on performance, which has a direct effect on runtime FPS. This is why a strategy on the placement of debug statements is absolutely necessary.
Let's have a look at the strategies related to following categories:
Memory allocation
Tracking the object state
Checking the program flow
Tracking object values
Memory allocation
In a game development object cycle, an object should be allocated once per initialization and deallocated on destruction. However, due to manual programming mistakes, developers forget to free the memory. In this case, the garbage collector cleans the memory when it is invoked by the system automatically. This way, a lag in performance is observed.
Now, as a strategic placement to trace such mistakes, two debug...