Re: Design Option: Exception handling vs Code Testing....

2010-06-10 Thread Jens Alfke
On Jun 10, 2010, at 1:58 PM, Frederick C.Lee wrote: > Is it acceptable to merely trap for the out-of-bound exception within the > method() and continue my way? > ... or should I test EVERY TIME I access a member, to see if the member exist? For better or worse, Cocoa’s policy policy is that an

Re: Design Option: Exception handling vs Code Testing....

2010-06-10 Thread Kyle Sluder
On Thu, Jun 10, 2010 at 1:58 PM, Frederick C.Lee wrote: > Greetings: >    I have a situation where I need to access a member of a mutable array (max > 4 members). > Sometimes I could get an out-of-bounds exception, if for example, I try to > access member #3 out of a 2-member array. > It's not s

Re: Design Option: Exception handling vs Code Testing....

2010-06-10 Thread Michael Ash
On Thursday, June 10, 2010, Kyle Sluder wrote: > On Thu, Jun 10, 2010 at 1:58 PM, Frederick C.Lee > wrote: >> Greetings: >>    I have a situation where I need to access a member of a mutable array >> (max 4 members). >> Sometimes I could get an out-of-bounds exception, if for example, I try to