W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2013

Re: comments on Matrix

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 21 Mar 2013 11:26:53 -0700
Message-ID: <CAAWBYDDSgzQ3uX=K4YE-hGnqBeMZyKSe1ViLHbesu3Smej_uLw@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: Benoit Jacob <jacob.benoit.1@gmail.com>, "public-fx@w3.org" <public-fx@w3.org>
On Thu, Mar 21, 2013 at 11:21 AM, Rik Cabanier <cabanier@gmail.com> wrote:
> Direct2D also refuses to do the inversion:
> http://msdn.microsoft.com/en-us/library/windows/desktop/dd372277(v=vs.85).aspx
> Given that all the libraries refuse to invert and all of Adobe's graphics
> applications (such as Photoshop and Illustrator) do the same under the hood
> with no ill effects, let's not do this by default.
>
> If you feel very strongly, we can provide another call that never throws. We
> would have to change the IDL of the matrix interface though since it could
> now contain unrestricted doubles.

This is very much the wrong decision.  Throwing is a *very* disruptive
thing in Javascript.  You don't just "catch it and abort", because
there's rarely a reason to assume that any given calculation will
fail.  Do you wrap try/catches around every single matrix inversion in
your code?  Of course not.

Web APIs should *not* be throwing except in actual exceptional error
situations.  When possible, they should fail gracefully.  Anything
else is just asking for pages to die for no good reason.  The fact
that this can throw or not depending on the precise algorithm/number
implementation underneath makes it even worse.

If you'd like to track whether or not the inversion failed, so authors
don't have to check the matrix themselves, add a flag.

I'll formally object to an exception being thrown here.

~TJ
Received on Thursday, 21 March 2013 18:27:39 GMT

This archive was generated by hypermail 2.3.1 : Thursday, 21 March 2013 18:27:39 GMT