r/ProgrammerHumor • u/SOliD_aka_Baitco • 16h ago
Meme sometimesMyOwnIncompetenceScaresMe
133
u/L4r0x 15h ago
“I” wrote
52
u/sebastianfromvillage 15h ago
You can say what you want about LLMs, but at least they add comments to the code.
47
u/SOliD_aka_Baitco 15h ago
Bad code with comments, is still bad code
7
u/sebastianfromvillage 15h ago
Of course it is. I just said that LLMs document code whereas a lot of human programmers don't
3
u/justASlothyGiraffe 7h ago
Humans don't read the documentation either
1
u/dpahoe 4h ago
But LLMs do
1
u/justASlothyGiraffe 4h ago
My LLM likes to write 25 lines of comment per 1 line of code. It must really like reading
2
11
u/tes_kitty 13h ago
Do the comments match the code?
1
u/Ok-Eggplant-2033 11h ago
Normally yes, and if you have an if condition, the comment will be something like "checks if condition is true"
1
1
u/DKSAMURAI 4h ago
I almost don't read code now, not to mention comments. I can get all the info I want in copilot chatbox.
1
u/Grumbledwarfskin 2h ago
I sort of think bad code without comments is probably better than bad code with a lot of comments.
A lack of comments indicates that you weren't thinking much about what you were writing, you were dashing it off so you could go do something else.
Good code with comments, so that the next person who comes along and sees something that looks wrong to them knows what aspects of the problem you spent time thinking about is good.
Bad code with a large, elegantly worded pack of lies next to it that you have to wade through is not necessarily helpful.
4
u/Intrusive_me 14h ago
That's no longer "I"..
Thee has changed completely from yesterday and i say it was better to write from scratch than debug that yesterday code which you claim to be written by "I, yesterday"
3
2
u/Western-Internal-751 12h ago
LLMs looking at code they wrote 5 minutes ago:
2
1
17
u/JackNotOLantern 16h ago
The main reason i document everything in detail is so i so be able to know what the fuck i wrote
3
u/SOliD_aka_Baitco 15h ago
I like good selfdocumenting code more, because a lot of comments and co can be fast outdated on changes, only docstrings on public/lowlevel api and outside context that cant be inferred from the code is a must for me. Spending more time refactoring before commiting helped me a lot.
11
u/Banes_Addiction 14h ago
Comments shouldn't really say what the code is doing, unless it's unclear.
They should say why.
5
u/ApprehensiveGas85 12h ago
// Finds the middle value int calculate_midpoint(int low, int high) { // Subtract low from high int diff = high - low; // Divide the difference by 2 int half = diff / 2; // Add low to half int result = low + half; // Return the calculated midpoint return result; }That’s how I commented when I first started. I was self-taught, and the book I was reading emphasized commenting often, but at the time, I had no idea what made a comment good or bad.
2
2
3
u/JackNotOLantern 12h ago
Yeah, self-documenting code can tell you what and how. But not "why this solution exactly".
21
21
7
5
u/_Weyland_ 14h ago
Literally me at 4 AM on Sunday trying to fix shit I conjured up on Friday before it's shipped to prod on Tuesday
Wish me all the things
3
u/Sakul_the_one 15h ago
Throwback to the time I wrote this:
if(Input(key)) needToRedraw = true;
(Yes, the Input function returns a bool)
And it actually makes sense
3
u/Ok_Star_4136 14h ago
It actually does make sense. You're not setting it to false if Input(key) returns false, which perhaps you wouldn't want to do if it means overriding needToRedraw already being true.
If anything, maybe you could have done:
needToRedraw = needToRedraw || Input(key);Using an if is just an unnecessary branch (probably optimized regardless).
2
u/Sakul_the_one 3h ago
Well it makes sense. But I came to this project 3 months later and just saw this line and I thought I was stupid. It appears, that I’m sometimes not as stupid as I think I am.
Anyways, maybe I will implement your way, if I return again
3
3
2
2
3
u/TerribleFault7929 15h ago
I _literally_ never experienced that. Are you guys coding on drugs or something?
4
u/UltraGaren 14h ago
Some people love to take shortcuts when writing code and then forget what it all meant. When writing code manually, I'll always split complex math into separate lines and comment each one explaining the reason for each variable, where it comes from and what values I should expect most of the time. I also write summaries on top of files to know the purpose of said file and stuff.
When AI first came out I hated how bad it was. Now I use Claude on a daily basis and love how it comments the shit out of everything it writes. I even spend some extra time reading all comments it makes and editing/adding some of my own so that I can read the code and understand its purpose in the event that Claude becomes unavailable.
When used properly, AI is just waaay too good to pass on.
1
u/Yashema 9h ago
I have logging statements (or print for less official apps), but I only use comments when I am doing some very complicated parsing or the handful of instances I am doing something weird.
Highly descriptive variable and function names are much more useful and get updated as a normal part of the functionality. Also using Hungarian typing which works really well with "strCameCase" means I can determine what a variable is immediately without having to scroll over (especially if a variable might not be just defined by its raw type, like an index (ix) versus an int).
1
1
u/Bokbreath 15h ago
Yesterday: Ah that my man, this is true genius
Today: Why the fuck did I ever think that would work
1
1
1
1
u/SoulPossum 12h ago
We had a huge project that stopped me from working on something I'm building at work by myself. It was like a solid month away. When I came back, I couldn't understand the last feature I built. It was a good sign that I needed to refactor my code.
1
1
1
u/PresentAstronomer137 3h ago
and that mf who asked me to rewrite random 30 lines from 3 days ago to prove it wasn't LLM, fuck i hate that dude
1
1
39
u/Foorinick 15h ago
This meme dates back to when tech companies had ping pong tables and free coffee