A junior software developer shall be forgiven for being glad when their code works. If that’s you, I don’t judge you.
Nevertheless, for those who are able to get to the subsequent level of constructing software with Python, your code mustn’t just run and pass some tests. It also needs to be written with the available computing resources — and the energy bill — in mind.
Every inefficient loop, poorly chosen data structure, or redundant computation burns more electricity than needed. Unlike C, for instance, where it’s essential to reserve bits out of your disk for every latest variable you create, Python will devour resources because it sees fit. This makes it extremely beginner-friendly, but in addition moderately energy-intensive when used improper.
Sloppy algorithms aren’t just bad for the performance of a code. They’re bad for the planet, too. Software firms like Microsoft are struggling to maintain their carbon emissions low due to all the energy they devour for AI and other tasks. At the identical time, sustainability is a growing concern. Sustainability-minded programmers are subsequently becoming a precious resource for a lot of firms.