POV-Ray : Newsgroups : povray.general : Question 'bout indentation (no flamewar) : Re: Question 'bout indentation (no flamewar) Server Time
12 Aug 2024 03:24:12 EDT (-0400)
  Re: Question 'bout indentation (no flamewar)  
From: Tom Melly
Date: 30 Mar 1999 03:34:26
Message: <37008c92.0@news.povray.org>
k.i.s.s. - i don't think using #if in the way you did is a good habit - many
languages would probably refuse to compile. Besides, standardised code is
easier to read, indent and debug.

Even in pov, i would have thought you might be vulnerable to future release
changes, since the usage wouldn't necesserely be preserved (I haven't tested
your code, but I assume it works in current versions).

I would suggest one of the following two versions (untested, so i apol. for
any mistakes):

#if (A > 0)
    union {
        sphere { ... }
        sphere { ... }
    }
#else
    sphere { ... }
#endif

Or:

union {
    sphere { ... }
     #if (A > 0)
         sphere { ... }
     #endif
}



your version:

> #if (A > 0)
> union {
> #endif
> sphere { ... }
> #if (A > 0)
> sphere { ... }
> }
> #endif


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.