The Biggest Bug

Programmers spend so much time architecting the perfect codebase, when the code itself relies on a system that is inherently flawed.

There's a powerful term in computer programming called coupling.

Modern code is modularized to make it easier to read, write, and maintain. But for the overall system to work properly, these modules likely have to communicate with one another and work together to benefit the greater whole. That's where coupling comes into play. As Wikipedia reads:

Coupling is the degree of interdependence between software modules.

Consider an example where we're building a program to handle school exams. We'd probably have Question and an Answer modules. If Answer depends on too much of the Question, it makes the program fragile. For example, say Answer knows the order in which the questions are presented. If that order changes, you may possibly break the Answer module. In that case, Question and Answer are tightly coupled together.

Therefore, the goal in modularized (or object-oriented) programming is building modules that are loosely coupled, or decoupled.

When programmers write code, that code is coupled with the language in which it's written. That makes sense, right? The more we know about the language, the more tools we have at our fingertips to make the code work.

For those languages to work as expected, they have to form opinions and make assumptions. One such decision languages make is how dates and times work. You could say most programming languages are coupled to time. Or, using the transitive property, much of the code we write is coupled to time.

And time might just be the world's biggest bug.

The Gregorian calendar we use today calculates the average year as 365.2425 days long. It has an error of about 27 seconds each year, which is about a day every 3,000 years or so.

In other words, the way in which we calculate dates and times is not fully correct. And yet, in so much of what we do, we assume it is. If we were to create a more accurate calendar (the Persian calendar is closer) that changes the basic behavior of how we assume dates and times work today, much of our code will be broken.

And that's why you always decouple your code.

If this sounds dramatized, it is. This won't actually affect any of us today.

Let's Connect

Keep Reading

Time and Balance: How We Manage Our Most Valuable Asset

Time is a force within which we all live, and the decisions we make with that time are what make us who we are. So how do we ensure we're making the right decisions? Balance.

Apr 30, 2019

Why are security questions still a thing?

The motivation to provide an additional layer of security beyond an email-password combination is a noble one, but ...

Mar 03, 2017

Introducing Component-Driven CSS (CDCSS)

Yes, it's yet another CSS methodology. CDCSS combines inspiration from other methodologies to help your system stay focused on being a system, while also being simple, consistent, and flexible.

Dec 15, 2018