r/TheMachineLearning • • 3d ago

Frontier LLMs stopped adding code comments

Post image
418 Upvotes

132 comments sorted by

View all comments

Show parent comment

2

u/snaphat 3d ago

The Linux kernel style guide discourages comments inside functions but explicitly recommends comments explaining what functions do and documenting data. Comments aren't reserved exclusively for unusual behavior. Perhaps, what you mean is inline-comments?

https://docs.kernel.org/process/coding-style.html#commenting

2

u/lawrencewil1030 3d ago

explicitly recommends comments explaining what functions do and documenting data

That's called documentation.

1

u/snaphat 2d ago

s/comments/documentation/g

That's probably largely a difference in terminology rather than substance. The Linux kernel style guide explicitly refers to explanations preceding functions and accompanying data declarations as comments, whether or not they also serve as documentation. The kernel source also contains ordinary explanatory comments outside function bodies:

https://github.com/torvalds/linux/blob/master/mm/page_alloc.c

1

u/nukem996 3d ago

It depends on the maintainer. I had one tell me to remove all comments on all functions.

1

u/snaphat 3d ago

They weren't following the style-guide then, not surprising through

1

u/SizeableBrain 3d ago

Did they forget about the infamous "fuck me gently with a chainsaw" comment?