tech-userlevel archive

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

Re: libcodecs(3), take 4

> At the same time, printing error messages is far superior to the
> practise of returning enumerated error values (like regexp
> libraries),

Uh...*what*??  This I have to disagree with.

An error from the library's point of view is not necessarily an error
from the application's point of view and does not necessarily deserve
to have anything printed anywhere.  As an extreme example, add a line
to your kernel to do a uprintf whenever open returns failure - you'll
rapidly see what I mean.

Furthermore, even when it _is_ an error and _does_ deserve a message,
the application can usually print a more meaningful message than the
library, because it has more context.  (As a simple exmaple, compare
"invalid regexp" with "invalid name pattern on foo.conf line 18".)

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index