A lesson learned the hard way
I'm currently working on two major projects; my computer science thesis work within image analysis, and pixelate. In both projects, I've done development in MSVC's debug mode. This week I switched to Release mode in both projects -- and they've both bailed out with no information of where/when/how -- since obviously it's not a debug run anymore. This led me to do printf("1\n"), 2, 3, recompile, run, repeat procedure to find where the programs died. A very tiresome and frustrating way to spend your time. The lessons learned are these rules-of-thumb:
/Olof
- Never develop anything in debug mode for any longer period, especielly not from grounds-up. Debug-mode can be used for tracking down problems found when running the release version, whenever the need arises.
- Bugs are better found early than late - assert is an economic test-driven way of programming - and testing is the way to convince yourself of the correctness of a program. If you've done your deal of programming you realize this. I did not enjoy going through 1.000 lines of code looking for the bugs - better take 10 lines at a time which early testing/unit testing achieves when used throughout development.
/Olof
0 Comments:
Post a Comment
<< Home