logoalt Hacker News

rkuodystoday at 9:07 AM1 replyview on HN

I am honestly curious about your point on productivity boost. Are you saying that you can write tests at the same speed as AI can? Or is it the point that tests written by AI is of much lower quality that is not worth using them? I am at the role of solo-preneur now and I see a lot of benefit from AI. But then I read posts like yours that experienced devs don't see much value in AI and I start to doubt the things I do. Are they bad quality(possibly) or is it something else going on.


Replies

imrontoday at 10:32 AM

I’m not faster at writing tests than AI but my own code needs fewer tests.

When I’m writing my own code I can verify the logic as I go and coupled with a strong type system and a judicious use of _some_ tests its generally enough for my code to be correct.

By comparison the AI needs more tests to keep it on the right path otherwise the final code is not fit for purpose.

For example in a recent use case I needed to take a json blob containing an array of strings that contained numbers and needed to return an array of Decimals sorted in ascending order.

This seemed a perfect use case - a short well defined task with clear success criteria so I spent a bunch of time writing the requirements and building out a test suite and then let the AI do its thing.

The AI produced ok code, but it was sorted everything lexicographically before converting to a Decimal rather converting to Decimals first and sorting numerically so 1000 was less than 900.

So I point it out and the AI says good point, you’re absolutely correct and we add a test for this and it goes again and gets the right result but that’s not a mistake I would have made or needed a test for (though you could argue it’s a good test to have).

You could also argue that I should have specified the problem more clearly, but then we come back to the point that if I’m writing every specific detail in English first, it’s faster for me just to write it in code in the first place.