3 ms·
Gosh, a framework? Their job is to show examples on how to use ~~web attributes~~basic web elements and pure Javascript. Which is btw exactly what MDN does as w
by onli 8y ago
Gosh, a framework? Their job is to show examples on how to use ~~web attributes~~basic web elements and pure Javascript. Which is btw exactly what MDN does as well on those function pages. jQuery has no place there and the modern web developer crowd (which I'm not a part of) even regards it as legacy, to be replaced with React etc. No, the focus on the real basics is exactly right.
- bastawhiz 8y agoBut they're rarely "the basics". Search for Ajax on w3schools and you'll be greeted with code samples for loading XML CD catalogs and replacing the contents of <div>s with HTML loaded without error handling. And of course, there's no explanations for any of it. It's never been "the basics," it's never been about quality, it's a content farm to pull in junior devs with outdated copypasta so they can show ads. Plain and simple. jQuery is not sexy or modern, but w3school's supposed tutorials are ancient, teach bad practices (find me an XHR example that doesn't use ready State), and work objectively less well than their framework (or modern JS) counterparts. For the market they're serving, they're leading to _worse_ software being built.
- onli 8y agoThat's not fair. The article you mention is https://www.w3schools.com/xml/ajax_applications.asp https://www.w3schools.com/xml/ajax_applications.asp, and it comes after a sound and basic introduction of the XMLHttpRequest element. > find me an XHR example that doesn't use ready State I absolutely see no problem with using readystate. > and work objectively less well than their framework (or modern JS) counterparts Come on, that's silly. What's called modern JS and what those super heavy framework use are in no way objectively better. To confront beginners with all their overhead (build tools for JS! Just crazy) is in no way helpful.
- bastawhiz 8y ago> I absolutely see no problem with using readystate. We have a load event now. Ready state is the legacy cruft left behind by Microsoft a decade ago. Let's not confuse new devs with magic numbers and convoluted events that are often cargo-culted incorrectly. > To confront beginners with all their overhead (build tools for JS! Just crazy) is in no way helpful. People have been dropping a jQuery CDN script tag on their pages since well before most build tools were invented. W3schools has _multiple_ "tutorials" that could be replaced with $('...').load('...'). It's rich when HN complains about websites that do things like break middle click and browser history and lack error states, but then advocate for trash code like w3schools peddles that makes these bad practices more common.
- onli 8y agoIf you are only talking jQuery when referring to frameworks my bloat and build tools arguments don't apply, that was for real frameworks like react. jQuery is fine in that regard, it's just not the modern choice anymore, without being vanilla js. It would be strange to boost a legacy solution like that.