The Twitter page is a perfect example of why we use JavaScript for this stuff: because full-page loads just to hide a div is a shitty user experience. Scroll positions jump around, you've made a client-side action into a server one, etc.<p>The whole of html is full of these. Let's be blunt: it's a terrible platform, just as JavaScript's DOM API is terrible. Everything about the web is bad, but we make it good thanks to the combined might of the computing industry.<p>JavaScript's a mediocre language being used to pave over the weaknesses of a layout engine that can't centre things vertically and can't navigate without slow server interactions unless you want to confuse the user with one long page full of #anchors.
The "You name a critical .js bundle something related to ads" point is something toward which I'm particularly unsympathetic. The fact that most ad blockers (a) are whitelist-based and (b) contain blunt-edge/naive implementations leads me to believe that false positives are the problem of the ad blocker developer and ad blocker user, not the developer of the website.<p>If Joe or Jane developer of Acme Demolition Inc. names a Javascript file `ad_main.js`, the burden of resolving the my-ad-blocker-is-blocking-this-file problem is not on them.<p>This is why I've yet to find an ad blocker that I would recommend to anyone without web development knowledge.
I think the root of the problem is that browser vendors break stuff all the time. A new browser comes out and now breaks your ten year old web page ... Then the web dev team says <i>fuck it</i> we'll only support Firefox and Chromium, and start using features that only works on those browsers.<p>Ten years ago, web dev was all about getting your page to work on all platforms. But today we have hundreds of possible combinations of OS x Browser x Extensions, so it's just impossible.<p>I try to only use browser features that are three years old and "standard". But not even that works.<p>Phone/Ipad browsers are the biggest offenders of breaking stuff.
You have some valid points about how we use javascript for many parts of our web pages that don't need javascript. I would love for the web to be fully accessible without javascript, but we have to remember that there are a small percentage of people currently using the web without javascript. Im sure twitter has their reasons for using javascript for the simple tasks that are solvable without the assistance of javascript. I would imagine that it wouldnt be cost efficient, if nothing else, not a top priority to make their site accessible without javascript due to the small user base that doesn't use javascript.
Given that Twitter is massively successful and used by millions everyday I don't think it is a good target for complaining about slow loading times and poor performing JavaScript. Often in business 'good enough' really is good enough. Gold plating code is something many developers (including myself) make the mistake of trying to do all the time. But the difference between 'good enough' and gold plating is often not worthwhile for the business.
I'm curious about two things.<p>A) What search hotkey to use if not '/'<p>B) Why does your JS load slow? Did you fix that part?<p>I build web-apps and try to think "JS second". I've noticed that my customers like fast loading, consistent pages. These "magpie" like decisions harm the customer experience.
The issues in the article are very similar to advices in some old book (from "yay, AJAX"-era) about JS I read in the past. Looks like not too many people took them to heart.