POV-Ray : Newsgroups : povray.off-topic : Computer language quirks : Re: Computer language quirks Server Time
29 Jul 2024 20:21:09 EDT (-0400)
  Re: Computer language quirks  
From: Darren New
Date: 3 May 2011 12:08:33
Message: <4dc02881@news.povray.org>
On 5/3/2011 8:50, Warp wrote:
>    What's wrong with:

The "else" doesn't end the function, and I tend to have several of these in 
a row, and sometimes it's inside a loop, etc.

>    (Structured programming purists would recommend doing it like that
> because there's no early return.)

I could restructure things, sure, but then it's even more verbose and unlike 
my initial thought processes.  Structured programming wouldn't let me return 
a value from the middle of the function either.  It's the asymmetry between 
a return after a void call and a return after a value-producing call that is 
ugly.


(I had to giggle yesterday when I added an "else break" as the last 
statement of a do-while loop, too.)

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

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