Matthias Granberry wrote:
> error_t writeFile() {
> error_t err;
> if( (err = writeHeader()) || //this stops processing on the first error
> (err = writeContent()) ||
> (err = writeFooter() ) )
> return err;
> return 0;
> }

Yes, but do you really think this is as readable and maintainable as the
version using exceptions ?

> Having said this, exceptions are very useful in situations where the problem
> gets a little deeper or you have a more than a few levels of indirection
> present

Yes, that's why I choose a fairly basic error in my example which must
be handled at the topmost level of the application. I wasn't going to
write half a dozen of functions just for a sample :-).

> but as Thiago pointed out earlier they come with a price so they
> should be used with care.

I totally agree.

>> Visit to unsubscribe <<