4 ms·
Why is this being down voted? This comment seems to be making a reasonable case. In case you disagree, you may want to reply why instead of down voting.
by vanviegen 5y ago
Why is this being down voted? This comment seems to be making a reasonable case.
In case you disagree, you may want to reply why instead of down voting.
- simlevesque 5y agoBecause fetch just landed in Node.js, making it a standard present in every context after like 5 years and he want to change the standard now. Edit: also, you are being downvoted because the etiquette on HN are that you don't ask "why was X downvoted".
- nailer 5y agoAs mentioned existing HTTP clients had this behaviour back in 2012, the designers of fetch chose to ignore these cowpaths in favour of a more minimal implementation requiring the use of third party HTTP clients in both browsers and node, simply to have reasonable defaults and not repeat oneself, for the foreseeable future.
- andreigheorghe 5y agothe value the js community gets from `fetch` being a unified standard is far, far greater than the benefit you as a developer would get from not having to add 15 extra LOC around `fetch`, that you'll probably hide behind a `fetchJSON` function anyway.
- deleted 5y ago[deleted]
- nailer 5y agoPoint is everyone had a slightly different 150 LOC or a library to achieve essentially the same thing. We could have stuck with ‘if index is not equal to minus one’ but we have array includes now for the same reason.
- lucideer 5y agoI didn't downvote, but my guess is its primarily a kneejerk reaction to the following line: > set JSON as the default request content type or something similarly subjective. Downvoting is going a bit too far, but bundling a few individual opinions on defaults alongside broadly accepted (implemented in both Node & Deno after much discussion) features seems... presumptuous.