• dan@upvote.au
    link
    fedilink
    arrow-up
    14
    arrow-down
    1
    ·
    edit-2
    1 day ago

    My employer is trying to get people to use AI more, too.

    I’m skeptical of AI, but I’m finding it useful for menial tasks - things that you’d otherwise automate using an AST-based codemod tool (like jscodeshift, libcst codemod, etc), a hacky find/replace, or do by hand (boring, tedious work that I’d rather not do). Giving the AI system an example patch for something like migrating away from a legacy API, and saying “do this same thing across these 200 other files”, can have pretty good results.

    In general, it seems like a good tool for things where the entire process is well-defined - the prompt and context provide all the info it needs - and I include example code in the context.

    I don’t trust it for brand new code in a large existing codebase… Even the best AI models still get a lot of things wrong.

    • SpaceCowboy@lemmy.ca
      link
      fedilink
      arrow-up
      3
      ·
      17 hours ago

      For sure. I copy JSON from swagger and get a Typescript interface all the time. It’s boring stuff to do manually, and yeah there are definitely tools I could use for this, but it’s not as easy. It’s basic stuff, and the AIs can do it reliably.

      I have a bunch of chat contexts for things like this. SQL -> DTO object, JSON -> Typescript, etc. So it’s kinda a swiss army knife kind of tool where it can do a bunch of basic stuff. Sure there are specific tools for each of these things, but it’s easier to have all of those basic functions in one place.

      But this week I was doing some very complicated logic that required in depth knowledge of the data structures and consideration for a whole bunch of edge cases… so I didn’t even touch an LLM this week. Though next week I might add some new tables to the DB, I’ll think about the data relationships and get that right, and then I’ll have the AIs deal with all of the boring shit involved in getting it to the FE.

    • AdamBomb@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      21 hours ago

      Yep. There’s lots it can do, but more I wouldn’t trust it with. Useful for certain tasks.