Boost logo

Boost :

Subject: Re: [boost] [locale] Formal review of Boost.Locale librarystartstomorrow
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-04-17 17:50:14


On Sun, Apr 17, 2011 at 10:17 AM, Peter Dimov <pdimov_at_[hidden]> wrote:

> Jeffrey Lee Hellrung, Jr. wrote:
>
> I'm having trouble parsing this (which error handlers? those in
>> boost::locale::format?), but it sounds like you accept that there may be
>> scenarios under which a syntax error should throw an exception...
>>
>
> No, I don't. As a practical matter, such scenarios occur approximately
> never. This can be used as an interview question if the candidate lists
> localization experience - it's a good trap.
>
> Consider for example a dialog box with 12 localizable texts. It makes no
> sense to abort its creation if the formatting or localization of the second
> text fails, and neither does it make sense to leave the rest of the texts
> blank or untranslated/unformatted. In practice, if these functions throw,
> you'll have to wrap each and every call with a try block, which is an
> obvious indication that these functions shouldn't throw.

Okay; note that I'm not necessarily advocating that throwing on errors
should be the default behavior. I'd believe that there are infinitely many
examples where you *wouldn't* want to throw, and that's fine, but somewhat
beside the point. I'll accept those with more experience on their word that
throwing behavior is "approximately never" desirable.

What about the part of what I said that you stripped off ("...or perform
some other task")? And which error handlers were we talking about here?

- Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk