Hacker News new | ask | show | jobs
by tobr 1995 days ago
Yet another case of documentation saying “JS” when they mean “React, specifically”. Every single example I can see here uses React, but if this deserves the CSS-in-JS moniker, please give at least one example of usage with vanilla JS. It’s like peak jQuery all over again.
1 comments

We're probably at that point again where a developer 'knows' React but will completely flounder when faced with anything outside of that ecosystem. Same with jQuery, same with Rails and Ruby.
I see it all the time.

Tons of developers coming out of bootcamps (and even a few designers with no coding experience) who know how to string together a few react components but have problems with basic JS.

It's not necessarily bad, it's just higher level coding. What's bad is when these people get hired as engineers.

I've started seeing this quite a lot recently when working with beginners. Worst one recently was someone who had extreme difficulty understanding how to make different web pages using only HTML, but much more mild versions of this have been cropping up in frequently for me over the last year.
Since JavaScript evolved to incorporate many of the APIs that jQuery pioneered at some point knowing only jQuery was not such a problem.

But even before this evolution much of jQuery was just sugar to make cross-browser problems manageable.

I am not actually aware, I think, of any developer that just knows React but if they exist I suspect they would have an even harder time of it when deprived of their favored framework than those developers back in the day that just knew jQuery.

Query selectors likely came from jQuery's Sizzle engine, but most of the jQuery APIs, all methods, were never adopted. The best I can think of that did get adopted is closest which uses a query selector to find a matching ancestor node.

The reason why most of the jQuery approach is not adopted is because it is so incredibly slow. First you have to consider that query selectors, at their best performance (Google Chrome), are about 460x slow than the old DOM methods. All the jQuery approaches would be slowness that multiplies on top of the already slow query selectors. In Firefox query selectors are about 10,000x to 250,000x slower than the standard DOM methods.

From a standards perspective there is no incentive to go down that path as it cripples the interface it describes.

I was pretty much thinking just of query selectors as I think that would be the most problematic thing for a jQuery trained developer to do without.