Bad array indexing is considered deadly

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 1 07:48:29 PDT 2017


On Thu, Jun 01, 2017 at 02:04:40PM +0000, Guillaume Piolat via Digitalmars-d wrote:
> On Thursday, 1 June 2017 at 09:46:09 UTC, Ola Fosheim Grøstad wrote:
> > On Thursday, 1 June 2017 at 09:18:24 UTC, Guillaume Piolat wrote:
> > > Even with consumer software, you may want to crash immediately so
> > > that you actually get complaints from testers/buyers instead of
> > > having a silent, invisible bug that no one will report ever.
> > 
> > No. You don't want to crash immediately. In fact, you want to save
> > and recover. Preferably without much work lost and without the user
> > being bothered by it.
> 
> Solved by auto-saving, _before_ the crash

Yes.  Saving *after* a crash was detected is stupid, because you no
longer can guarantee the user data you're saving hasn't already been
corrupted.  I've experienced over-zealous "crash recovery" code in
applications overwrite the last known good copy of my data with the
latest, most up-to-date, and also most-corrupted data after it detected
a problem. Not nice at all.


T

-- 
Question authority. Don't ask why, just do it.


More information about the Digitalmars-d mailing list