"Never attribute to malice that which is adequately explained by stupidity"

Hanlon's razor, and how I use it as a developer

Hanlon’s razor has been a valuable discovery for me. These situations when something does not rule out in our favor do, unfortunately, happen. Usually, it is not someone’s intentional malice against us but rather a stupidity.

However, my personal “special case” of Hanlon's razor is:

“Software/API/programing language which you use is functioning exactly as it is supposed to, it is you who made a mistake”

When I used to be a beginner programmer, seeing something not working while it 100% should work led me to think “I found a bug!”. But, Python has been there for decades, you do coding for a few months: who’s more likely to be wrong here?.

What are the realistic chances that it is a software bug and not your stupidity?

Years later, interns/junior-level developers started coming to me saying something like: “This function does not work! It is broken.”

Usually, these functions “were broken” because they inserted a list where a dictionary was required. Or, some other silly mistake that we all do every day.

I believe that to always assume that it is our mistake, and take a fresh look at our code to find our mistake is a good rule of thumb.