POV-Ray : Newsgroups : povray.newusers : Access to height field data : Re: Access to height field data Server Time
28 Jul 2024 20:31:15 EDT (-0400)
  Re: Access to height field data  
From: Alain
Date: 19 Oct 2008 17:37:46
Message: <48fba8aa$1@news.povray.org>
William Tracy nous illumina en ce 2008-10-19 13:28 -->
> Alain wrote:
>>> I prefer to simply use:
>> #if(vlength(Norm))
>> ...
>> #end
>>
>> Any non-zero value evaluate as true.
> 
> I find that slightly less readable; making the not-equal-zero explicit 
> makes it clearer what you are trying to do.
> 
> If I wrote code like that on the job, my boss would be unhappy. ;-)
> 
>> No need for the empty #else.
> 
> I concur there.
> 
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!

-- 
Alain
-------------------------------------------------
After any salary raise, you will have less money at the end of the month than 
you did before.


Post a reply to this message

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