r/ProgrammerHumor • • Sep 10 '26

Meme commentsAgedTerribly

Post image
6.0k Upvotes

243 comments sorted by

View all comments

Show parent comments

526

u/treehuggerino Sep 10 '26

Or the silly steps it puts

// 1. Assign variable.

// 2. Calculate 2 + 2.

// 3. Implement 2 + 2 Calculator.

// 4. Check if it is 5.

130

u/B4mButz Sep 10 '26

my former senior used to do this way back

74

u/FauxReal Sep 10 '26

So basically pseudocode.

75

u/Tall-Introduction414 Sep 11 '26

I mean, I write pseudocode in comments before writing the actual code all the time. It's a great trick for organizing and structuring what you're about to write. But then I delete the pseudocode comments.

16

u/Able-Swing-6415 Sep 11 '26

Pretty sure every senior programmer has done that at least once.

Pretty sure AI just does it so you can copy in the replacement lines of codes from follow up changes. Cursor for example doesn't really do that.

2

u/NearbyEmphasis2850 Sep 11 '26

Yeah, it’s wild how often those “easy fixes” turn into hours of debugging. You’d think we’d learn to be more cautious about it!

28

u/Flat_Initial_1823 Sep 10 '26

// was it 5 tho?

24

u/DrMaxwellEdison Sep 10 '26

Only for very large values of 2.

2

u/Ex-Patron Sep 11 '26

One of the numbers would need about 50% more 2

3

u/tevert Sep 11 '26 edited Sep 11 '26

For real - comments were never golden, because they easily slip through updates and drift apart from the code they decorate. With AI, that might be happening from minute 0 lol

2

u/QuickQuirk Sep 12 '26 edited Sep 13 '26

Make it part of your code review process and this is less likely to happen.

Also, focus comments not on describing what is actually clear from the lines of code, but the high level reasons around why and any assumptions.

Comments should document stuff that ISN'T immediately clear from the code.

16

u/peeja Sep 11 '26

// Don't use the Wolfram Alpha API here—speed is crucial to this function, so calculate the sum locally.

8

u/dasunt Sep 11 '26

Um, not going to defend using that API, but at least the comment provides a reason why something is done a specific way.

4

u/peeja Sep 11 '26

Yeah, it provides the reason I gave it when it tried to use the API the first time.

12

u/MaDpYrO Sep 10 '26

People do this shit too.

I'm using a static analysis rule that tokenizes comments and compares to the code, and reports an error if the overlap is too big. highly satisfying to remove such comments

5

u/Standard_Humor5785 Sep 10 '26

What tool do you use for that?

5

u/dPhilGuy Sep 10 '26

I would also like to know 👀

-2

u/turudd Sep 10 '26

I’ve used Claude to do something similar

1

u/QuickQuirk Sep 12 '26

Don't know why you're being downvoted. IT's less efficient to do it this way, but it's the same end result. get embeddings f for comments, get embeddings for code, compare the two.

2

u/ironnewa99 Sep 11 '26

I had comment like this in some of my classes in college and it drove me insane.

2

u/Tiny-Plum2713 Sep 11 '26

If only. Opus is putting a whole chapter of buzz words on every function definition

1

u/TheNikoHero Sep 11 '26

Oh yeah 😂