Matthew Boston

Over-engineering is just future-proofing gone too far

October 20, 2025

Key takeaway: Wait for three concrete use cases before you design an abstraction, and keep the code clean enough to change when they arrive.

Build for the change you have, not every change you can imagine. Over-engineering is future-proofing gone too far.

Wanting systems that adapt is reasonable. The trouble starts when “build for change” becomes “build for every possible change.” You get a factory around a class with one implementation, a plugin system nobody extends, and config for twelve environments when you have two.

Here’s the factory, in Ruby:

# notifier_factory.rb: three classes for one way to send a notification
class Notifier
  def deliver(user, message) = raise NotImplementedError
end

class EmailNotifier < Notifier
  def deliver(user, message) = Mailer.send_mail(to: user.email, body: message)
end

class NotifierFactory
  def self.build(kind = :email)
    case kind
    when :email then EmailNotifier.new
    else raise ArgumentError, "unknown notifier: #{kind}"
    end
  end
end

Every caller writes NotifierFactory.build.deliver(user, "Your order shipped") and gets an email. The base class, factory, and kind exist for SMS and push that nobody asked for. This does the same thing:

Mailer.send_mail(to: user.email, body: "Your order shipped")

“We might need it later” justified each piece. Later rarely shows up in the form you predicted, and the change you actually need means reworking the extra parts anyway.

With YAGNI you still write clean code. It solves today’s problem and nothing else. Clean code is already easy to extend. For abstractions, I use the Rule of Three. With one use case, just write the code. With two, notice the pattern but don’t force it. With three, you have enough real cases to design a good abstraction.

When the requirement does change, make the change easy, then make the easy change.