Re: Design: Custom Exception Usage
- From: Weeble <clockworksaint@xxxxxxxxx>
- Date: Fri, 11 Apr 2008 03:05:42 -0700 (PDT)
"Anthony Jones" <A...@xxxxxxxxxxxxxxxx> wrote:
"Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx> wrote:
I wouldn't want that at all. If I'm calling CanParse(), 99 times out of a
100 it's because I want to parse the string. It'd be silly to call a
method that basically has to do the work of parsing the string, but which
only returns a flag telling me if actually parsing the string will work.
Well thats the crux of the matter isn't it? Why is it "silly" ?
Apart from anything else, I would point out that the "try it and see
if it worked" strategy is more general than the "look before you leap"
strategy. For example, when opening a file, no amount of checking
whether the file is there and whether you have appropriate permissions
will be sufficient to ensure that opening the file succeeds. So even
if you encourage "look before you leap" where possible, people will
still need to be familiar with "try it and see if it worked" for
reasons that have nothing to do with performance and everything to do
with correctness.
Regards,
Weeble.
.
- References:
- Design: Custom Exception Usage
- From: Terrence Jones
- Re: Design: Custom Exception Usage
- From: DSK Chakravarthy
- Re: Design: Custom Exception Usage
- From: Anthony Jones
- Re: Design: Custom Exception Usage
- From: Peter Duniho
- Re: Design: Custom Exception Usage
- From: Anthony Jones
- Re: Design: Custom Exception Usage
- From: Peter Duniho
- Re: Design: Custom Exception Usage
- From: Anthony Jones
- Design: Custom Exception Usage
- Prev by Date: Re: C# windows form and EXCEL vba question
- Next by Date: Re: share a structure array containing multidimensional char array
- Previous by thread: Re: Design: Custom Exception Usage
- Next by thread: Re: Design: Custom Exception Usage
- Index(es):
Relevant Pages
|