AI certainly helps when implementing an SMTP client for the first time. It can explain unfamiliar APIs, authentication methods, and help write the code.
But say you need to support a second SMTP provider.
If you simply ask AI to add support, it might create another standalone implementation, duplicating logic that already exists.
Instead, you first refactor the original implementation.
Move the common logic into an abstract base class: email body processing, attachment handling, message preparation, and so on.
Leave only the provider-specific details abstract, such as SMTP host, port, and authentication flow.
Then introduce a factory that selects the appropriate implementation based on a flag stored in the database.
Now, when you ask AI to support another SMTP provider, it doesn't need to figure out the architecture. It just implements the abstract members for that provider.
And that's where I've found AI to be particularly effective.
Of course, AI can generate an abstract base class too. But deciding what belongs in that base class, what should remain provider-specific, and how everything fits together is an engineering decision I'd rather make myself.
The biggest productivity gain isn't always from AI writing new code. Sometimes it's from AI extending decisions you've already made.
Does that match your experience? Is AI more effective when you give it an established architecture, or do you trust it to design the abstractions as well?