POV-Ray : Newsgroups : povray.advanced-users : Instantiation and terminiation....OOP & Povray? : Re: Instantiation and terminiation....OOP & Povray? Server Time
28 Jul 2024 10:25:59 EDT (-0400)
  Re: Instantiation and terminiation....OOP & Povray?  
From: Darren New
Date: 25 Jan 2006 14:46:03
Message: <43d7d57b@news.povray.org>
Warp wrote:

 >> #if ((0.25 < clock) & (clock < 0.75))
 >
 >   The problem with that is that it's hard to understand.


One you get used to it, you read it as "clock is between 0.25 and 0.75."

 >   People don't say nor think "is 25 smaller than the money I have?" but
 > they always think the other way around. That's why writing things like
 > "if (25 < money)" makes code confusing.


Read it "is my money more than 25?"  Ignore the < vs >, and read the 
order the variables are in. Like the "number line" you learned in grade 
school. It's really not any more confusing than starting to count at 
zero and continuing while less than your limit. Once you get used to it...

It especially helps when working with time and timestamps, I find. 
Whatever's on the right is later, whatever is on the left is earlier.

-- 
   Darren New / San Diego, CA, USA (PST)
    Luke, the Force is a powerful ally,
    second only to The QuickSave.


Post a reply to this message

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