🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3896

Re: Can somebody explain how or when I can use "#if 0"?

#3896
From: Jonathan Sivier
Date: Fri, 01 Sep 1995 15:30
26 lines
1882 bytes
tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) writes:

>|> There is one case where they SHOULD appear in finished code:  that is
>|> where the code is left as an example, and cannot be used without further
>|> editing.  I use '#if 0 == 1' AND comment the code in such cases.

>To each his own. I prefer `#if 0' over `#if 0 == 1'. But if someone wanted to
>write `#if (0 == 1) != (0 == 1)', or followed some other `higher principle'
>by needless obfuscation and/or verbosity, I wouldn't complain either.

   I prefer to use #ifdef XX in such cases.  That way I can search for 
specific instances (using more strings than just XX) and activate some or
all by defining the appropriate macros.

Jonathan

-------------------------------------------------------------------
|  Jonathan Sivier               |  Ballo ergo sum.               |
|  jsivier@ux1.cso.uiuc.edu      |  (I dance therefore I am.)     |
|  Flight Simulation Lab         |              - des Cartwright  |
|  Beckman Institute             |                                |
|  405 N. Mathews                |  SWMDG - Single White Male     |
|  Urbana, IL  61801             |          Dance Gypsy           |
|  Work: 217/244-1923            |                                |
|  Home: 217/359-8225            |  Have shoes, will dance.       |
-------------------------------------------------------------------
Technical Details
Message-ID: <4278uq$9cd@vixen.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!ux1.cso.uiuc.edu!jsivier
References: <41rm39$o1m@ixnews5.ix.netcom.com> <41rqbi$i3o@zonker.cs.ucsb.edu> <41si6s$4qs@lyra.csx.cam.ac.uk> <41sjrp$8kb@newshost.lanl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ux1.cso.uiuc.edu!jsivier
From: jsivier@ux1.cso.uiuc.edu (Jonathan Sivier )
Newsgroups: comp.std.c
Subject: Re: Can somebody explain how or when I can use "#if 0"?
Date: 1 Sep 1995 15:30:34 GMT
Organization: University of Illinois at Urbana
Message-ID: <4278uq$9cd@vixen.cso.uiuc.edu>
References: <41rm39$o1m@ixnews5.ix.netcom.com> <41rqbi$i3o@zonker.cs.ucsb.edu> <41si6s$4qs@lyra.csx.cam.ac.uk> <41sjrp$8kb@newshost.lanl.gov>
NNTP-Posting-Host: ux1.cso.uiuc.edu