Re: [whatwg/encoding] Add Streams support (#72)

> In my opinion, option 1. is the clear winner here, requiring no extra effort for someone who already knows about TextDecoder.

That assumes that the user of the API just tries stuff and sees if DWIM magically happens. For an API user who works from understanding what they use, 1. is arguably more obfuscated than 3., because it's considerably less clear _why_ 1. works, so it's less likely that an API user who works from the point of view of understanding stuff would expect 1. to work.

> I think the "distinct state" approach to 1. avoids all surprises

Why? 1. has the most DWIM and, as a result, has the most opportunity for surprises.

> Here I think 3. probably wins, but at a high price in verbosity.

1. is obviously fewer characters to write than 3., but I think we shouldn't minimize the number of characters to write at the cost of API understandability.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/72#issuecomment-376124081

Received on Monday, 26 March 2018 10:45:55 UTC