Code That Doesn’t Exist Doesn’t Have Bugs

Posted on 2019-10-16 in misc • 1 min read

Table of Contents

    I was catching up on the Talk Python to Me podcast on the morning commute when I heard this tidbit of advice. It struck me as one of those nuggets of wisdom or rules of thumb that you collect over years of experience.

    Digging in to this axiom a bit, I realized that this aligns well with the choice of python as a programming language. Python is designed to be compact and succinct. Typically, it takes fewer lines of code to accomplish something in python than other languages such as C++ and Java. I’ve been working a lot lately with the python bindings for OpenCV and this is definitely apparent when comparing C++ tutorials to their equivalent versions in python.

    Fewer lines of code equals a smaller attack surface for bugs to creep in. The same holds true for security issues.

    Python isn’t the best solution to every problem, but it certainly is flexible enough to cover multiple use cases. I specifically appreciate python bindings to C and C++ codebases that let you have the best of both worlds: low barrier of entry at the python level along with high execution speed at the lower levels.