1542
you are viewing a single comment's thread
view the rest of the comments
[-] jerkface@lemmy.ca 33 points 1 day ago* (last edited 1 day ago)

AI used extremely sparingly is sometimes helpful to an experienced coder. "Multivac, generate a set of unit tests for this function." Okay, some of these are dumb, but it's easier getting started on this mess than just looking at a blank buffer. Helps get the juices flowing a bit. But man, you try to actually do anything with it, and suddenly you're lost chasing a will-o'-wisp.

[-] craftrabbit@lemmy.zip 14 points 1 day ago

Oh man, I love ChatGPT for one thing in particular: "Hey chatbot, is there some library or standard library function for that very specific, yet still kinda generic thing I'm trying to do, so that I don't have to write it myself?"

It does frequently give a helpful answer. That is, it doesn't give me working code, but a helpful pointer to some manual where I can find good instructions for how to use the thing to solve my problem.

[-] mutant_zz@lemmy.world 3 points 1 day ago

I will usually google that kind of thing first (to save the rainforests)... Often I can find something that way, otherwise I might try an LLM

[-] craftrabbit@lemmy.zip 6 points 1 day ago

True that. But I often find that the search engine is not very good at giving me a solution if I don't know the name of a problem and only have my spaghetti thoughts on what the thing is supposed to do, and translating spaghetti thoughts into something a search engine can find is where the chatbot excels.

[-] SparroHawc@lemmy.zip 2 points 20 hours ago

Part of your trouble there is that Google is absolute dog shit these days. It used to be like magic; simple search terms would find you exactly what you were looking for in the first handful of results. Now you're lucky to find it on the second page.

[-] Ephera@lemmy.ml 14 points 1 day ago

I don't want to dismiss your point overall, but I see that example so often and it irks me so much.

Unit tests are your specification. So, 1) ideally you should write the specification before you implement the functionality. But also, 2) this is the one part where you really should be putting in your critical thinking to work out what the code needs to be doing.

An AI chatbot or autocomplete can aid you in putting down some of the boilerplate to have the specification automatically checked against the implementation. Or you could try to formulate the specification in plaintext and have an AI translate it into code. But an AI without knowledge of the context nor critical thinking cannot write the specification for you.

[-] merc@sh.itjust.works 2 points 1 day ago

Tests are probably both the best and worst things to use LLMs for.

They're the best because of all the boilerplate. Unit tests tend to have so much of that, setting things up and tearing it down. You want that to be as consistent as possible so that someone looking at it immediately understands what they're seeing.

OTOH, tests are also where you figure out how to attack your code from multiple angles. You really need to understand your code to think of all the ways it could fail. LLMs don't understand anything, so I'd never trust one to come up with a good set of things to test.

[-] jerkface@lemmy.ca 5 points 1 day ago* (last edited 1 day ago)

Unit tests become the specification once they are written. ChatGPT can easily write unit tests from whatever your specification is before that -- such as documentation, a bunch of comments and stubs, or even a first draft of the function itself, given enough context from the rest of the project.

Unit tests are too klunky to think in. You don't prototype the specification by implementing unit tests. And you really only lay down a few critical paths even if you "write the tests first" because code paths always come up during implementation that demand more test coverage anyway.

[-] Jankatarch@lemmy.world 3 points 1 day ago* (last edited 1 day ago)

Also after your 4th proper project you won't be as confused about "how to get started" anymore anyway.

You have a language of choice, a gui framework, and a build system you are comfortable with in mind already just start making folders.

[-] Henson@feddit.dk 5 points 1 day ago

Feels like there are some fine people here only working on new projects. Getting started could be, breaking down a 20 year old program, written in some wierd manner because the original developer use to do functional programming but was told to use java and oop. No comments, no tests, no normal patterns, no documentation.

[-] Jankatarch@lemmy.world 2 points 1 day ago* (last edited 1 day ago)

The argument was "AI helps when starting up new projects by making unit tests etc."

Also for not 20, but even building 10 year old libraries using AI is unhelpful. It just keeps hallucinating non-existent packages and functions.

At this point just drive yourself crazy while promising to become goose farmer and commenting every single line in your own words like god intended for programmers to do.

[-] jerkface@lemmy.ca 2 points 1 day ago* (last edited 1 day ago)

You read "new projects" in, actually. And the whole unit test thing was just an example demonstrating how AI use has to be tightly bounded to be arguably useful.

this post was submitted on 19 Aug 2025
1542 points (99.5% liked)

Programmer Humor

25843 readers
1742 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS