I don't always have access to an integrated debugger, so sometimes I need to get down and dirty with the logs to figure out what's not working correctly.
I'd often end up staring at pages and pages of, er.. umm, well.. stuff like this when debugging Vector3D :
Along the way I picked up a few techniques to accelerate the process. But first, I'll let the code speak for itself:
Lets take the constructor example. When you use this style (the default), you would get the following in your output window:
We can immediately copy and paste this from the log/output window straight back into the code window, hit recompile, and recover a dormant state from the past, ready for closer examination in the debugger.
The excel format is handy too, just copy and paste the output into excel, select any two columns, and hold the graph button. (scatter-XY is my favorite) You now have a visual representation of your vectors in less than 2 seconds.
More generally, this falls under the topic of code-which-generates-output-for-the-input-of-another-program. In this case, the c++ compiler itself. I'll have a lot more to talk about this topic in the posts to come.
But this example does raise one interesting special case, that of generating output, which is then fed back in as input to the same generating program. As we all know from control theory, we need a little extra work to avoid runaway feedback in this case!
Do you connect your output to your input? Let me know in the comments below!