Re:The //* /*/ //*/ comment toggle trick
by alexanderbrevig on Monday April 29, 2013 @11:34AM
(#5626815)
* not all languages have macros
* you don't use test frameworks for enabling and disabling code inline while you're developing
Please read the protip, understand my intention (keyword TRICK) and have a delightful cup of coffee. You've earned it.
Welcome to Hacker News. :-)
> understand my intention
We don't do that here. However, we do have an unparalleled menu of pedantic critique, edge case obsession, and a wonderful sauce made from insanely perfect standards.
And tests need to be separated from the code. Hopefully using a test framework.
If your code changes depending on if it is in 'test mode' or not (which is what is proposed), then the test code is not the same as the production code, i.e. the production code is not tested. I'm not just talking about timing issues - extra variable names and objects will be in scope in 'test mode', and might logically change the behavior of the program.