6 ms·
Touché -- I am attempting to make a distinction between the general statement of "javascript slows the web down" to a certain type of Javascript slows the web d
by dimitrios1 6y ago
Touché -- I am attempting to make a distinction between the general statement of "javascript slows the web down" to a certain type of Javascript slows the web down, namely lazy and careless Javascript slows the web down. We reach for the dependency first instead of carefully analyzing our requirements and making an engineering decision. I've seen it countless times, fallen victim to it a few times myself. It's really easy to do. No one stops to ask, "perhaps we do not need a hard dependency, and need to include that 15kb library, but rather just need a few functions from it?" or "perhaps a simple algorithm would indeed suffice." We mindlessly reach for complex regex engines to solve simple parsing problems, try to garner "functional programming cred" by reaching for a series of collection functions from our favorite 50kb utility package when a simple c-style for loop would have not only sufficed, but indeed got the job done much faster.
All this results in bloated, unoptimized javascript bundles. To top it off, we under cache, and aggressively cache bust, and ship unminified bundles with oodles of source maps because of "developer experience" I can't tell you how many times I see, to this day, a fortune 500 company bundling an entire unminified javascript framework. Wirth's law indeed.
Hope this was a little less empty. These are my observations having done this for a few decades now and managing developers these days.
- joosters 6y agoI agree with all you are saying, but I wonder how much this actually comes down to software developers. I suspect (but have absolutely no data!) that for many sites, the pressure to add extra stats, tracking, advertising, monitoring, etc etc, comes from 'above' and it's not the developers' choice to add these mountains of javascript libraries to their sites. Perhaps they should push back, but what leverage do the developers have?
- trhway 6y agopretty much like enterprise software. The similar situation allows for an obvious for many conclusion - there is no money in performance, or more exactly the opportunity cost of performance is higher than benefit.