Winning the War on Coding Mistakes 

//Winning the War on Coding Mistakes 

Winning the War on Coding Mistakes 

The good news: The advances in computer science technology have pioneered breakthroughs and processes and discoveries unimaginable only a decade ago.

The bad news: Despite these incredible leaps forward, no one has discovered a formula to “error-proof” the coding that makes all these software-driven processes functional.

“Software powers social networks, controls vast supply chains, gets astronauts to the moon and back, and saves lives. It can also screw up horribly—causing programs to crash, systems to become vulnerable, and entire servers or data centers to go down,” notes Erik Sherman. “And it doesn’t necessarily take a lot of code to do this—just enough of exactly the wrong thing.”

While learning from one’s mistakes is wise, what’s even better is to learn from the mistakes of others. Especially when it comes to critical coding errors. Take notes on how to avoid these common pitfalls.

Alex Yelenevych notes mistakes common to beginning Java learners, including—

  • Assignment or comparison (= or ==)

“It is easy to confuse that = is an assignment operator whereas == is a relational operator. That’s a natural mistake because in math ‘=’ is closer to Java’s ‘==’, than to Java’s ‘=’.”  

  • Accessing non-static members from the primary method or other static methods

A lack of know-how concerning static context trips up many programmers. “Static variable is the one shared among all instances of a class. Therefore, there’s only one copy of it which is shared by all objects. So, we can’t work with a non-static variable in a ‘static way’,” advises Yelenevych. “Remember, you can work with static variables or methods from a static or non-static context. You can work with non-static elements using object reference.”

Chief Data Scientists Norman Neimer frequently sees these coding errors.

  • Hardcode inaccessible paths

“If you hardcode paths others don’t have access to, they can’t run your code and have to look in lots of places to manually change paths. Booo!” Instead, Neimer advises using relative paths, global path config variables, or d6tpipe to make your data easily accessible.

  • A mix of data with code

“Since data science code needs data, why not dump it in the same directory? And while you are at it, save images, reports and other junk there, too. Yikes, what a mess!” The solution? Neimer advises a better approach is to organize your directory into categories, like data, reports, code, etc. He suggests Cookiecutter Data Science,  d6tflow project templates, and other tools he mentions in “Top 10 Coding Mistakes Made by Data Scientists”.

The Art of Programming

Don’t expect the job of a programmer to appear on the top ten list of easiest professions. It will never happen. Because programming highly technical equipment is a complex and sophisticated task, one that takes a long time to learn. And then, even “the best programmers still write buggy code,” says John Loeffler.

“When a critical system’s programming badly malfunctions, if we’re unlucky, the bug might cause substantial property damage, lost stock value, or other administrative cost managing an unnecessary disaster—not to mention the programmer’s job. Sometimes though, the consequences can be unimaginable.”

Check out these resources designed to thwart errors before they ignite a disaster.

  • Many companies offer a variety of software intelligence tools that communicate with each other and build a more ‘intelligent’ view of your software. Peruse this compilation of software tools from Software Advice.
  • CWE Top 25 Software Errors Site

MITRE maintains the Common Weakness Enumeration (CWE) web site, with detailed descriptions of the top 25 Software errors along with authoritative guidance for mitigating and avoiding them. The CWE Web Site also contains data on more than 700 additional software errors, design errors, and architecture errors. The TOP 25 Errors List is updated regularly and posted at both the SANS and MITRE sites
RomAnalytics brings a wealth of knowledge and passion to every individual and project we encounter. Our focus on top talent for market insights and analytics has established a deep, vast pool of individual candidates trained in this specialized area. Connect with our staffing experts to learn more about how RomAnalytics can meet all your employment needs.

 

By |2019-07-11T23:46:37+00:00July 11th, 2019|Blog|0 Comments

About the Author:

Leave A Comment