• dan@upvote.au
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    4 minutes ago

    At work, I use AI for some things. Right now I’m rewriting some legacy spaghetti code that’s had a bunch of things hacked into it over the years. I spoke to the person most familiar with the expected behaviour and used AI to combine his info plus the existing code and unit/integration tests into a list of requirements.

    I wrote the new code and tests based on the requirements rather than based on the old code. After each commit, I used AI to check for parity between the old and new code, and keep a Google Sheet up to date with the progress (which features were fully implemented, and which ones were missing or had gaps). I had AI write some tests cases too - given the list of requirements, write integration tests for them based on the style of a few tests I wrote by hand.

    It has some quirks (eg for tests it loves over-mocking even though our skills tell it to mock as little as possible) but it definitely speeds things up.

    I use AI for small side projects at work too. Tweaking and adding features I want to shared libraries, internal tools to help our team debug stuff and automate triaging of bug reports (they’re all still reviewed by a human), etc.

    The entire reason I can trust its code is because I can read it and tweak it myself. I sometimes need to go through a few iterations to get AI code into an acceptable state. AI writing machine code directly, like what’s been talked about recently and what this post is referencing, is such a dumb idea.

    There’s other people at work that use AI for absolutely everything. Writing code, reading code, writing posts in our internal groups, etc. That’s something I don’t understand. Some people that are all-in on AI produce so much low-quality AI slop.