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

On 21/08/14 18:52, Jake Archibald wrote:
> "take" was suggested in IRC as an alternative to "consume", which has
> precedence http://dom.spec.whatwg.org/#dom-mutationobserver-takerecords
> 
> I'm still worried we're querySelectorAlling (creating long function names
> for common actions), but I can live with:
> response.takeBodyAsJSON().

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.

Received on Thursday, 21 August 2014 22:27:28 UTC