Writing Proper Code Is Vital: Here’s Why | Hacker Noon

Author profile picture

November of last year, OVO Energy sponsored a study finding that “If every Brit sent one less thank you email a day, we would save 16,433 tonnes of carbon a year — the same as 81,152 flights [from the UK] to Madrid.”

How could sending fewer emails have anything to do with greenhouse gas emissions? As it turns out, the two are connected.

When humanity wastefully runs software and web services, hardware fights to keep up. In time, equipment sucks electricity and eventually wears out.

The Guardian noted:

Almost everything we do online increases our carbon footprint. As a perverse example, Antivirus Company [McAfee] reports that the electricity needed just to transmit the trillions of spam e-mails sent every year is equivalent to powering two million homes in the United States and generates the same amount of greenhouse gas emissions as that produced by three million cars.

But waste extends more than just to consumer “overuse.” Software engineers recognize that good code not only relieves stress on hardware and power generation — it actually further enables programmers to implement more efficient solutions.

What is “Good” or “Proper” Code?

For starters, good or proper code works. In the short term, this standard may seem like stating the obvious.

From a long-term perspective, good code works as expected at all times.

Rushed code appears to work in initial testing and fails to compute when a new variable comes into play.

Proper code is also easy to maintain and reuse. When proper code exists, the next generation of software engineers can quickly troubleshoot and upgrade code for more eco-friendly processing.

Five Reasons Why Writing Proper Code Matters

Proper code is a benefit that few notice. In contrast, even non-programmers will notice the effects of bad code. Here are five ways the absence of proper code deteriorates our overall quality of life.

#1: Bad code runs servers and hardware more than necessary.

Just because the Internet has saved our personal computers some general wear and tear doesn’t mean that servers aren’t paying the price.

Good code powering web services and the Cloud ensure that servers last longer and run more efficiently. Bad code does just the opposite.

Code run on local computers produces the same effect. Proper code extends the life of the hardware, whereas bad code more quickly deteriorates machines that we depend upon to get the job done.

#2: Bad code is the opposite of eco-friendly.

Computers, servers, and supercomputers demand power. While many parts of the world are learning how to generate electricity through more sustainable methods — such as renewable energy sources — most first-world countries still depend heavily upon the burning of fossil fuels.

Additionally, increasing humanity’s arsenal of computer hardware grows our carbon footprint dramatically. Once a server or hard drive is exhausted, computer hardware fails to decompose nearly as quickly as most other consumer goods do.

The more prevalent the bad code, the more pressure computer hardware must endure. More imminently, bad code places higher demand upon our power grids and energy sources.

#3: Bad code is challenging to read, use, and repair.

In today’s software ecosystem, product iteration is critical. Programmers build digital systems with plans to implement continuous improvement and product upgrades.

Proper code allows everyone on a programming team to understand how the code works.

Team members can promptly fix bugs and use the code to define a new batch of code foundational to a new product launch.

In contrast, bad code eludes programming teams. Bugs are nearly impossible to identify and fix without scraping the code entirely. Bad code takes the “scenic route” in every computing command, and the average programmer can get lost in the mess.

#4: Bad code ignores open-source solutions.

The best software engineers know that there may very well be code to solve their immediate problem.

A former Google software engineer, Zachary Goldberg, insisted, “Before potentially reinventing a wheel, think about how common the problem is you’re trying to solve or the function is you’re trying to perform. Somebody may have already implemented a solution you can leverage.”

When programmers ignore existing solutions, they often end up building a distorted replica of efficient code that already exists.

Software engineers should instead (in Mr. Goldberg’s words) “stand on the shoulders of giants.”

#5: Bad code is slow.

When a server must work harder to power through bad code, speed dwindles. Speed is the leading concern among consumers, and while software providers certainly want to appease their customers, slow software services often highlight bad code.

Proper code converts the server command from a marathon to a sprint. The result is still the same, minus all the extra server effort it took to get there.

Final thoughts

While customers expect better software products and advocates demand more eco-friendly tech, the solution remains the same.

Proper code extends the life of computing hardware, lowers the amount of energy required, opens the door for better code, and makes tech services faster.

It is a myth that the Internet automatically saves the planet. Bad code contributes to the earth’s pollution, even in cases where all digital services are transmitted online.

Good code can radically reduce our carbon footprint and overall greenhouse gas emissions. Software companies are increasingly looking to good code to lower costs and embrace more environmentally-sustainable business practices.

As for most things in life, doing more with less continues to be a noble goal in the process of ongoing improvement. It’s time for more software companies to do their part by raising the bar for quality code in the construction of their products and services.

Previously published at https://medium.com/@markeaze/5-reasons-why-writing-proper-code-matters-28bc6c0fffd1


The Noonification banner

Subscribe to get your daily round-up of top tech stories!

read original article here