5 ms·
And yet by "keeping it simple" you have to re-write and maintain a bunch of utility functions that are solved problems.
by jonknee 9y ago
And yet by "keeping it simple" you have to re-write and maintain a bunch of utility functions that are solved problems.
- megous 9y agoIf it's for some gain, then why not. It's a trade off decision.
- rhizome 9y agoIf they're solved problems, what difference does it make what form and package they arrive in?
- Touche 9y agoYou say that as those jQuery is the only place you can get a addClass function without writing it yourself. It isn't.
- jonknee 9y agoNot at all, OP said "if one wants to keep things simple with a minimal/nonexistent build system" which would exclude the easiest ways to get one-off utility functions.
- no_wizard 9y agoWouldn’t this be an argument for adding those solved problems to JavaScript as like a standard library? I’m not a web developer by day so forgive me if I don’t know all the nuance of JS but I feel like what you would consider it’s “standard” functions is quite small.
- city41 9y agoThat is generally the long term solution, and the reason this website is saying jQuery is no longer needed (because modern browsers offer a much better and more consistent foundation). The problem is the short term. While waiting for browsers to catch up and add new things, we usually have to polyfill, hence this debate.
- madeofpalk 9y agoFor what it's worth, it already is. https://developer.mozilla.org/en-US/docs/Web/API/Element/classList https://developer.mozilla.org/en-US/docs/Web/API/Element/cla... Builtin functions for adding, removing, toggling and querying classes on elements.