Remix.run Logo
paxys a day ago

200 bytes for the business logic.

47MB for the UI & boilerplate around the business logic.

I get that this may be the easiest way to develop and publish an application today, but it's sad that this is the direction we have taken in recent years.

aeonik a day ago | parent | next [-]

Modern app bloat in one analogy:

Business logic size: ~20 bytes Total app size: ~47 MB = 47,000,000 bytes

Bloat factor: 47,000,000 / 20 = 2,350,000

Let’s scale this up and say the business logic is 1 pound.

Then the whole app would weigh: 1 lb × 2,350,000 = 2,350,000 pounds

What weighs ~2.35 million pounds?

   - A fully loaded Boeing 747-8: ~987,000 lbs  
   - Another fully loaded 747-8: ~987,000 lbs  
   - A blue whale: ~330,000 lbs  
TOTAL: ~2,304,000 lbs

The business logic is like shipping a 1 lb object (a book, a flash drive, whatever) by loading it into two fully loaded 747s and strapping a blue whale on top.

Just to run 20 bytes of logic.

WD-42 a day ago | parent | next [-]

This is a cool visualization, thanks.

aquafox a day ago | parent | next [-]

On a related note: Transporting a human in a car is (in relation to weight and size) like using a standard shopping cart to transport two 1L bottles of water. So the next time you walk through a pedestrian area, imagine everyone carrying a bag would use a shopping cart instead. That would be a huge traffic jam -- exactly like what you see on the road!

WD-42 a day ago | parent [-]

I've been pretty aware of this ever since I became a cyclist. I will ride down to the corner store to pick up a six pack and some chips, throw them in a backpack and ride back. It's easy. I see people driving their cars to do the same thing. All that weight and space for a 6 bottles of beer. There is massive waste all around us.

spiritplumber 10 hours ago | parent | next [-]

A long time ago in San Antonio TX I was pulled over by the cops while biking back to my little apartment with a bunch of groceries. They were unwilling to believe that an adult would leave the car home to get groceries by bicycle.

(I'm from Italy originally).

bjelkeman-again 6 hours ago | parent [-]

We experienced the same when we walked down the hill to go shopping in Laguna Niguel, CA. Stopped by cops for walking to the store. Nothing more happened.

lostlogin a day ago | parent | prev | next [-]

There is also the time component. Off peak and with a decent sized backpack (change of clothes, laptop, food etc) it takes me the same time to go 6km as it does to drive it.

At peak it’s 1/4 to 1/3rd the time.

Cars are slow around town.

Zambyte 6 hours ago | parent [-]

The time component has to factor in both the traffic while driving, and the extra time required to find available parking. I bought an electric scooter a few weeks ago, and I have come to realize that my travel time is pretty much purely a function of distance. I just roll up past traffic if there is any, lock up on any bolted down object, do my business, unlock, and roll out.

If anything, I feel like traveling at rush hour is actually strictly better for me. Cars being slow doesn't slow me down, but with the average speed being so much lower during rush hour, it seems like it makes it so if a driver hits me, it would be at a lower speed.

tengwar2 21 hours ago | parent | prev | next [-]

It's a reasonable solution, but let's not forget that simply walking is often at least as good a solution in many countries.

ornornor 13 hours ago | parent | prev | next [-]

Getting a trailer (burley cargo in this case, but applies more generally) has been a game changer. I can even bike to ikea and bring back flat packed furniture with it. Or do the weekly groceries. The trailer can carry up to 100lbs iirc (I have an e-bike)

Short errands are much nicer with a bike: less effort than walking, much faster than walking, no parking headache at destination, cool breeze in your hair, and free (no gas, insurance, parking, tickets…)

bongodongobob a day ago | parent | prev [-]

Those people could be driving from 20 minutes away or on their way home from work, or running other errands or picking kids up from school or any number of things. Good for you though.

Zambyte 13 hours ago | parent [-]

Fortunately trains and buses exist.

sheepscreek a day ago | parent | prev [-]

I like your username, and what happened to WD-41?

WD-42 a day ago | parent | next [-]

It wasn't the correct answer.

sheepscreek a day ago | parent [-]

What was the question?

redundantly 19 hours ago | parent | next [-]

They're still working on that.

latexr 18 hours ago | parent | prev [-]

https://simple.wikipedia.org/wiki/42_(answer)

sheepscreek 15 hours ago | parent [-]

Haha - but of course!

d-lisp a day ago | parent | prev [-]

Incrementation ?

m3047 3 hours ago | parent | prev | next [-]

Very nice. Maybe that should be submitted to The Register for their units of measurement menagerie.

BobbyTables2 a day ago | parent | prev | next [-]

Excellent point!

And to top it off, the dual flights and whale would need complex orchestration too!

We just call it Kubernetes…

Eric_WVGG 2 hours ago | parent | prev | next [-]

bravo, Douglas Adams would have been proud

anon7000 a day ago | parent | prev | next [-]

Well, if you COULD ship something across the world on a private 747 with extra features to protect your cargo, and it has nearly no environmental downside and has no meaningful downside vs a smaller airplane… you’d probably do it! There’s no incentive in software to get a smaller, more efficient plane, and plenty of incentive to use the big thing for free that has all the extra features

GTP a day ago | parent | next [-]

> it has nearly no environmental downside and has no meaningful downside

I think this is not the case. E.g., we replace our computers every few years, but not because the new ones can do things that you can't do with your current computer. It's because the software you use to do the same things keeps getting more resource-hungry.

iknowstuff a day ago | parent [-]

Its called externalized cost and its as real in software as it is IRL

GTP a day ago | parent [-]

So the cost is there, it's just not paid (directly) by the developer. But we all end up paying someone else's externalized cost, included said developer that is paying some other developers' externalized costs.

josephg 19 hours ago | parent | next [-]

Yeah. I’ve been thinking of writing a blog post doing the math on that. If I spend $2000 on a computer, and that gets me a certain amount of ram and cpu and so on, we can figure out a dollar figure on that bloat.

Then multiply by the number of people who use a piece of software (eg slack) and we’d get a figure for the externalised cost of a piece of software.

aziaziazi 9 hours ago | parent | prev | next [-]

Consider also the missed market opportunity: my personal devices are 13yo laptop and 9yo phone. If an app isn’t compatible or makes it lag, I delete it and download a competing one. I’m not alone, and yes: I have money to spend on your app. I just don’t want/need to upgrade hardware that often.

jorvi 12 hours ago | parent | prev [-]

Worst offender being Google, who toggled on VP8 / VP9 decoding on YouTube despite the vast majority of devices only having h264 hardware decode.

The aggregate waste in battery wear and watts spent is pretty staggering when you think about it, all so google could spend a few cents less per 100 streams.

HappMacDonald 3 hours ago | parent [-]

Or they could just send the video uncompressed and then it would take even less hardware resources to decode on the client side. Why, in a sense it would be a lot more like decoding analog television signals at that point. (Not least of which since few clients would have the network bandwidth to handle more than 360-480p of that ;)

dented42 a day ago | parent | prev | next [-]

That analogy doesn’t really work here. Because there is a downside. It’s slow, takes up a ton of memory, lots of disk space…

When you have so many processes on a modern machine competing for resources, when every app chooses to be bloated and slow it really adds up.

leptons a day ago | parent | next [-]

It doesn't "take up a ton of memory" and if you think 47MB is "a lot of disk space" then maybe you need a bigger disk. Most laptops have at least 250GB, so this program would take up about 0.0188% of disk space, which is frankly not a lot. I had PDF files way larger than that. And you only need to run it once, you do not need to keep it loaded and running all the time, so it doesn't "take up a ton of memory".

lostlogin a day ago | parent | next [-]

This is how we have ended up with huge cars and huge houses etc. Storing huge volumes of unneeded junk isn’t solved by have more space. Store less junk.

leptons 21 hours ago | parent [-]

You can live however you want to live. I will live however I want to. 47MB is not worth worrying about, at all.

BobbyTables2 a day ago | parent | prev | next [-]

47MB is about 3x the space once required by a widely used commercial graphical operating system. It was even enough to also include Microsoft Word with plenty of space left.

How far we’ve fallen.

leptons a day ago | parent | next [-]

You're living in the past. Hard drives are now up to 36TB. Hard drives are always getting bigger. 47MB isn't worth worrying about, at all.

mlhpdx 14 hours ago | parent | next [-]

This is such a weird rationalization. You’d sell a kidney to be a 10x developer but making an app 1000000x smaller isn’t worth a thought? Maybe that’s why the former hasn’t happened.

leptons 43 minutes ago | parent [-]

Where the hell do you get me saying I would sell a kidney? What are you smoking?? Weird? Your comment is the only weird thing here.

superb_dev 15 hours ago | parent | prev | next [-]

Yup and those 36TB are cheap and common! Right?

wolpoli 11 hours ago | parent | prev [-]

While it is true that hard drives have large amount of storage, it is unlikely that are any Mac with a 36TB hard drive attached that needs to overcome WiFi time limit.

leptons 42 minutes ago | parent [-]

Doesn't matter what size hard drive is in the mac. If you can't spare 47MB to solve a problem you're having with wifi access then you are doing it wrong.

charcircuit 18 hours ago | parent | prev [-]

47 MiB only costs $0.0002. What has fallen is storage price.

anonymars a day ago | parent | prev [-]

These crappy WiFi portals are known for having ample download speeds too, right?

dtech a day ago | parent | prev [-]

That is more a tragedy of the commons thing. For each individual app the comparison holds true

IgorPartola a day ago | parent | next [-]

And since we do have app stores as gate keepers, this could easily be remedied by the app stores. They wouldn’t even have to penalize you. Just put a score on there for app size (and app responsiveness) compared to the median in that category. Put this near the star rating from the reviews. Executives don’t generally care that you as an engineer want to reduce an app size by 10% but they really really care about how the app looks on the app stores because that’s what they show to people and what they are judged on.

kulahan a day ago | parent | prev [-]

Tragedy of the commons or just a really bad industry?

BobbyTables2 a day ago | parent | prev | next [-]

People usually think that but when it comes to attack surface, change management, upgrade issues, etc —- the extra stuff isn’t entirely free…

Upgrades shouldn’t ever break things, bugs and vulnerabilities never exist, and Rube-Goldberg machines should work 100% reliably day in and day out.

Unfortunately reality doesn’t work that way…

al_borland 10 hours ago | parent [-]

Even Rube Goldberg sometimes included a simple alternative at the end of his machines. If the opossum or woodpecker get sick, there is a knife handy to sharpen the pencil.

https://msl.cs.uiuc.edu/~lavalle/cs397/goldberg.html

lostlogin a day ago | parent | prev | next [-]

> Well, if you COULD ship something across the world on a private 747 with extra features to protect your cargo

Qatar might even give you a plane!

numpad0 14 hours ago | parent | prev | next [-]

This has to be Soviet Shoe Factory Principle in action, not just ignored negative externalities. Everyone relies on shipping more code for their employment, rather than more values, which incentivizes that behavior.

1: https://wiki.c2.com/?SovietShoeFactoryPrinciple

phyzome 12 hours ago | parent | prev [-]

I think you're conflating "no incentive" (which might be true) with "no downsides" (which is not).

shepherdjerred a day ago | parent | prev | next [-]

How many 747's can the average person fit on the 128GB+ smartphone in their pocket?

jofla_net a day ago | parent | prev | next [-]

says more about sociology, really.

foxglacier a day ago | parent | prev | next [-]

Human time is money in software, more analogous to mass in physical goods. So you should calculate the time savings for all the people using the app vs entering the code themselves.

Mass is a nonsense analogy that doesn't reveal anything useful.

paxcoder a day ago | parent | prev | next [-]

While I appreciate criticizing bloat (why are we packing Chromium in every app again?), I would like to warn against watching every "pound". Images, for example, "weigh" a lot more than code but that doesn't mean they don't serve a purpose and add value.

That being said, the fact that quick maths can give you a 6 orders of magnitude difference between functional code and the package is probably reason for concern.

BestHackerOnHN 14 hours ago | parent | prev | next [-]

OMG you win HackerNews today with this comment! Super HackerNews!!!

bognition 21 hours ago | parent | prev [-]

This is an absurd way to think of this. Following this same train of thoughts for humans:

The business logic for humans is a single reproductive cell.

A single sperm weighs 2.3 x 10^-11 grams. If the average male weighs 75kg the. The bloat ratio for a human male is 3.2x10^15

Getting back to the app there is huge value in not needing to run the command yourself. Sure it’s wrapped in a UI that comes with “bloat” but honestly who cares. When was the last time someone needed to worry about hard drive space, when it comes to a 40mb file.

m11a 21 hours ago | parent | next [-]

Well, the apps often come bundled with a bunch of other stuff. Automatic updates, background workers, telemetry …

All of which sucks up your compute resources and battery. Repeat for every such little utility app you have on your Mac. Some may implement that random stuff inefficiently (eg very frequent telemetry), which sucks even more. Some of it may even be wrong, vibe coded, or copy pasted.

Personally, puts me off installing random utility apps, even if the single utility would be useful.

Dylan16807 13 hours ago | parent | prev [-]

In the human analogy, the human has to be the entire computer too. It's all functional, not much bloat. For the app, the computer is external. It really is bloat.

dbalatero a day ago | parent | prev | next [-]

To be fair, the author didn't make this to impress people with byte optimizations, they probably just wanted to publish an app quickly that is useful, and was familiar enough with Electron or JS to do so.

righthand a day ago | parent | prev | next [-]

It’s not the easiest way just the most evangelized. A Qt app even would be a few lines of code, but we’ve done a good job scaring people that learning other languages is bad because we can’t ship features fast enough with non-evangelized frameworks.

anthk a day ago | parent [-]

Even TCL/TK would be smaller.

PaulHoule 6 hours ago | parent | next [-]

Yuck! Funny though I wrote a program for making red-cyan anaglyph stereograms using TkInter/Python. Stereograms work best when you can put important objects at the plane of the paper/screen and this is done by sliding the left and right images relative to each other.

Tk has no color management, unlike newer frameworks, which was good in this case because I asked for (255,0,0) and got (255,0,0). When I exported to JPEG and views on a web browser though I got something like (186, 16, 16) because on my wide gamut monitor the native primaries are more saturated than sRGB primaries so some white gets blended in to make them less saturated. Turns out in Windows, screenshots are in the color space of your monitor! It’s something you’d never notice unless you made stereograms because that little bit of green and blue goes to the wrong eye.

righthand a day ago | parent | prev [-]

Every framework under the sun gives you a `main()` func to call your program code. But if all you’ve ever used is blogs telling you how to hack together an electron app, you’d probably assume electron was the gold standard for simplicity sake but in reality is the gold standard for Google’s sake (and whatever marketing company’s).

sli an hour ago | parent | prev | next [-]

It just seems to me like far less work to just write a real binary that execs this static command than it does to setup a whole Electron project.

ryandrake a day ago | parent | prev | next [-]

I so strongly wish more developers gave even a single shit about this. The current state of desktop app development is truly an embarrassment.

LauraMedia 7 hours ago | parent | next [-]

There is a deeper problem in this: The DX for native applications is too annoying, undocumented or hard for most people.

I tried to build some of my tools without Electron, it's always a battle of multiple documentations for multiple systems and creating a bespoke system or having to deal with UI documentations that are glorified API references without examples.

The last few tools I built used PhotinoNET, which gave me an electron-esque framework but not bundling it's own chromium, instead using the browser already on the system. And even that required a complicated build script so I can just export a simple flatpak, exe and dmg...

malnourish 12 hours ago | parent | prev [-]

Who is embarrassed? What are the realized harms?

PaulHoule 6 hours ago | parent [-]

Microsoft seems to have given up on guidance for how to write desktop apps, Windows 8 had that Metro thing that got rejected by the world. I guess you could use Win32, WinForms, WPF or something else. The incoherence is second only to the Linux world, I remember how developers were crazy about theming in Win32 in the ‘95 age so something like Back Orifice or the app for your scanner looks atrocious. WPF added really great support for theming but at the point everybody was burned out in theming so it hardly ever got used.

PaulHoule 6 hours ago | parent | prev | next [-]

A few years back I did an eval of ways to make cross platform apps, specifically to escape Electron, and came to the conclusion that ‘they all suck’ except maybe JavaFX.

Thing is, most x-platform frameworks still require a big download. Java and Python runtimes are in the same ballpark as Electron.

mistercow a day ago | parent | prev | next [-]

I keep thinking that this could be solved by just building Electron into the OS as a shared framework so we don't have to have a separate copy for every app, but the more I dig into it, the more I realize I'm just reinventing the web browser.

thisislife2 a day ago | parent | next [-]

There is something called the "WebView" in all the major platforms. The idea is that it allows you to use the browser engine only for creating the UI. But people complain its not "enough" because it is not the same on all the platform (it is if you use it just for UI), restricts access to some browser APIs (ignoring the fact that the OS often offers the same, even and more APIs) and Javascript (a crappy language for creating software applications).

paxys a day ago | parent | prev | next [-]

You are describing PWAs, but they'll never have the same API access & permissions as a native app.

mistercow 8 hours ago | parent [-]

Yeah, and I think it’s worth asking why there. Why do we not just have a standard for PWAs with privileged OS access?

There are two obvious answers. The first is portability. And sure, but Electron provides an answer here, so why can’t we provide one with PWAs? We could even have OSes define this interface for different browsers to target in a standardized way. Yes, you need platform specific code, but that’s often the situation with Electron too.

The other answer is security. But how is Electron / any other installed app any better? Because we require more explicit consent before installing a “real” app than for installing a PWA? OK so, just let’s just do that for PWAs too.

mixmastamyk a day ago | parent | prev [-]

Tauri: https://tauri.app/

lxgr a day ago | parent | prev | next [-]

Wow, they optimized the minimal Electron app down to 47 MB?

runlaszlorun 4 hours ago | parent [-]

Sadly this was also my reaction.

kzrdude 19 hours ago | parent | prev | next [-]

And notice the other abstraction too.

This is not 'an app to change MAC address' but an app to 'overcome WiFi time limits'.

runlaszlorun 4 hours ago | parent | prev | next [-]

And sadly my reaction to 47MB these days is "hey not bad" given that I see 6 or 700 MB apps not doing much .

21 hours ago | parent | prev | next [-]
[deleted]
thwarted a day ago | parent | prev | next [-]

Those who don't learn /usr/bin are destined to reinvent it, poorly.

tomrod a day ago | parent [-]

What does this mean? I've always understood /usr/bin to be the storage dump for system binaries. Do you see or use it another way?

GTP a day ago | parent [-]

They likely mean that you already have in there all what is needed to change your laptop WiFi card's MAC address, without needing an additional application.

ncr100 18 hours ago | parent | prev | next [-]

Cough, AI Training Models, Cough

There's great power in abstraction. Disagree?

Your point is that an operating system, and its shell, all running on a machine, and a collection of apps, are somehow smaller than a wrapper application.

I'm curious the amount of bytes the entire stack, minus the chrome which is the complaint I believe, how many bytes that is. I would say probably a gig.

unixhero a day ago | parent | prev | next [-]

Yes but you need a space station OS (Unix) to enjoy the terseness of 47-200 bytes of business logic.

ps: I love both space stations and Unix

amlib 19 hours ago | parent | next [-]

The solution to this problem requires you to interact with the OS, so a solution that requires tools found in the OS itself isn't a bad one. Its so simple you can have a script triggered by a desktop shortcut and be done with it.

That all said, a simple GUI API provided by the OS for simple programs like this would be nice, just to give the user better feedback on the process. Is it done? Is it doing anything? Did it run correctly? Etc.. Zenity on linux kinda does that but is not guaranteed to be installed...

kjkjadksj 2 hours ago | parent [-]

Why do you need that in gui when you already have it in cli through pid?

yjftsjthsd-h 20 hours ago | parent | prev [-]

I guess, but the OS is a fixed cost that you already have

CommenterPerson a day ago | parent | prev [-]

Are they doing something additional with the 47MB - 200 bytes? Like selling you to the brokers?

WJW a day ago | parent [-]

Not even. It's just overhead.