Settings

Theme

Ask HN: As a developer, do you consider the carbon footprint of your apps?

42 points by lnalx 3 years ago · 50 comments · 1 min read


Hi there,

I'm terrible at addressing the current environmental challenges.

This morning, I discovered the Website Carbon Calculator [0] and tested all the websites I've created. To my surprise, some of my websites turned out to be disastrous.

Until now, I hadn't been concerned about the carbon footprint of my apps, but having access to this information encourages us, as developers, to take responsibility for the performance of what we build. This article [1] details how to reduce this footprint when building websites, serving as a great starting point for considering how we can minimize our impact (e.g. using less JavaScript)

I don't want to engage in the cliché of “greenwashing”, but rather aim to make a positive impact as a developer.

What are your thoughts? Were you already aware of this?

[0] https://www.websitecarbon.com/

[1] https://www.wholegraindigital.com/blog/website-energy-efficiency/

(I'm not affiliated with any of the website I quote)

gizmo 3 years ago

Frankly, I think efforts like these are misguided.

We are collectively rewriting desktop apps to run in the browser, where not only it runs 50x slower than on the desktop, but all data has to be downloaded time and again from servers. The amount of waste here is staggering. And yet, desktop apps have so many issues (installation/breakage/crashes) that web apps are the only way to deliver software that just works.

Web developers can, and should, build light and fast websites. But the average person runs spotify, youtube, netflix and other streaming services pretty much 24/7. A slightly faster personal blog isn’t even a drop in the bucket.

And waste from computing, bad as it may be, pales into comparison to the waste of a “quick trip to the store” with a 4 ton truck.

As software engineers the best thing we can do is to write good software that lasts and that solves real problems. Climate guilt really doesn’t come into play here.

  • daydream 3 years ago

    > And yet, desktop apps have so many issues (installation/breakage/crashes) that web apps are the only way to deliver software BNb that just works.

    I never have any installation or breakage issues with desktop apps and crashes are very few and far between nowadays.

    In contrast so many websites track every single little action I do, waste massive amounts of energy on said tracking/showing ads/invading my privacy, and have a crap user experience chock full of dark patterns.

    I’ll take desktop apps any day of the week, thanks.

  • yakubin 3 years ago

    > desktop apps have so many issues (installation/breakage/crashes

    Day-to-day I use a Mac. Installation is me dragging an icon to a folder. Sometimes I use Linux or FreeBSD. There installation is a single command. I don’t see the problem. Difficulty/effort level is equal to bookmarking a website. Indeed, with PWAs it’s literally the same thing. The meme of installation being hard needs to die. First lack of it was born as a made up advantage of webapps, and then webapps copied it.

    Breakage/crashes — same thing happens with webapps, but is more frequent, annoying and silent (as in: often you don’t get a popup that something crashed, instead clicking on things stops effecting anything, buttons are randomly marked inactive, scroll is broken), not to mention terrible responsiveness.

    • pocketarc 3 years ago

      > The meme of installation being hard needs to die.

      I think that meme is just people trying to come up with rational reasons for the death of native apps where there are none. The reality is that it's more expensive and takes longer for a big businesses to build a different native app for each OS, so they push web apps. It also takes longer for smaller devs to build multiple native apps, so they push web apps.

      That's what it comes down to. If you're building an app like Discord, you can write native clients for macOS, Linux, Windows, iOS, and Android, OR you can write a single React app, throw in a bit of React Native and a few OS-specific tweaks, and you've got all 5 platforms covered.

      There's no big conspiracy. Desktop apps aren't worse. It's just business.

    • kitsunesoba 3 years ago

      The only desktop apps that match OP’s description that I’ve used are old giant “ball of mud” codebases like Adobe and Autodesk stuff, but thankfully my need to use those specially has been low in recent years thanks to more lightweight and well-behaved alternatives like Affinity Photo and Pixelmator.

  • EliRivers 3 years ago

    desktop apps have so many issues (installation/breakage/crashes) that web apps are the only way to deliver software that just works.

    I wonder if this will always be the case, or if we just need to keep going for another order of magnitude or two before we manage to render web apps as painfully difficult for ourselves as we've made the desktop.

000ooo000 3 years ago

I can't help but feel that the performance of software with regard to its impact on the climate is a long way down the list behind far more effective but also polarising ideas such as abstaining from the consumption of animal products, limiting the number of children one has, etc.

I ran the websitecarbon.com calculator against my org's public website. For 10k/y visits, about 42kg of CO2 is emitted. Dubious how that's calculated, but let's say it's off by 10x and the emissions are closer to 420kg. Apparently, the average Australian emits 17t/y of CO2. If I were going to attempt to reduce my carbon footprint, there's probably something far more valuable I could be doing than worrying about 20kb of JS.

  • blq10 3 years ago

    We are already below replacement TFR in most countries in the West.

    "Limiting children" in that case is "human race should die because the climate" and like, no.

    Please stop repackaging anti human doomerism as climate action.

    • 000ooo000 3 years ago

      Did I say limit children forever? To the point where the human race dies out? Doesn't seem like I did.

      • blq10 3 years ago

        It is substantially implied, considering being worried about population growth when the data suggests it is declining.

      • tut-urut-utut 3 years ago

        No need to limit forever. Just wait until you reach 60.

    • philwelch 3 years ago

      I’m sympathetic to what you’re saying, but I don’t think it’s worth arguing with antinatalists. Antinatalism is a self-solving problem.

torginus 3 years ago

First of all, that 'carbon calculator' website is total bunk. How the hell do you tell how much work needs to be done in the back-end to display your page?

How does it tell apart if a site lazy-loads, meaning it might do less work on first load, but does way more total traffic to render all the information the user requests?

I'd wager the majority of energy is spent in the backend, where the majority of the energy will be spent between microservices ping-ponging each other.

PaulKeeble 3 years ago

Certainly for desktop software and user utilities I take consideration of power consumption and idle load especially. There is a strong overlap with performance but also there is being a well behaved application that doesn't consume resources when the user isn't directly doing anything.

Its a common reason why I get rid of open source self hosted apps. If they hammer the disk all the time or seem to constantly impact the CPU when they shouldn't be then it gets replaced. I want my NAS asleep unless it has to be doing something. Its a consideration I raise bugs around and its something all software I have ever written takes account of.

lrpe 3 years ago

This seems like a good way to shift the blame for climate change to individual people who are powerless to do anything to stop it.

  • paulcole 3 years ago

    Individual people are the only ones with the power to stop climate change. They’ve just chosen not to exercise that power.

    To say that individual action is powerless to stop climate change is the same thing as saying that climate change will never be stopped. Which is true but nobody wants to hear it.

    It’s much more fun to say that I am powerless to stop climate change so somebody else with more power than me must stop it! You can follow this chain all the way up to the most powerful person in the world.

    • FireInsight 3 years ago

      It's true that collective action is just a congregation of individual action, but sadly the individuals with most power to change the climate–fossil fuel execs and the like–deem the continuation of their current practices too profitable to change.

phito 3 years ago

To be really honest, no, not at all.

solanpaa 3 years ago

I’d be happy to include carbon footprint considerations in the projects I work on, but often clients are not willing to pay for it.

CommanderData 3 years ago

I was wondering this wheb I realised Amazon's FireStick does not actually sleep like you would expect an Android device would. My monitor / display stays switched on, the stick is working in the background according to CPU monitor.

Considering at least 150+ million devices have been sold (not sure if that includes Fire TVs) and most of these devices stay switched on even when the TV is switched off. Just a single watt of saving may equate to a coal power station. The power bricks are rated for 5v x 1a.

I do wonder if the developers knew how big an impact they have when developing a device used by so many.

manuel_w 3 years ago

Rockstar Games for sure didn't. They were "performing nearly 2 billion (largely pointless) item checks before each game." [0] Patching them out reduced load times by several minutes.

HN discussion: https://news.ycombinator.com/item?id=26296339

[0] https://www.eurogamer.net/rockstar-officially-implementing-f...

RedNifre 3 years ago

Of course not, my software does not put CO2 or CO2 equivalents into the atmosphere.

What matters is keeping the atmosphere balanced or even remove greenhouse gases from it. The way to do it is to have serious carbon certificates, as in coal power plants need to buy carbon certificates before they emit CO2 and the certificates get destroyed after, Brazil gets certificates for having a rain forest, which they can auction off internationally to motivate them to not destroy the rain forest and also to make planes fly etc. If my software costs too much electricity, it will either mean that people switch to cheaper electricity (renewables, since they don't have to buy the certificates), or they will switch to a different software that consumes less of their expensive coal power.

If all green house gas emissions have to be set off by certificates first (or by 1.1x the certificates, to lower the green house gas levels), you won't have to worry about where the power for your software comes from, since it's all accounted for already and if your software really costs too much electricity, the market will regulate it.

  • jen729w 3 years ago

    None of this works.

    Our carbon emissions continue to grow. Every year is larger than the last. The largest year for emissions in human history was 2022. The next will be 2023, and then 2024 will beat it.

    Our rate of growth is slowing, but we continue to grow. It is possible that by 2050 we stop beating our previous records. Possible. Probably not.

    That wasn’t a typo. We will continue to emit more carbon than we did the previous year for at least another 25 years.

    Certificates are bullshit. Brazil ‘selling’ its rainforest carbon offsets to China is bullshit.

    There isn’t a resolution here. There’s no answer, currently. It looks like we’re just fucked. We have decent power generation solutions but no grid to accept them. China and the like want to grow, they want to use coal, and who are we to say no? We did it. Should we expect them not to?

    No individual can make any difference at all while the major economies of the latter half of this century invest — as in, start to build, today — dozens of coal-fired power stations. It might even be hundreds. It saddens me to think about looking it up, so I’m not going to.

    Worrying about the carbon cost of your app is a nice thought, but nothing more. It’s functionally pointless.

    • RedNifre 3 years ago

      Right, I was talking more about how it SHOULD work. As you correctly said, it doesn't work at all right now. As in, no CO2 can be emitted, before buying the offset first. It's the only solution I can see, but I agree that it's unlikely to be implemented like this.

      As for "China and the like want to grow", they shouldn't and the countries who already emitted a lot of CO2 should have a certificate debt that they need to pay back, slowing their economies down, which would also let the others catch up.

  • quickthrower2 3 years ago

    An international carbon price would be awesome, yes.

    As long as the carbon sinks are genuine. Planting a tree that later dies or burns is not carbon negative.

    • RedNifre 3 years ago

      Not a carbon "price", just an auction of CO2 ton equivalents to keep the atmosphere balanced: Before a plane lifts off, the CO2 equivalent offsets need to be bought at the global auction house. This would make the market regulate the price of CO2 emissions.

      (Not sure how the certificates work in reality right now, probably some BS like giving each country a "CO2 budget" in certificates for free, pretending adding more CO2 to the atmosphere would be fine or something like this)

shoo 3 years ago

If the webapp is attached to an associated business, it'd be a more useful exercise to consider the carbon footprint of the whole business, especially in terms of scope 1,2,3 emissions.

E.g. suppose you have a business like a large bank that lends a lot of money to finance residential and commercial property development, as well as expansionary fossil fuel projects. This business may have extremely large scope 3 emissions after attributing some of the greenhouse cases generated by these real estate & energy projects back the bank's financing. The carbon footprint of the bank's website / webapps will be completely insignificant compared to the scope 3 emissions associated with the real world impact of how the business actually makes money.

https://en.wikipedia.org/wiki/Carbon_accounting

jalict 3 years ago

I have been to a few talks and likely about the footprint of making and running modern video games (and companies).

It is on my mind, and I have become more aware about how game design and implementations can facilitate over consumption. Small example is to have vsync enabled by default for all users, just so you don’t have users GPUs spinning at max speed.

I am not actively persuading it at the moment. But I have been aware about and been sharing knowledge with people of those ideas.

One nice side effect of reducing carbon footprint of these things is that it usually becomes cheaper to run as well :) similar to how accessibility seems to benefit a lot more people than what you target.

Jemm 3 years ago

Indirectly, any good coder should be considering the impact of their work on the cost of computing each operation. We do this less so now that compute power is so high but it should still be on our minds.

Jumziey 3 years ago

I think the issue is that any energi i spent on trying to make my apps have a less of a co2 footprint would be better spent engaging in climate questions instead, preferbly using ones profession.

Ie doing stuff like writing applications that scrapes metrics and show how green the energi grids are realtime, doing real time stuff around planes current climate effect given the amount of planes up in the air etc.

If thats not an option just vote with climate in mind and engage in public discussion around these issues would probably have a lot more potential

erokar 3 years ago

It doesn't cross my mind.

mschild 3 years ago

Not entirely. Besides the ones I build for work, I have a few systems running in a local server that I wrote, but I already optimized my home electricity network to use as little as possible.

For work, I don't have all that much choice. Obviously, I try to write as efficient code as reasonable, but I have no input on where it's hosted.

monkin 3 years ago

Looks like a new term for website optimisation? Which, more or less, anyone building anything online should do anyway. But forcing any environmental meaning behind in doesn't feel right.

It's like sorting waste that will end up in the general landfill.

perilunar 3 years ago

Yes, but only indirectly. I just try to make sites that small and efficient. I just tested them all in websitecarbon.com: one was 98%, one was 100% (rounding up I presume), and the rest were 99%.

xupybd 3 years ago

How does this compare to say switching to n electric car?

I think it's important people focus their efforts on the low hanging fruit. What's the biggest impact at the lowest cost.

is_true 3 years ago

Nope, I just try to avoid doing the same computations over and over again.

Cache all the things.

peter-m80 3 years ago

No.

Traubenfuchs 3 years ago

I call this kind of clownery "climate masochism". If you really want to do something for the environment, don‘t have children and become part of the voluntary human extinction movement.

Anything else is nothing but lipstick on the pig.

  • RedNifre 3 years ago

    What should people do, who are against climate change, because they are AGAINST human extinction?

    • Traubenfuchs 3 years ago

      I guess we all agree that continuing as is is clearly unsustainable. The one and only alternative to full human extinction is radically scaling down humanity, primarily quantitatively. We would still need some amount of people, ideally geographically distributed to stay resilient against god knows what else will come in the future.

      I am not well versed at all in the multiple disciplines one needs to talk about this in technical detail, but I guess 500.000 people per habitable continent should be enough?

      I do realize this is impossible to enforce top down or get the people to do bottom up. As the evolutionary greedy animals we are, we will continue to procreate.

      After all this rambling my short, personal answer: The only possible thing is becomming true eco terrorists and genociding 99% of the world population somehow. Boom. 99% of the ecological/climate foot print humanity has evaporated!

      To the appalled reader: I‘d prefer reasonable counter arguments over downvotes and flags...

      • RedNifre 3 years ago

        Sounds like overkill, literally.

        I mean, if every ton of CO2 emitted had to be offset by certificates for 1.1 tons of CO2, that were truly removed from the atmosphere, the climate problem would be solved over time and we could switch to 1:1 once we got the atmosphere back to pre-industrial levels. While this would surely reduce quality of living, I would be surprised if this meant that only 500k people per continent could survive. Surely, we could do better.

        • aziaziazi 3 years ago

          > every ton of CO2 emitted had to be offset by certificates for 1.1 tons of CO2

          Lol sound like impossible for many practical and social raisons. Thinking about how temper the overkill proposition is more realistic than keep on lying ourself to the impossible one.

      • baremetal 3 years ago

        >The only possible thing is becomming true eco terrorists and genociding 99% of the world population somehow.

        Ideological capture.

        You have been convinced to act against your own self interest.

        • Traubenfuchs 3 years ago

          Sorry I am a bit lost here: What‘s the interest you pressume I (should) have and act against?

          I do not care about the future of humanity and nature, I try to live as hedonistic as I can and do not desire being a father. Also, I do not wish for the mentioned genocide. I‘d only care about it to the degree it impacts me: I do not want to die as part of the 99% and I do not want the amount of potential lovers to be reduced.

          • baremetal 3 years ago

            >I do not care about the future of humanity and nature, I try to live as hedonistic as I can and do not desire being a father.

            Perhaps I'm being presumptuous but it sounds like you are in a state of hopelessness.

            I will pray for you.

activiation 3 years ago

I try to make them efficient... So indirectly yes.

konspence 3 years ago

No.

lemper 3 years ago

no. and I don't care at all as long as the highest per capita of carbon producing countries keep pushing other parties to lower their carbon footprint while keeping their wasteful lifestyle.

Am4TIfIsER0ppos 3 years ago

No because climate change is a lie and a conspiracy to make you poorer. Maybe you shouldn't be writing horribly inefficient software regardless of your beliefs.

theo32 3 years ago

Actually I do consider it. I make sure it has the biggest footprint possible. After all, all the top apps and websites do, don’t they

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection