W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2013

Re: [whatwg] Questions regarding Path object

From: Tobias R. <tag+whatwg@basecode.de>
Date: Fri, 15 Nov 2013 14:59:22 +0100
Message-ID: <CAF5s-tqYkErj+q5yQO7HLW00DpAGbZG38tJuArq5xLpddP-DRA@mail.gmail.com>
To: Jürg Lehni <lists@scratchdisk.com>
Cc: Juriy Zaytsev <kangax@gmail.com>, Rik Cabanier <cabanier@gmail.com>, "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>, Simon Pieters <simonp@opera.com>, Dirk Schulze <dschulze@adobe.com>, Dean Jackson <dino@apple.com>, Ian Hickson <ian@hixie.ch>
On Wed, Nov 6, 2013 at 12:41 PM, Jürg Lehni <lists@scratchdisk.com> wrote:
> On Nov 4, 2013, at 13:32 , Anne van Kesteren <annevk@annevk.nl> wrote:
>
>> Objects not having constructors is a bad API practice we are moving away from.
>
> I'm not sure everybody thinks so. There are whole libraries out there that avoid the use of 'new' in favor of functions that create the objects for you (e.g. Two.js, Raphael.js, etc). Douglas Crockford amongst others is advocating against the use of 'new' for a long time.

That's very subjective :)  No one is seriously advocating against the
"new" operator. Some people are pointing to the fact that
(accidentally) omitting the new operator can lead to unexpected
behaviour and that's it. "new" in fact creates a *new* instance.

> We're used to calling document.createElement(), etc. To me it feels strange that all of a sudden, browser provided functionality is not bound to a context, but is implemented by such a free-floating constructor.

The missing context can be actually considered as a feature. Sharing
functionality between "web" API (canvas / svg / css-mask) looks like a
big step forward.
Received on Friday, 15 November 2013 13:59:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:14 UTC