• beleza pura@lemmy.eco.br
    link
    fedilink
    arrow-up
    2
    ·
    7 hours ago

    i’ll be honest, that regex gives me the chills, but i’m not a fan of regexes in the first place, so maybe that’s on me

    anyway, maybe you’re right, but what still gives me pause is verifying the result is correct. maybe the llm is giving me something that works for the happy path but breaks in some corner case for some input i didn’t think of. unit tests only get you so far in these cases

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      arrow-up
      3
      ·
      7 hours ago

      It’s precisely the kind of thing I would not want to figure out by hand, but it’s fairly easy to validate that it does what I want it to. The use case here is well defined, and it’s pretty easy to write tests for the expected behaviors. In general, I like to treat tests as contracts for the functionality of the app.

      Meanwhile, the same argument would apply to hand written regex as well. People write code that works on a happy path, but breaks in some corner case all the time. This is a common occurrence without LLMs.