POV-Ray : Newsgroups : povray.off-topic : C# 4.0 Default parameters : Re: C# 4.0 Default parameters Server Time
6 Sep 2024 13:17:34 EDT (-0400)
  Re: C# 4.0 Default parameters  
From: Warp
Date: 6 Feb 2009 09:18:04
Message: <498c469c@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Yeah. The person I saw advocating this also recommended command/query 
> separation, so anything that sets a parameter wouldn't be able to return a 
> value.

  So if setting a parameter to a given value can fail, you can't check
the success/failure of the function call by having the function return
eg. a boolean value informing of this, but instead you have to write a
separate function which you have to call in order to query whether the
operation was successful or not? And this for each such parameter which
can fail?

  This presents a multitude of problems. For instance, the class would
have to store booleans for each parameter somewhere, so that the "did
the setting of that parameter succeed?" function can return it.

  What if the success query function is called *before* the setting of
the parameter function is called? Can the return value have a meaningful
interpretation anymore?

-- 
                                                          - Warp


Post a reply to this message

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