You ain’t gonna need YAGNI

Why is YAGNI overrated?

man in black shirt sitting in front of computer monitor

At the time, “microservices” wasn’t quite the buzzword it has become in 2024. It was a compelling but daunting concept, and I couldn’t help but wonder: did Spotify always know they needed this? So, during the Q&A, I asked Niklas whether their microservices architecture was baked in from the beginning. His answer? “Really good question. The answer is yes.”

Spotify, it turns out, had a chief architect at the very beginning ensuring they made solid architectural decisions right out of the gate.

It got me thinking: is YAGNI overrated?


YAGNI: The Shortcut to Short-Term Thinking

After years of working in software engineering, I’ve noticed how often “YAGNI” is thrown around as an excuse to avoid solving problems proactively. In principle, it’s a great philosophy for reducing bloat. But in practice, it’s often misused to dodge the kind of engineering that requires big-picture thinking and long-term problem-solving.

Flowpass offers a hybrid working office booking platform where users can reserve desks in co-working spaces, even for just a few hours. From day one, I advocated for a service-oriented architecture (SOA) – not full-blown microservices, but a modular system with enough flexibility to scale.

The architecture included:

  • gRPC for service-to-service communication
  • Kafka for asynchronous messaging (e.g., for email queues)
  • A GraphQL backend-for-frontend
  • Next.js for performant web delivery

At the time, it might have seemed like total overkill for a small startup. A whopping 75% of it fell squarely into YAGNI territory. But here’s the thing: YAGNI shouldn’t mean avoiding foresight.


What YAGNI Gets Wrong

The YAGNI philosophy assumes that building for the future is a waste of resources – that the future will sort itself out. But in reality, scaling an unprepared system is a nightmare.

Imagine starting with a monolith, as YAGNI advocates might suggest. If the software grows to 1 million users and requires a distributed system, taking apart a poorly written, non-modular monolith is nearly impossible. Even dismantling a well-written monolith can take months, if not years, and cost an extraordinary amount of engineering effort.

By contrast, investing 20% more effort upfront to bake in modularity and extensibility can save 90% of the resources required to re-engineer the system later. The worst-case scenario? You end up with a well-architected system that’s slightly over-engineered but still performs well.


The Case for Proactive Engineering

At Flowpass, the modular SOA architecture’s complexity wasn’t necessary initially, it laid the groundwork for future growth and allowed the company to adapt quickly as the product evolved. Sure, some of it might have been “YAGNI” at the time, but it made the system better in the long run.

YAGNI shouldn’t mean neglecting future possibilities – it should mean avoiding unnecessary bloat. There’s a difference between over-engineering and thoughtful engineering. A forward-thinking design is an investment in the longevity and adaptability of a system.


Conclusion: Do You Really Need YAGNI?

YAGNI is a tool, not a rule. Use it wisely. It’s helpful for avoiding premature optimization, but it should never be a shortcut to avoid thinking critically about the future. As engineers, our job is to solve problems – not just today’s problems, but tomorrow’s as well.

So, the next time someone says, “You ain’t gonna need it,” ask yourself: What will it cost if we do? What will it cost if we don’t?

Because in the end, a little overkill today might just save you a world of pain tomorrow.

4
0

Read another one

  • Bats: Seeing Beyond the Myths

    Bats: Seeing Beyond the Myths

    Debunking Misconceptions About Bat Vision and Their Role as Virus Reservoirs

  • How the Iranian Revolution Led to Autoimmune Diseases

    How the Iranian Revolution Led to Autoimmune Diseases

    Unmasking Vitamin D Deficiency: The Hidden Pandemic The Silent Deficiency Affecting Millions Vitamin D deficiency is far more prevalent than most people realize. Globally, approximately one billion people are deficient in this essential nutrient. In the United States alone, 42% of adults suffer from a deficiency, with even higher rates in certain groups: 50% of…

  • How Delivery Platforms are Killing Restaurants

    How Delivery Platforms are Killing Restaurants

    Behind the scenes of food delivery platforms and their crushing impact on small restaurants. Passion, Pizza, and Reality Opening a pizzeria was my dream come true—a passion project born out of my love for Neapolitan pizza and the desire to make it affordable and accessible. While most Neapolitan-style places cater to the luxury dining crowd,…


Leave a Reply

Your email address will not be published. Required fields are marked *