Discussion about this post

User's avatar
Chris Paterson's avatar

When I review AI code, I'm not reviewing the _code_. I'm reviewing the design decisions that it made at coding time, to spot where the design we agreed up front had gaps that the AI has had to fill by itself. Because I don't know about your experience, but mine is that AI is still bad at design.

Working on something over the weekend that exposed a basic CRUD API, it worked in phases - first, to support local testing of business logic with no external dependencies, it built an initial mode of operation where it maintained an in-memory state store and then persisted the whole thing to disk. Okay, cool, that's useful. Then, in the next phase, it was time to introduce an actual database. The AI's approach? "Well, we've got this in-memory state store, so let's just maintain the pattern of mutating that and then persisting it, only now to the database. I'll just delete the database and recreate it on full on every write operation!"

Ummm. Now, in this case, I got another AI agent to do the first pass of review, and it did highlight that that was... not very efficient. The coding agent's handling of that feedback?

"You're absolutely right! Let's instead iterate through every item in the store, attempt to INSERT it, attempt to UPDATE it if the INSERT generated a conflict, then iterate through every item in the store again to build a set of IDs, and DELETE everything in the database whose ID isn't in that set. Much better."

Sorry - I still can't bring myself to put code into production that I haven't looked at at all. I don't need to check for dotted Is and crossed Ts, but AI still has yet to develop a good enough sense of smell to remove the need for me to at least give it a sniff.

Rob Dover's avatar

I'd like to offer something of a counterpoint here. I think to look at Code Review by Humans as solely a mechanism to improve code quality is a mistake. In a properly functioning development organisation, it's doing a lot more jobs than just that:

- It's disseminates knowledge about code changes around the development team.

- It's an opportunity for alternative solutions to be proposed.

- It provides opportunities for teaching/mentoring between more senior and junior developers.

- It's a key checkpoint to ensuring the maintainability of the code (this is distinct from whether there are bugs in it!)

- It's a way of making people feel more collective ownership of the code and less personal ownership. After review, the code is accepted as belonging to the team that looks after it as opposed to being the baby of the person/tool that wrote it.

A key thread running through all of these points is that Code Review is a vector for communication between humans working on a project together. With one or two developers perhaps that is less important, but as your project scales to have more people working on it this kind of communication is critical to a well functioning team. Maybe exactly what you need for each of these points changes as the amount that one person can accomplish by themselves with AI help continues to evolve. But I'm unconvinced that the need for them will disappear. Unless your vision of the future is that all software projects can be done by a single human? (Which personally I find quite depressing - collaboration is fun!)

2 more comments...

No posts

Ready for more?