by alextgordon · 10y ago · 0 comments
> I like to keep it simple and just use fetch. It’s promise based, it’s built in Firefox and Chrome, and it Just Works (tm). For other browsers, you’ll need to include a polyfill.
I laughed. Is this satire? There's no reason to have X, therefore you need Y and Z to replace X. It just works.
X = a huge workshop with a million tools, a table saw, ladders, and yes, a hammer and some nails
Y = some nails
Z = a hammer
You need to hammer stuff as part of your job. Yeah, if you get rid of X you need to replace it with Y and Z, but it still seems like simplifying to me, if you're replacing a whole room full of tools with just the tools you actually need.
If the hammer and nails were actually better, then fine. But there's nothing actually wrong with $.ajax, that I can tell.
I'd happily include a 9kb (unminified) polyfill and work off the assumption that I can remove it a few years down the road.
$.Ajax is awesome and while XMLHttpRequest is awkward it's pretty straight forward.
And the whole point of TFA is that this is not the case. You can argue that it is, but not without getting into specifics.
Merely asking how can 2 things be simpler/smaller/better than 1 thing without taking into account what those 3 things are, makes absolutely no sense.
So I'm unsure what kind of complexity you're adding by using it. Mental? Spiritual? Metaphysical?