<p>This may be a matter of style, but there's a bit of a divide in our dev team and I wondered if anyone else had any ideas on the matter...</p>

<p>Basically, we have some debug print statements which we turn off during normal development. Personally I prefer to do the following:</p>

<pre><code>//---- SomeSourceFile.cpp ----

#define DEBUG_ENABLED (0)

...

SomeFunction()
{
    int someVariable = 5;

#if(DEBUG_ENABLED)
    printf("Debugging: someVariable == %d", someVariable);
#endif
}
</code></pre>

<p>Some of the team prefer the following though:</p>

<pre><code>// #define DEBUG_ENABLED

...

SomeFunction()
{
    int someVariable = 5;

#ifdef DEBUG_ENABLED
    printf("Debugging: someVariable == %d", someVariable);
#endif
}
</code></pre>

<p>...which of those methods sounds better to you and why? My feeling is that the first is safer because there is always something defined and there's no danger it could destroy other defines elsewhere.</p>

```
#if
```
gives you the option of setting it to 0 to turn off the functionality, while still detecting that the switch is there.
Personally I always
```
#define DEBUG 1
```
so I can catch it with either an #if or #ifdef