Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This sounds like a design deficiency.

If you have something that should only run in testing, perhaps your test harness should set the global variable appropriately, no?



Sure. And a million programmers have all screamed out in horror when they realize that their single test passes, but fails when run as part of the whole suite. Test contamination is a hell paved with global variables.


I can't agree more, I was dying this death a thousand times over at my last job.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: