liveBook · Manning

Carbon footprint

As explained in The Art of Code

A carbon footprint is the total amount of greenhouse gases produced by an activity, product, person, or system, usually expressed as carbon-dioxide equivalent.

A carbon footprint is the total greenhouse gases produced by an activity, product, person, or system. It is usually expressed as CO2 equivalent, which puts gases such as carbon dioxide, methane, and nitrous oxide on a comparable scale. For software, the question is not just how much electricity it uses, but how that electricity is generated and what hardware the software requires. section 8.2.1 section 8.4

A phone before its first charge

A smartphone generates roughly three-quarters of its lifetime carbon emissions before it is turned on. Manufacturing and transport account for much of that cost; end-of-life processing adds more. These non-use emissions are called embodied carbon. Servers have a lower embodied share—about 30%–40%—because electricity consumed during their working lives contributes more. Keeping functional devices in use through repair, reuse, or repurposing spreads their embodied cost over a longer life. section 8.2.2

For running software, electricity consumption alone cannot give an exact footprint. Grids combine power from different sources, and the electricity reaching a server or user device cannot be traced to a particular generator. Public grid emission factors therefore provide approximations. Software Carbon Intensity (SCI), standardized as ISO/IEC 21031:2024, estimates emissions from electricity used, regional carbon intensity, and hardware’s embodied footprint. It divides the result by a functional unit—such as an HTTP request, transaction, or batch job—so the estimate has a clear basis for comparison. section 8.5.1

Use the footprint to guide engineering choices, not as a claim of exact measurement:

  • Reduce avoidable electricity use, especially where power is carbon-intensive; also limit the purchase and use of hardware. These are the two main levers addressed by green design patterns. section 8.4
  • Avoid treating speed, clean formatting, or a small code change as proof of lower emissions. Aim for acceptable responsiveness with as little hardware as practical. section 8.3
  • Choose a tool for the question at hand. A cloud carbon dashboard reports estimated emissions after deployment; web-page calculators estimate client-side impact; benchmarks and profilers reveal CPU and memory costs without directly measuring carbon. section 8.5.1 section 8.5.2

The useful heuristic is to ask what creates the emissions, then act on that source: electricity used during operation, hardware made and replaced, or both. Treat any reported number as an estimate with a defined scope. section 8.2.2 section 8.5.1

How The Art of Code covers it

How deep it goes
Defines CO2 equivalent and explains lifecycle emissions and SCI estimation, while ruling out an exact footprint for individual code.
Examples
Compares smartphone and server embodied-emissions shares and names HTTP requests, transactions, and batch jobs as SCI functional units.
What it assumes
Builds on familiar software resources such as CPU, network, and storage while defining carbon footprint and CO2 equivalent.
What you can do after
Evaluate/understand software carbon estimates and choose whether to reduce electricity demand, extend hardware use, or investigate both.
How it connects
Links carbon footprint to embodied carbon, electricity carbon intensity, hardware lifespan, and green design patterns.

Also explained in

Compare how 3 books explain carbon footprint →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of Code. The section links point to the parts of the book it draws on.