Engineering · From LinkedIn

AI-generated code is a first draft

Code generation has become faster in the age of agentic AI.

But that also means we can produce messy code faster than ever.

Earlier, writing bad code took time.

Now, with LLMs and coding agents, we can generate a complete feature, multiple files, helper functions, API calls, validations, and edge cases very quickly.

That is powerful.

But it also creates a new responsibility.

Just because code is generated faster does not mean it should be accepted as it is.

I often see people treating AI-generated code like the final answer.

For me, it is usually the first draft.

After every feature or task I build using an LLM, I try to ask a few more questions:

Can this be organized better?

Is this logic sitting in the right file?

Can this be separated into service, controller, utility, or validation layer?

Are we repeating the same logic in multiple places?

Will another developer understand this after 6 months?

This matters even more when working with Express and Node.js.

Frameworks like Express are very flexible, but also highly unopinionated.

That means the framework will not stop you from putting everything inside one route file.

It will not force you to create proper boundaries.

It will not tell you when your controller is doing too much.

So the responsibility comes back to the engineer.

In my opinion, using AI well is not only about asking: “Build this feature.”

It is also about asking: “Refactor this into a better understood architecture.” “Move this logic to the right layer.” “Remove duplication.” “Make this easier to maintain.” “Keep the implementation simple.”

Some people may see this as being conservative or slow.

But every line of code we write becomes something the team has to maintain, debug, extend, and explain later.

Moving fast is good.

But moving fast with a codebase that becomes harder every week is not real speed.

AI can help us ship faster.

But it should also help us keep the codebase cleaner, simpler, and easier to reason about.

That is where engineering judgment still matters.

← All short posts