title: How can you find whether an environment variable exists at compile time?
body: <p>I don't particularly know if this is a good thing or not but I used to work somewhere where everyone had an environment variable like YOUR_NAME on their computer. Then if you had a bit of debug code that was only of interest to yourself you could wrap it in <code>#if defined( YOUR_NAME )</code> and it wouldn't even be compiled for someone else unless they changed it to <code>#if defined( YOUR_NAME ) || defined( THEIR_NAME )</code>.</p>
  
  <p>I've just tried to do this myself and it doesn't seem to work, restarted Visual Studio and then the computer but it still doesn't seem to be picked up. Was there more to this hack than I understood or does it require a specific version/option selected in Visual Studio?</p>