caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: Nicolas Boulay <nicolas@boulay.name>
Cc: Philippe Veber <philippe.veber@gmail.com>,
	Ben Millwood <bmillwood@janestreet.com>,
	Romain Bardou <romain.bardou@inria.fr>,
	 caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Uncaught exceptions in function type.
Date: Tue, 27 May 2014 23:51:53 +0200	[thread overview]
Message-ID: <9DB91B50B5AC4E5BB27A20B7BCAC2F16@erratique.ch> (raw)
In-Reply-To: <CAH+PdrDMomC7PwYftdzTjxeqDZuR=FKToztV8pycpv5cW5eEaw@mail.gmail.com>



Le mardi, 27 mai 2014 à 11:25, Nicolas Boulay a écrit :

> > Because that would be utterly annoying. You need to make the following distinctions:
>  
> Yes it could be annoying, but very high quality software become much harder to write. Refactoring is harder. Missing exception handler are harder to find.

That’s non sense. What would the programmer do if Array.create wouldn’t raise in case of invalid argument 99.9999999% of the code would read like this:  

let a = match Array.create n with  
| None -> assert false  
| Some a -> a  
in

You solved absolutely nothing by having an option type here. But you did manage to be annoying.
  
>  
> > * Exceptional errors, for errors that the programmer is unlikely to handle at all (e.g. out of memory). For that raise a custom exception. This should occur very rarely, you are unlikely to ever define one such exception.
>  
> That means intensive testing to be sur to avoid such failure for normal user input. For most long running programme (server, gui), that's could a problem.
>  
> For example, an undo/redo use lot of memory after some copy/paste on big data, then the save command have not enough memory to work, and the file are troncated. That's not acceptable, and can be see only with big data, after few high level command run.
That is certainly not something you want to solve by handling exceptions but by making sure/designing your program is able to function under a given fixed memory budget (if only to be able to test the error condition).  

Best,

Daniel

  reply	other threads:[~2014-05-27 21:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 14:23 Philippe Veber
2014-05-26 14:56 ` Romain Bardou
2014-05-26 15:13   ` Ben Millwood
2014-05-26 16:02     ` Philippe Veber
2014-05-26 16:34       ` Daniel Bünzli
2014-05-27  6:52         ` Philippe Veber
2014-05-27  8:42           ` Ben Millwood
2014-05-27 10:05             ` Goswin von Brederlow
2014-05-27 10:36               ` Ben Millwood
2014-05-27 11:24                 ` Yaron Minsky
2014-05-27 21:42             ` Daniel Bünzli
2014-05-27 21:16           ` Daniel Bünzli
2014-06-02  8:38             ` Goswin von Brederlow
2014-05-27  8:49         ` Goswin von Brederlow
2014-05-27  8:56           ` David House
2014-05-27 21:39           ` Daniel Bünzli
2014-06-02  8:31             ` Goswin von Brederlow
2014-05-27  9:25         ` Nicolas Boulay
2014-05-27 21:51           ` Daniel Bünzli [this message]
2014-05-30 18:03         ` Florian Weimer
2014-05-31 11:26           ` Daniel Bünzli
2014-06-02  8:43             ` Goswin von Brederlow
2014-05-26 15:25   ` Philippe Veber
2014-05-27  9:28     ` Goswin von Brederlow
2014-05-27  9:38       ` Romain Bardou
2014-05-26 15:33 ` Thomas Blanc
2014-05-26 16:04   ` Philippe Veber
2014-05-26 15:33 ` Gabriel Scherer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9DB91B50B5AC4E5BB27A20B7BCAC2F16@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=bmillwood@janestreet.com \
    --cc=caml-list@inria.fr \
    --cc=nicolas@boulay.name \
    --cc=philippe.veber@gmail.com \
    --cc=romain.bardou@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).