News for hackers. Stuff that matters.
Re:The Cost of JavaScript Frameworks by horsawlarway on Friday May 08, 2020 @01:56PM (#23117565)
Ok, so I generally agree with the content of the article.

I want to pick on the up front assumption though. He lists 4 costs that are paid -

---

The cost of downloading the file on the network

The cost of parsing and compiling the uncompressed file once downloaded

The cost of executing the JavaScript

The memory cost

---

What isn't mentioned is WHO'S paying those costs. And I think that generally matters when you're trying to convince companies with a profit motive that they're doing the wrong thing.

My issue is that of his 4 costs, 3 are all paid by the consumer of the product. The ONLY cost paid by the company is the extra network traffic to download the JS bundle. Even that can be optimized to a VERY small number if you're using good caching and have a cdn in place. The individual consumer might still wait for that network payload, but the company's objective cost is still going down.

So in general, what's the compelling argument that I should care about the rest of the article? None of it is bad advice. It just seems that the only real benefits I might get are two user features

- Faster sites

- Better battery usage

Users like those things, but they don't put them anywhere close to the top of the priority list for most products.

So I'm really walking away from this seeing a savings still. As a developer, I don't really love that opinion (I want to make good products that are fast and and small), but as a company stake-holder with a lot of possibly things to prioritize... This sounds like bad advice.

Re:The Cost of JavaScript Frameworks by nottorp on Friday May 08, 2020 @02:25PM (#23117864)
So basically we're getting shit slow apps as users because they're cheap to make.

As a user I thank you.

Re:The Cost of JavaScript Frameworks by claytongulick on Friday May 08, 2020 @02:32PM (#23117915)
Would it be better to not have the app at all? Time to market and dev costs are key considerations for startups. Many don't have the option or funding to do things perfectly.
Re:The Cost of JavaScript Frameworks by nottorp on Friday May 08, 2020 @02:34PM (#23117936)
90% of the cases... yes, it would be better.
Re:The Cost of JavaScript Frameworks by horsawlarway on Friday May 08, 2020 @04:56PM (#23119358)
Last I checked no one is making you use something you don't want to.

If you think you're better off without a product, don't use it and let the market work itself out.

Frankly, I mostly even agree with you. I rarely install more than 5 or so apps on my phone these days, and I visit a pretty paltry number of sites consistently, but that doesn't mean someone, somewhere, isn't getting value from those products.

One man's trash is another man's treasure.

Re:The Cost of JavaScript Frameworks by Can_Not on Friday May 08, 2020 @10:41PM (#23121741)
> Last I checked no one is making you use something you don't want to.

I just checked, my boss is making me use slack, and nobody is writing a non-electron competitor to slack...

Re:The Cost of JavaScript Frameworks by grumblestumble on Friday May 08, 2020 @04:24PM (#23119016)
Welcome to capitalism... If what you're building is solving a valuable problem, and you don't build it fast enough, someone else will build it quicker and shittier but still solve the problem. You're getting shit slow apps because you use them when they're delivered to you.
Re:The Cost of JavaScript Frameworks by horsawlarway on Friday May 08, 2020 @05:00PM (#23119407)
I mean, same reason high fructose corn syrup is in most of the foods we eat...
Re:The Cost of JavaScript Frameworks by peterburkimsher on Friday May 08, 2020 @03:13PM (#23118324)
"WHO's paying the cost" - it's not even always the end user.

On Wednesday night, Anna (9 years old) said that Epic Books wasn't displaying properly (Chrome v49, WinXP). She wouldn't even have a computer if it weren't office trash a few months ago, and I brought it home to give to her. Now she depends on it for homeschooling during the lockdown.

Epic Books tech support insist that they will not provide support for old browsers. Anna has homework to do. Should the school district provide laptops? Someone has to make a decision about what hardware is needed for thousands of students.

Why does the school district need to spend $100k on brand new iPads? Because Epic Books want to use the latest JS framework.

Re:The Cost of JavaScript Frameworks by horsawlarway on Friday May 08, 2020 @05:16PM (#23119566)
Oh wait, I know this one!

>Why does the school district need to spend $100k on brand new iPads?

Because the school chose to use Epic Books.

Re:The Cost of JavaScript Frameworks by peterburkimsher on Friday May 08, 2020 @06:00PM (#23120024)
The problem is a complex client-provider relationship. The end user (children) don't make the purchasing decision. The ones choosing the software (teachers) have no control over the hardware. The ones choosing the hardware (school tech admins) have no idea what the teachers really want or need.

But the child will be punished if they don't do their homework. I think that's a grave injustice. It's not her fault that the school didn't provide the tools. We should be encouraging people to learn when they want to, not making it hard for them!

Healthcare is another area where there's a complex client relationship between doctors, insurance companies, and patients. I really think that developers in education and health are doing important work to save lives, but the capitalist approach of prioritising the person who pays isn't that simple.

With those fields, it shouldn't be just about money. On that note, I liked this comment yesterday: "hey, will you help me move? I'll pay you $21.58 for your time," I'd probably bristle. Even though that might be the equivalent price of a few slices of pizza and a beer" https://news.ycombinator.com/item?id=23106932

Re:The Cost of JavaScript Frameworks by horsawlarway on Saturday May 09, 2020 @10:56AM (#23125163)
I don't disagree with you, I just think you're placing blame in the wrong spot.

The decision that harmed the child was made by the school. The entity that has the power in this situation is NOT company selling the product, it's the purchaser that chose to use them.

The school is the immediate and obvious place to resolve the issue, and that's why the school is responsible for the new costs (or alternatively - Choosing a new provider).

I think it's an incredible oversimplification to assume that a company is updating "just because", and that they've done it without any consideration.

I'm not bullshitting when I say I've seen multi-year discussions about when/where we can afford to drop support for a particular devices/system.

It's a constant analysis of

- What does the upgrade buy us?

- What does losing those users cost?

- What relationships will be damaged?

- What impact does it have on company morale?

And the answers to all of those questions vary over time, as the user base changes and new systems are released.

Basically - I promise the company acted in a way that they believe will help themselves and their customers most. They might be wrong, but who cares? No one is omniscient, we're humans not gods.

So does updating happen to hurt this one kid on an older device? Yes. No on is happy about it, but they believe that the compromise was justified by the benefits it brings to all their OTHER users. Who they are also responsible for thinking about.

----

Now, I strongly agree that products that are purchased by people who don't use them tend to be inferior. But again, I find it hard to blame the developers of those products because the unfortunate reality is that when the person buying and the person using are different, usually the buyer just comes in with a checklist of "features" and selects the product that checks the most boxes. That means the company selling the product is forced to act in a way that checks boxes instead of making happy users.

But again, the solution to that isn't to blame the developer - The solution is to make actually using the damn product a requirement of the purchasers job description. And again, only the school can do that.

Now, the final ugly bit of this is as follows - You cannot wave a magic wand and make all problems disappear. There will always be better/worse outcomes for different parties after a decision is made. Maybe the school purchaser DID actually use the product, and DOES actually want the features a new upgrade brings, and has done exactly the same calculations for their school district that the company made, and has STILL decided to use that product even though it happens to hurt you, because they believe it helps more folks.

I can't help you with that, but it does bring to mind the quote from Churchill

>Many forms of Government have been tried, and will be tried in this world of sin and woe. No one pretends that democracy is perfect or all-wise. Indeed it has been said that democracy is the worst form of Government except for all those other forms that have been tried from time to time.…

It's a shitty situation and if you know how to make it better, let me know...

Re:The Cost of JavaScript Frameworks by austincheney on Friday May 08, 2020 @03:26PM (#23118468)
What you are describing is an ethics problem common to software. Developers are putting their self interest before the product arguing its necessary because otherwise it would take too long, be too challenging, or too expensive. Those could be valid arguments, but they are entirely unqualified, and without supporting data remain invalid and self serving to the developer.
Re:The Cost of JavaScript Frameworks by horsawlarway on Friday May 08, 2020 @05:13PM (#23119536)
I can't honestly take this opinion seriously.

The problem is that - as currently structured - your ideology demands that another party enter into an exchange or agreement that they don't believe is beneficial to them.

I don't actually give a flying fuck whether the "developer" you've outlined in your post is right or wrong with their opinion. They have the right to make and sell the product they believe will benefit them the most. Could they be wrong? SURE! And if they're wrong often enough or long enough they usually go out of business (usually... some caveats here around monopolies/markets/regulation/etc).

So I'm not really sure why you see an ethics problem. If it truly is self-serving and invalid reasoning, why not put your money where your mouth is and do it better?

Basically - Step up or shut up.

Re:The Cost of JavaScript Frameworks by austincheney on Friday May 08, 2020 @05:29PM (#23119695)
> They have the right to make and sell the product they believe will benefit them the most.

If you honestly believed that you would advocate for more qualified data oriented decisions about your software to ensure the decisions at present aren’t wasteful and inefficient.

And that’s what makes software unique: ethics aren’t of value in this line of work. Developers frequently make unqualified decisions for their own self interests in conflict to their employers profit motive and in conflict to their user’s experience. If ethics were important you would serve as an advocate for your product as qualified with evidence.

Consider the difference if your medical doctor acted primarily in their own self interest for profit instead of primarily in the interest of your health. Consider how that same reasoning can extend to software developers who produce poorly tested medical equipment.

Yet somehow this reasoning seems to have offended you. I am unclear as to some ideology that you speak of.

Re:The Cost of JavaScript Frameworks by horsawlarway on Saturday May 09, 2020 @10:21AM (#23124906)
You're just filling comments with strawman arguments now.

Good luck with life buddy.

Re:The Cost of JavaScript Frameworks by thinkloop on Friday May 08, 2020 @02:42PM (#23118029)
When the article mentions costs they mean in terms of performance for the user. Faster sites and better battery have been objectively shown to be material. Users don't know to vocalize it, but they bounce from fat slow sites.
Re:The Cost of JavaScript Frameworks by ferzul on Friday May 08, 2020 @02:47PM (#23118067)
i think the battery cost of websites and even apps is fairly well invisible to users. there's certainly facilities which say how much battery some app has used, but if it's a frequently used app it's a tautology.

users don't care because they can't. the can pick battery life when they buy their phone (at the expense of important features), but they cannot optimise at any time thereafter. most people who would care are rational and since they can't they don't

therefore, it is browser and os developers who need to act to stop these costs being externalised. show current battery consumption rate for this app/page in the status bar. then, people will start complaining about dirty webpages

Re:The Cost of JavaScript Frameworks by forgotmypw23 on Friday May 08, 2020 @02:48PM (#23118068)
if your js is small, you can avoid two of the costs by inlining it.
Re:The Cost of JavaScript Frameworks by biryani_chicken on Friday May 08, 2020 @03:32PM (#23118533)
And download it every time? It is better to download it once and tell the browser to cache it.
Re:The Cost of JavaScript Frameworks by horsawlarway on Friday May 08, 2020 @05:20PM (#23119604)
If it's inlined into another static resource, why not just cache that? HTML with an inlined script is just as valid a cache object as the plain script itself.