Re: gnomecard problems

> Well, this is an age old dispute... Any routine that can legitimately
> return NULL should be checked for return value, obviously. But I'm still


> in the old fashioned camp who does not believe in defensive programming. 

I'm too prone to mistakes so I ended up doing it anyway.  Some people can
program well, I have good style but I'm too slow because I don't do things
like check exit values so I spend 15% programming and 85% debugging.

> In the same vein, I'm quite unhappy about GDK and Enlightenment's habit of
> catching segmentation violations. I always take them out of my builds,

You are right there on enlightenment's problem.  In one of the releases of
CVS I tried, it didn't clean up after itself when you tried to exit from
it leaving X in a wierd state.  But I would have much rather it core dump
than doing wierd things.

> because without smoking gun it's close to impossible to find out which
> part of this sizeable piece of code blows up (not to mention that a
> current build of Mozilla requires "kill -9" to bring down, because it
> segfaults at exit and the gdk error handler catches it).


> To add insult to injury, rumor has it that much of the stability
> enhancements in Windows 3.11 over 3.0 came from just ignoring error
> conditions. We all know where that landed the users eventually :-)

Hey it's mickey soft, what can we expect? :)  In any case, what I really
had in mind when I say catch the segfaults is to maybe redirect it to some
sort of debugging file or something.  Output could be "referencing NULL
pointer in line blah in file blah.c".  I would never expect this stuff in
production code, because as you bulletproof each section you remove the
checks.  However, work in progres like GNOME should ideally have them.
In the end it's really up to the choice of the programmer and what he (or
she) feels comfortable doing.  You do have programmer egos to deal with.
;)  (I don't know how many times I've said, "there is no WAY I'd ever
reference a pointer like that!"


Sri Ramkrishna         /|\ Unix is very user friendly, its just very picky
email: -|- on who it is friendly to. -- Unknown? 
phone: 503-645-4868    \|/ 

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