W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2014

Re: [whatwg] [Fetch] API changes to make stream depletion clearer/easier

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 22 Aug 2014 08:20:12 +0200
Message-ID: <CADnb78jaHi+=zcPJec68sS_ea6SCChoG0J0nZOpcGWjcuNkb7A@mail.gmail.com>
To: James Graham <james@hoppipolla.co.uk>
Cc: WHATWG <whatwg@lists.whatwg.org>
On Fri, Aug 22, 2014 at 12:27 AM, James Graham <james@hoppipolla.co.uk> wrote:
> I think that adding an extra verb to the names to describe a consistent
> feature of the API is a mistake; it seems important when designing the
> API because it's a choice that you have to make, but for the user it's
> just part of how the API works and not something that needs to be
> reemphasized in the name of every piece of API surface. For example
> given a language with immutable strings it would be pure noise to call a
> method "appendAsNewString" compared to just "append" because all
> "mutation" methods would consistently create new strings.

So you argue for asX()? Perhaps bodyAsX() to make it clear what field
of request/response we're talking about. And then hasBody as property
or some such?

That works for me too. I agree that developers will likely learn what
is going on here quickly enough. And that if anything should have long
names, it would be some new API that would use more memory. Jake?

Received on Friday, 22 August 2014 06:20:37 UTC

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