I’ve been playing around with Design Patterns and GPT4 lately. I am quite impressed about how I can describe an architectural problem to it and it can enumerate / decompose the problem into the required design patterns.
Anyone who’s used DPs knows that there is more to programming than that of course, there’s the actual biz logic you need to fill out the patterns with.
But what I’m finding is that it gives GPT4 a language that it can talk to you about novel architectural scenarios. And it isn’t just vague high level BS you might spout off in an interview, these are specific ideas you can actually use to solve problems.
Give it a shot and let me know how it works for you. Give it a complex architectural problem you’re dealing with, get it to reason about it a bit (enumerate classes, likely execution flows) and then re-feed that reasoning back to it and ask it to list out the design patterns how and why it will use them.
Initially, I just asked it for some example pattern impls, and it was ok. I then tried feeding it some reference impls, and it was able to dupe that just fine. That seems like a good way to go.
But right now, I’m on a different track, which is just to get it to describe a relatively complex architecture coherently but with specificity that can be reasonably critiqued. I ask why and how the DPs will be used.
It uses the patterns well. It decouples, builds with composition, and the patterns do what they’re meant to do when used. I did ask it to rethink a bit and make sure it wasn’t needlessly using them. It did so, and pared away the ones I thought were a bit superfluous.
I’m now generating some code off all of this, we’ll see how it goes.
What I like about all this is it provides a language that we can converse with while discussing architectural problems. DPs aren’t a silver bullet, of course, but it does provide coverage for a pretty big chunk.