[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DeviceKit and /usr



Josselin Mouette <joss@debian.org> writes:
> Le lundi 07 septembre 2009 à 20:00 +0200, Giacomo A. Catenazzi a
> écrit : 
>> Steve Langasek wrote:
>> > Case 1, please.  Either case 2 fails to handle the allocation error, or glib
>> > is doing its own abort.  Neither is acceptable.
>
> Yeah, sure. As if there was anything more sensible to do than aborting
> when a memory allocation fails. When this happens under Linux, the
> application will end up OOM-killed really soon anyway.

Even so, case 1 documents the author's intentions.  Case 2 leaves us
wondering whether the abort is intentional or not.

Trusting a library to do all your error handling and cleanup is not good
style IMHO.  In addition to the lack of self-documenting source, it
often leave you with the meaningless generic error messages some OSes
are so full of.  Applications doing their own error handling are in a
much better position to provide specific meaningfull error messages to
the user.


Bjørn


Reply to: