this post was submitted on 28 Oct 2025
188 points (96.5% liked)

Programming

23348 readers
226 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] forrcaho@lemmy.world 8 points 6 days ago

I recently asked ChatGPT to generate some boilerplate code in C to use libsndfile to write out a WAV file with samples from a function I would fill in. The code it generated casted the double samples from the placeholder function it wrote to floats to use sf_writef_float to write to the file. Having coded with libsndfile over a decade ago, I knew that sf_writef_double existed and would write my calculated sample values with no loss of precision. It probably wouldn't have made any audible difference to my finished result but it was still obviously stupidly inferior code for no reason.

This is the kind of stupid shit LLMs do all the time. I know I've also realized months later that some LLM-generated code I used was doing something in a stupid way, but I can't remember the details now.

LLMs can get you started and generate boilerplate, but if you're asking it to write code in a domain you're not familiar with, you have to understand that — if the code even works — it's highly likely that it's doing something in a boneheaded way.