nibbles

Does Claude write higher quality code from my prompts than I would without AI? If I’m being intellectually honest, I think I have to say yes here with an asterisk.

Does Claude write higher quality code from my prompts than I would without AI? If I’m being intellectually honest, I think I have to say yes here with an asterisk.

All my career, I have been in the camp of “quality is in the tests“. I adopted this fairly early on after I read Michael Feathers’ book Working Effectively with Legacy Code, where he says, “Code without tests is bad code” (verbatim, not paraphrased).

If code is beautiful and elegant and efficient, but doesn’t have tests saying so, it’s kind of like a tree in the forest kind of problem. How can you prove that it is good and continues to be good without something positively asserting it on an ongoing basis? Claude writes so many tests, even if the code isn’t as elegant as what I would write, that it’s hard for me to argue from that previous position that my code was better before Claude. I didn’t cover my code as well (LOC or edge cases) because I made priority/economic tradeoff decisions.

The asterisk is that I spend a lot of time making sure that the tests are accurate, and the code is elegant and uses the design patterns that I like. I’m capable of doing that more often now, because I’m not as constrained by time as I was before. I can arrive at an ideal solution Instead of the expedient one that moves me to the next work.

I know, I know. Quality isn’t just about tests, and we’ve all seen hot-mess code that has tests. Please don’t throw your Zen and the Art of Motorcycle Maintenance books at me. It’s just harder to defend the position that my artisanal, hand-rolled code was better. I don’t think it was, because I pair my experience now with a much faster development process.

Original LinkedIn post