HexDecimal

joined 2 weeks ago
[–] HexDecimal@feddit.online 11 points 19 hours ago* (last edited 18 hours ago) (1 children)

From what I've seen and heard, AI seems to do well for test-driven development. That doesn't necessarily translate into good code, but it does translate into tested code.

At the very least it can translate the documentation of an API into the appropriate tests to verify the documentation is correct, and I'm being quite humbled by that.

[–] HexDecimal@feddit.online 8 points 19 hours ago* (last edited 18 hours ago) (1 children)

The important part is that the tests track regressions and they're helpful for that. After that, it's okay if tests are mostly write-only.

I've noticed that AI commentary tends to describe what the code is doing verbatim which is better for naming tests and functions rather than writing code comments, docstrings, or change notes. I usually have to fix this public-facing documentation to not talk about library internals which no user of the library would ever care about.

So far I feel that AI assists are good when you have the time and effort to push back on them, but that isn't an option for all projects, it works well for my own projects which have very few contributors in the first place. For the most part I can treat them with the same scrutiny as human written code. When the person submitting the code is obviously not checking their own code then that's a problem.

[–] HexDecimal@feddit.online 51 points 20 hours ago (16 children)

As an open source project maintainer I can always tell whenever a pull request is AI assisted because no human would ever write full tests for all their pull requests.