Is there an automatic way to remove debugging methods for a release build?
- by Lewis
Note: This is an extension of an earlier question I asked here: Do additional function/method definitions increase a program's memory footprint?
When I write a class, I usually end up writing several testing/debugging methods, used to make sure the class works as it should, or for printing data to help with debugging, or for unit testing, etc. Is there an easy/automatic way to make a release without these methods, or do I need to manually delete the extra code any time I want to compile a release version?
I ask this question both from a C++ and a Java perspective. I'm using Code::Blocks and Eclipse as IDEs, if that plays into the answer somehow.