r/TheMachineLearning • • 21d ago

Frontier LLMs stopped adding code comments

Post image
720 Upvotes

178 comments sorted by

View all comments

1

u/esaule 21d ago

I want very little comments in code. Functions should tell me what they do. And tbat's about all I really want.

Then if something is truely odd, then yes tell me what is going on in a comment. But in general there probably should not be comment in a function body.

1

u/tigerhuxley 18d ago

Sounds like you’ve never deployed anything in production before. Or you don’t give a shit about people who have to maintain your code.

1

u/ThenExtension9196 17d ago

You do realize humans maintaining code ended this year right? The next person to touch your code is just going to prompt Claude at it.

1

u/FenrirBestDoggo 16d ago

Even claude needs context. Whether its a human or an LLM looking at a piece of code, the only way either will understand why you took a weird route is if you add context to it through a comment. There are genuinly times when the environment calls for some weird workaround, and an LLM that is trained on 'general best practices' will not understand why you did that and just change it to a broken version that might have already been used in the past and failed.

1

u/TheRealSeeThruHead 15d ago

comments are by far the worst context you can give an llm
give them readable code, and types

1

u/FenrirBestDoggo 14d ago

You are missing my point. Code is a means to an end, the comment I am refering to should explain that end if its not self explanatory/obvious.

1

u/tigerhuxley 14d ago

Yeah none of these devs have shipped real products or they wouldnt be saying this.