Live data from Hacker News

Stop Paying Your jQuery Tax

samsaffron.com

81–90 of 90 posts

Re: Stop Paying Your jQuery Tax

#81
I think the world should just go back to rich client apps and forego the web browser development tax in general. At least consider something like GWT which let's developer code the server and client in Java and Google worries about how to optimize JavaScript.

Re: Stop Paying Your jQuery Tax

#82
post #79

Earlier quoted context omitted.

A strong reason to not do so is when you want some part of the page to be immediately enhanced with JavaScript (like a login form). If the page has many images and other resources, your users will have an awkward experience, with the scripts suddenly engaging at a time that feels arbitrary. While some scripts absolutely belong at the bottom of the page, it is a very good idea to decorate JavaScript widgets immediatel…

Simply have the widgets start as display: none -- or even better -- visibility: hidden until they are rendered with js. The css accompanying the widgets should do this.

Yes, that should be the case anyway: The widget shows itself when it is finished decorating. But even then, there's no sense in deferring decoration until after some other arbitrary resources have loaded.

Re: Stop Paying Your jQuery Tax

#83
post #34
post #28

Earlier quoted context omitted.

Agreed. Premature optimization is about "maybe", and feared performance loss. Responsiveness matters to users; to them, speed is a feature, insofar as they can perceive it. The "JQuery tax" absolutely is a real, and user-perceptible issue. "Avoiding premature optimization" can sometimes make it hard to undo poor design choices made early on that could have been avoided.

> Responsiveness matters to users; to them, speed is a feature, insofar as they can perceive it. The "JQuery tax" absolutely is a real, and user-perceptible issue. I think the evil of premature optimization is attacking the wrong target first. 80ms isn't a small amount, but moving script tags around could have more potential side effects than say using proper caching, minifying etc

Good point. This hadn't even occurred to me.

Re: Stop Paying Your jQuery Tax

#84
post #74
post #68

Earlier quoted context omitted.

Another telling gem is StackOverflow page doesn't even have a proper encoding declaration. They declare the encoding in the HTTP Response. Content-Type:text/html; charset=utf-8 That's totally proper. If you specify it again inside the HTML, are you gaining anything?

It's not wrong by itself, but making content encoding implied might become an issue later (e.g. load balancers or CDN, merging content or improving support on east-asian languages). It's likely they've never faced those kind of issues.

Again, it's not implied when you state it categorically in headers. If there's a CDN or load balancer out there which breaks your Content-Type headers it's much, much better to replace it with something which follows HTTP a bit closer.

Re: Stop Paying Your jQuery Tax

#85
post #84
post #74

Earlier quoted context omitted.

It's not wrong by itself, but making content encoding implied might become an issue later (e.g. load balancers or CDN, merging content or improving support on east-asian languages). It's likely they've never faced those kind of issues.

Again, it's not implied when you state it categorically in headers. If there's a CDN or load balancer out there which breaks your Content-Type headers it's much, much better to replace it with something which follows HTTP a bit closer.

Very often you don't have control over that. It might be managed by a different team of the organization or might be a poor product purchased by higher management. Or it could be a third party service. You have to code defensively.

Re: Stop Paying Your jQuery Tax

#86
post #37

Please go check out StackOverflow's source code before bandwagoning on this topic. This is shifting blame to the tools. The problem lies on StackOverflow's lacking design and not in jQuery. Pushing jQuery to the bottom of the page is trivial if you do proper HTML architecture. Pages should have only HTML. JS files only JS. JS files referenced at the very bottom of the body. Very simple. (if your asp/c#/* framework do…

Re "Pages should have only HTML. JS files only JS. JS files referenced at the very bottom of the body. Very simple."

I suggest you view the source of http://api.jquery.com/ready/ before making that assertion. If it was that simple why is the website providing documentation for jQuery not doing so?

Re: Stop Paying Your jQuery Tax

#87
post #78
post #53

Earlier quoted context omitted.

"Stop Paying Your jQuery Tax", that's an attention grabbing title with an attack on a free open-source project. It took you at least 20m to write that post, probably over an hour. You can't just say "oops".

1) If it took him a month to write that article, he could still say 'oops'. He's entitled to err. 2) It seems like you're the only one interpreting his post as an attack on jQuery. It isn't. You said in another thread that English isn't your first language. I'd suggest you temper your accusations in light of that knowledge. 3) Even if he were bashing jQuery, and even though it is a good and widely used framework, tha…

>You said in another thread that English isn't your first language. I'd suggest you temper your accusations in light of that knowledge.

As a native English speaker, I would like to point out that alecco is _correct_ when he interprets the article as slinging mud at jQuery; there is nothing wrong with his/her English vis-a-vis his interpretation of this article's title. The fact that you would tell him/her to pipe down because he's not a native speaker is disgusting and xenophobic. As a side note, your comment about alecco being "the only one" interpreting the post as attack on jQuery is completely false. S/he's dead on about it being what I call a DCA, or "deliberately contentious assertion", designed to win more page views than an article merits.

Honestly, if alecco were expressing an opinion with which you agreed, would you still be saying s/he 'just doesn't understand the article due to poor language skills'? Or do you reserve this treatment for those foreigners who dare disagree with you? The fact that you dug thru alecco's comments in other threads to find this ad-hominem rock to sling... the reason you had to mention his/her non-native speaking comment from another thread is because alecco's English is good enough that you wouldn't know s/he's a non-native speaker from this thread.

Non-English natives are allowed to have opinions at variance with your own, sir or madam. Leave

Re: Stop Paying Your jQuery Tax

#88
post #87
post #78

Earlier quoted context omitted.

1) If it took him a month to write that article, he could still say 'oops'. He's entitled to err. 2) It seems like you're the only one interpreting his post as an attack on jQuery. It isn't. You said in another thread that English isn't your first language. I'd suggest you temper your accusations in light of that knowledge. 3) Even if he were bashing jQuery, and even though it is a good and widely used framework, tha…

>You said in another thread that English isn't your first language. I'd suggest you temper your accusations in light of that knowledge. As a native English speaker, I would like to point out that alecco is _correct_ when he interprets the article as slinging mud at jQuery; there is nothing wrong with his/her English vis-a-vis his interpretation of this article's title. The fact that you would tell him/her to pipe dow…

It wasn't meant to be an attack. The point was that I felt Alecco was being overly harsh, if not in this particular post, in others on that thread.

I didn't dig through their history for a rock to sling, but they mentioned it elsewhere in the same thread.

I don't have a dog in this fight regarding the article. It isn't an opinion I particularly agree or disagree with. I have no affiliation to the author, to the blog, or to any of the individuals I've remarked in this thread. I also like jQuery, so if anything, I'm arguing from the same bias as Alecco, in that I think it is a very high quality open source implementation of an amazing JS framework. I even read through the article multiple times to seek out the jQuery bashing Alecco alleges. I can't find it.

At first, I thought it was a popular opinion, until I realized that each of the remarks I believed to be overly negative were from the same person.

There wasn't any malice intended except to say "Hey, lighten up. People are allowed to make mistakes." One of the tenets I believe is core to Hacker News working is the assumption of good faith. I don't believe that Alecco was deliberately trying to malign the author, but the statements certainly come off as though they did not assume good faith.

I have tried to do so here, as in my original comment, but I do not believe you have extended me the same courtesy.

In the interest of promoting civility, I'll disregard your final remark, except to say that English is also not my first language.

Re: Stop Paying Your jQuery Tax

#89
post #88
post #87

Earlier quoted context omitted.

>You said in another thread that English isn't your first language. I'd suggest you temper your accusations in light of that knowledge. As a native English speaker, I would like to point out that alecco is _correct_ when he interprets the article as slinging mud at jQuery; there is nothing wrong with his/her English vis-a-vis his interpretation of this article's title. The fact that you would tell him/her to pipe dow…

It wasn't meant to be an attack. The point was that I felt Alecco was being overly harsh, if not in this particular post, in others on that thread. I didn't dig through their history for a rock to sling, but they mentioned it elsewhere in the same thread. I don't have a dog in this fight regarding the article. It isn't an opinion I particularly agree or disagree with. I have no affiliation to the author, to the blog,…

I apologize for the last word of my reply. I'm not sure why it was truncated, it just said "Leave".

Re: Stop Paying Your jQuery Tax

#90
post #85
post #84

Earlier quoted context omitted.

Again, it's not implied when you state it categorically in headers. If there's a CDN or load balancer out there which breaks your Content-Type headers it's much, much better to replace it with something which follows HTTP a bit closer.

Very often you don't have control over that. It might be managed by a different team of the organization or might be a poor product purchased by higher management. Or it could be a third party service. You have to code defensively.

Rest assured, I've been in that sort of situation. However I've never found it viable long term to take on additional complexity rather than pushing back against a group which is obstructing progress - ultimately you're accepting more work and risk to help reduce the pressure on them to stop underperforming.
Post reply on HN