Null references (oh no, not again!)

Sean Kelly sean at invisibleduck.org
Wed Mar 4 09:58:21 PST 2009


Denis Koroskin wrote:
> 
> Most people can't afford their applications run on a few computers just 
> in case one of them fails.

Maybe not, but everyone can run a multi-process application, 
particularly now that multi-core computers are the norm.

> No doubt, Google Chrome is a beautiful piece of software. It doesn't 
> crash the whole browser when something is null-dereferenced. But the 
> message I've been writing for half an hour is *lost* anyway when the 
> host process fails.

Not necessarily.  The host process might have been logging your actions 
or performing periodic backups and recover automatically when restarted. 
  If the app isn't designed this way then the programmer clearly didn't 
think your message was important enough to try and save :-p

> The way you suggest writing software is like a doctor who suggests 
> curing/hiding symptoms rather than the cause of an illness. You 
> shouldn't rely on exception recovery when you may avoid the whole class 
> of bugs altogether.

This is a fair point, but I think the issue is more the cost of this 
avoidance... and I suppose whether the avoidance really is avoidance or 
whether it's a placebo.



More information about the Digitalmars-d mailing list