But good code isn't just "does it work", it's also
- is it understandable
- is it maintainable
- how much work is adding new features
- is it written in a way that adding new features means rewriting a lot of it
- is it written in a consistent style
- and lots of other things
I use AI to write a lot of my code, but the only time it's clearly "better" than a competent human is for one-off things.
That being said - AI + human is, without any doubt in my mind, better than either one alone.
Aye. Some of these targets are far away, others perhaps closer.
Human+AI systems is a good match. Like Human+docs or Human+encyclopedia.
- is it understandable
Yes you can ask the agent anything about it and interrogate it until you understand.
- is it maintainable
Yes it’s easy to ask the ai to add new features or to refactor it entirely.
- how much work is adding new features
Depends, it could just be one prompt, it’s usually many prompts. If the refactor is large it can take weeks. But before AI something g equivalent would take months.
- is it written in a way that adding new features means rewriting a lot of it
Usually no, but that depends on how well the agent is being directed and what the features are. If you come up with a feature that requires a new architecture, ai makes it doable rather than saying “would be nice but we’d also have to implement this whole new architecture and that’s a lot of work”
- is it written in a consistent style
Styles can be applied mechanically with linters and formatters, so as much as any codebase written by multiple people.
Absolutely, the Win32-WASM layer it wrote is some of the most evil looking code I have seen in my life. But realistically, why keep it maintainable for humans if you won't find anybody that can work on it without AI anyways?
If we humans are just doing code style checks, file organizing and doc cleanups I feel we have demoted ourselves to code janitors. This is neither fun nor going to last.
Personally I've always strived for minimalism, to find the smallest, fastest, simplest solution possible so I'm pretty jaded now, too...