this post was submitted on 27 Oct 2026
175 points (98.9% liked)

Programmer Humor

33844 readers
1559 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 3 years ago
MODERATORS
 

I got the first prototype version of the code for the project I'm currently working on. It is an Arduino Sketch, that contains 1k lines, stores every single Value needed as a global Variable and every function reads and writes to these global variables, instead of taking them in as parameters. This code is so bad, that I refuse to even look at it. The effort to take the existing codebase and transform it into something useable is as high as rewriting it from scratch.

When telling my colleague that his code is absolute garbage, he just told me "its not my code, Claude did it". I am constantly pushing towards implementing the project in a proper way, but it has been nothing but fights against people who don't know how to code and who refuse to acknowledge that ignoring any standards of maintainable code does not turn out in the end and it makes sense to rewrite the project sooner than later.

you are viewing a single comment's thread
view the rest of the comments
[–] cows_are_underrated@feddit.org 8 points 1 day ago (2 children)

No way am I going to trist AI on rewriting that. The entire underlying structure is so bad that feeding that into an AI model and tasking it with making a decent code structure out of it will very probably not work the way I want it to. AI is a tool that excels at small isolated tasks, but under no circumstance do I allow it to create the outline of my project.

[–] locuester@lemmy.zip 1 points 20 hours ago

Small isolated tasks? You only use it in 2024 or something maybe?

You don’t have to trust it, but it’s certainly valuable to learn what it can do.

[–] glibg10b@lemmy.zip 4 points 1 day ago* (last edited 1 day ago)

If you break it into simple tasks, it's not that bad. For example, for each function, ask it to add reference parameters for the global variables used by that function, and to modify the call site accordingly

With tasks this small, you're not asking the LLM to think for you, you're just using it to automate a boring task

Once that's done, seeing each function's interface should make it easier for your brain to identify what further refactoring is needed