POV-Ray : Newsgroups : povray.newusers : Access to height field data : Re: Access to height field data Server Time
28 Jul 2024 20:34:58 EDT (-0400)
  Re: Access to height field data  
From: Kenneth
Date: 19 Oct 2008 19:05:00
Message: <web.48fbbc40cd5c214378dcad930@news.povray.org>
Alain <ele### [at] netscapenet> wrote:

> When I had some programming courses, the teachers always told us that it was
> VERY BAD practice to test for a negated comparaison.
>
> To write "if(x != 0)" or "if(x <> 0)", depending on the language used, was a
> sure way of failing. Instead, it was MANDATORY to use "if(x)". (x!>y) had to be
> replaces by (x<=y) whenever possible to. And (x !>= y) was an heresy!
>

Interesting!

The only programming courses I've ever taken were back in the 'pre-history' days
of computing--writing Fortran IV on punched cards!  (Which *really* dates me,
eh?) I could very well have been taught the same do's and don'ts--but I've
sadly forgotten.

But back to POV: If I had written the POV 'escape' code like this...

#if(vlength(norm) = 0)
// don't make an object
#else
object{my_object translate <...the traced-on location...>}
#end

....it somehow doesn't 'look' right to me--sort of like telling POV NOT to make
any objects 'unless...'

An interesting little psychological difference. :-)

KW


Post a reply to this message

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