[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binarycloud-dev
Subject:    Re: [binarycloud-dev] Exception/Error design
From:       Jean-Christophe Michel <jc.michel () symetrie ! com>
Date:       2003-11-29 19:03:30
[Download RAW message or body]

Le sam 29/11/2003 à 16:11, Manuel Holtgrewe a écrit :
> Hi
> 
> I just had a look at Node again and the following question arose to me:
> 
>     Should we check in methods for correct parameter types?
> 
> Currently, we check for the parameter of Node::SetParams() to be an
> array. Should we really do so? It adds some overhead to Node and much
> more try/catch code.

No need to catch, excp will bubble up and dev will see it.
Remember that SetParams is intended to receive many params, else you use
SetParam. If you don't check type and pass sthg else than an array,
you'll hang two lines later, on array_keys($params).

> I think we can assume that the developer puts the right code there.

Checking params seems good coding practice imo.
This saves time when developer makes an error.
-- 
Jean-Christophe Michel <jc.michel@symetrie.com>
Symétrie


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@binarycloud.tigris.org
For additional commands, e-mail: dev-help@binarycloud.tigris.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic