When releasing source code for someone else to see, when coding style is not well defined (no pun intended) do you remove the #ifdef DEBUG parts?
(that is the parts that are compiled only when DEBUG is defined)
If I remove it, it makes the code looks better (or me look better – do I really want someone to know I’ve debugged, and how I’ve done it? ), but then I’ll lose my debug parts, or have to keep two (or more) versions of the code.
What is to be done?
I think if your debug code is clean and has ‘professional’ language in any logging statements, it’s okay to leave it in. If the debug code is sloppy or has debug messages like ‘I’m here…,’ ‘Now I’m here…’ you should take it out.
If your debug statements reflect the fact that there are issues that you can’t figure out, it might be best to take them out, if you’re trying to ‘sell’ your software to someone. (Hopefully you can fix them later…)