390
top 21 comments
sorted by: hot top controversial new old
[-] absGeekNZ@lemmy.nz 21 points 1 day ago

I had a less experienced person with me looking at some code.

I pointed out that a particular section of code is shit; just bad form, hard to debug and generally unpleasant to work with. I noted that the person that wrote this didn't really know what they were doing, sure the code works and has been working for a long time, but this is not how we would do things.

They asked "wow, who wrote this?" I replied "it was me 13 years ago"; it is a great ice breaker, in a non-critical part of the system, new people realize we all have to start somewhere.

It also allows me to go over the standards we use, why we use them and how to simplify debugging.

[-] lapping6596@lemmy.world 7 points 1 day ago

That's a great approach, hope you don't mind I'm gonna copy

[-] absGeekNZ@lemmy.nz 2 points 1 day ago

Happy to help

[-] PhilipTheBucket@piefed.social 35 points 1 day ago

Am I the only one who likes looking at my old code? Generally I feel like it's alright.

Usually the first project when I'm learning how to use some new language or environment is super-shitty. I can tell it's very bad, usually I don't like interacting with it if I have to make changes, but it's still not overly painful. It's just bad code. And that one exception aside I generally like looking at my code.

[-] corroded@lemmy.world 21 points 1 day ago

I think age of code plays a big part. 2 years ago: Yeah, I could do better, but it's workable. 15 years ago: Delete everything and just start from scratch.

[-] PhilipTheBucket@piefed.social 11 points 1 day ago* (last edited 1 day ago)

IDK, I just popped open a project from 10 years ago and it's perfectly clean, it's actually better than some of my modern code because it's not LLM-ified to save time.

I think it has a lot more to do with whether it was made in that "kind of crappy IDK what I'm doing" phase of programming. Some of your old stuff is going to be in that category sure. As long as you're out of that, however long it took you to get there or however far away it was in time, your code should be good.

[-] black_flag@lemmy.dbzer0.com 12 points 1 day ago

it's actually better than some of my modern code because it's not LLM-ified to save time.

Hmm that seems like an indication you're rushing things and maybe ought not do that?? 🤦

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

Yeah but surely I should have at least thought there is a better way.

When I was making my first python project (a caesar cypher) I did not know about loops in general.

But while I did not know the concept of loops, I did deduce functions from how main() is being used. Big mistake.

Entire thing was one big recursion.

[-] Endmaker@ani.social 10 points 1 day ago* (last edited 1 day ago)

But while I did not know the concept of loops, I did deduce functions from how main() is being used.

Entire thing was one big recursion.

Bro discovered functional programming.

[-] PhilipTheBucket@piefed.social 6 points 1 day ago

Yeah, that sounds about right lol. All my python projects for years were basically writing C in python. It actually took me all the way up until I got to look at the code ChatGPT likes to generate that I learned idiomatic python. My first database project was based on the Unix philosophy, where everything was strings (no ID keys, no normalization), because Unix is good.

The client wasn't happy when they looked at the DB code lmao. Whatever, it worked, they still paid us and I didn't do it again.

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

That means you're getting dumber

[-] PhilipTheBucket@piefed.social 4 points 1 day ago

Certainly possible

I'm also genuinely a little bit alarmed looking back now at my pre-LLM code and seeing the quality vs. the with-LLM code.

[-] SpaceNoodle@lemmy.world 9 points 1 day ago

There's nothing stopping you from wasting your time with the bullshit generator.

[-] PhilipTheBucket@piefed.social 7 points 1 day ago

I thought I had it worked out, how to sort of strike a balance so I can keep my focus intact and let it be helpful without wasting time constantly correcting its stuff or shying away from actually paying attention to the code. But I think my strategy of "let the LLM generate a bunch of vomit to get things started and then take on the correct and augmentation from a human standpoint" has let the overall designs at a high level get a lot sloppier than they used to be.

Yeah, you might be right, it might be time to just set the stuff aside except for very specialized uses.

[-] SpaceNoodle@lemmy.world 4 points 1 day ago

Specialised domains are where LLMs really show how thoroughly they can hallucinate bullshit.

[-] gerryflap@feddit.nl 16 points 1 day ago

Had this multiple times. Reading code from 2 years ago and being like "what idiot wrote this" only to find out the culprit was me. Then the memories came back and I remember why the compromises were made. What I learned from that is not to judge people too much on their code. What you see is a combination of both their skill and also a whole bunch of necessary compromises for which you may not know the reason. Nowadays I don't get too annoyed if the code is a bit messy. As long as it's well tested and documented.

[-] pageflight@lemmy.world 8 points 1 day ago

Yes — I think part of the lesson is to document the rationale and the compromises as much or more than the intended functionality.

[-] zqwzzle@lemmy.ca 12 points 1 day ago

Back then? You mean last sprint?

[-] bigFab@lemmy.world 2 points 1 day ago

That's scary as shit

[-] floo@retrolemmy.com 2 points 1 day ago

And this is why you comment your code

[-] synae@lemmy.sdf.org 1 points 1 day ago

It's not that it's purpose or implementation is unclear, it's how bad I was at coding ~~2 years~~ ~~6 months~~ ~~2 months~~ last week

this post was submitted on 12 Aug 2025
390 points (100.0% liked)

Programmer Humor

25681 readers
1675 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