Debugging The Perplexing: Don’t Panic!

, Software Pundits
This post was originally published on this site

Apium Hub

Table of Contents

Background

In the 10+ years, I’ve spent in software development, I’ve formulated a law of debugging: “The perplexity of a software bug and the simplicity of its probable cause are positively correlated”. Put simply, the more confounding and “impossible” a bug appears to be, the likelier it is that the underlying reason for the bug is not some nightmare compiler edge-case or hardware problem, but rather something that’s actually quite simple. Below are two cases that demonstrate the law in action.

Case #1: Python

My go-to example for this used to be an error in a Python project that took almost an entire day to resolve. Below is a (highly simplified) representation of the code in question:

def print_hello(): line = “Hello” print(line)

Given the entire three lines of code involved, you can imagine that the executing program consistently printing out the error

To read the full article click on the 'post' link at the top.