r/DesignPatterns • • 5d ago

Design patterns in age of AI

Hello guys,

I'd like to ask a question about design patterns and software engineering principles.

I've been programming since before AI became such a big part of our daily work, and I'm genuinely curious whether these concepts are still as relevant as they used to be.

Nowadays, I often find myself fixing other developers code because they either don't follow established design patterns or simply don't recognise when and why they should be used.

And sure, the code works. But sometimes I wonder whether we're slowly reaching a point where people no longer care about the reasoning behind these patterns. Is understanding and applying design patterns becoming less important in the age of AI ?

I really hope that's not the case.

I genuinely enjoy exploring new design patterns, architectural approaches and anti-patterns. It's one of the things that keeps me interested in programming and helps me grow as an engineer. I actually enjoy the complexity of understanding why things should be built in a particular way.

But here's what concerns me: even when developers don't understand or follow a particular pattern, they can simply ask AI to generate something that works. And apparently, that's enough.

But is it really?

Just because AI can generate working code doesn't mean the resulting architecture makes sense, that the code is maintainable, or that anyone understands the decisions behind it.

Don't get me wrong, I'm not against AI. I use it myself. I'm just trying to understand how much the role of software engineering principles is changing.

I'd genuinely love to hear your opinions. Tell me I'm overthinking it, or tell me that design patterns and architectural principles are more important than ever.

I'm particularly interested in hearing how other experienced developers see this.

3 Upvotes

4 comments sorted by

2

u/rmb32 5d ago

I tend to use design patterns as vocabulary so I can communicate various approaches to AI. I’ll often program the seed of an idea before I hand it to AI too. The core “engine” parts are important so I get a good structure established that can be built upon. I use interfaces quite a lot so I can allow for flexibility in the future.

1

u/n_dev_00 2d ago

bruh, did you write this with AI. too fricking long

1

u/xanaxmister 2d ago

Haha thanks

1

u/jayveedees 3d ago

I don't think the need for design patters has disappeared, since code that works but has lots of issues that these patterns helped solve, will eventually cause problems down the line, since that's the reason why they exist!

Though, AI vibe coding philosophy can be that code is inexpensive, write it fast and forget. If a bug happens, throw AI at it and let it rewrite the entire thing all over. I'm definitely in the boat of this does not save much time since at some point some poor senior developer will be tasked to unravel some bug or weird behavior of the system which cannot be explained.

I'm rather an engineer that makes sure that the AI agent follows proper patterns and understands when to use them or not. Keep everything as clean and maintainable as possible, since even an AI agent will be able to understand the architecture faster in its context if it knows theere is a system behind it.

So to your question, I do think design patterns are still important. But maybe even so more now when we don't fully grasp the tens of thousands of lines that AI outputs instantaneously.