| 
      
      
      From: Ethan B. <ebl...@cs...> - 2003-02-25 18:57:46
      
     | 
| Nathan Conrad spake unto us the following wisdom:
> I've noticed that in a lot of places in gaim, there are comments like
> 'this should never happen', and such. I am wondering why the
> g_assert(...)  function is not used in gaim. It would alert people
> that these unreachable cases are being reached. IMHO, an assertion is
> better than just letting the functions return without flagging an
> error.
There should only be assertions in places where the failure would be
fatal anyway, but perhaps harder to find.  Randomly asserting for
things that are not fatal but perhaps not completely correct doesn't
buy anyone anything...
Although perhaps a debug_printf would be appropriate.
> +               if (!who || !*who) {
> +                       /* this shouldn't ever happen */
>                         return;
>                 }
In this case, I assume this return statement prevents gaim from doing
anything Bad (like crashing) and probably doesn't affect the operation
of the program in such a way that a forced crash (assertion) would be
superior to silent failure.  If silent failure *is* in fact a problem
here, this check should not have been made.
Ethan
--=20
Happiness is a belt-fed weapon.
 |