[SDL] Bug with wince

Vincent R. forumer at smartmobili.com
Thu Apr 23 10:12:26 PDT 2009


>----- Original Message ----

>From: Pavel Dudrenov <dudrenov at gmail.com>
>Subject: Re: [SDL] "Text has zero width" isn't an error.
>
>By your definition a well designed library should <del>protect users
>from all their errors</del> write code for you.

Not at all.  By my definition, a well-designed library should make
errors easy to find and fix.  A segfault that crashes the program and
(maybe) leaves you with a core dump is hardly an easy fix case.
Since C doesn't have exception handling, (and C++'s version isn't
worth the bits it's printed on, so to speak,) the best thing to do is
to return an error code in critical situations, or handle it internally,
usually by doing nothing, if that's a realistic and feasible option.

It's still the programmer's responsibility to write the code to check 
for error conditions.  That's why I like assertions.  They make
tracking down errors much simpler, and their performance impact
is negligible in most cases.  (Unless of course one fails, in which
case you've got bigger things to worry about.)




More information about the SDL mailing list