Hacker News new | ask | show | jobs
by shadowgovt 848 days ago
I agree on that example.

But contrast with this example: https://github.com/spring-projects/spring-boot/pull/39754/fi...

A function named `apply` with no documentation; you have to go up to the class to find the docs. And yes, it's not DRY to repeat the docs, but the fact the tool can pull relevant context into this location is helpful if it could be used as an on-the-fly doc generator (assuming, of course, it gives true output).

People (understandably) don't want to repeat themselves but they also can't predict what entrypoint a reader enters their class from. I've definitely bounced off APIs before because something like `apply` isn't doc'd even though it's doc'd in source twenty lines away (because I'm busy; I'm not scanning entire source files on the off chance that the thing I'm looking for is nearby).

1 comments

Unfortunately, your brain will have been trained to ignore all comments by the 100 other completely useless comments that do nothing but add noise.

If the tool generated that one comment without generating any useless comments, then it might be worth using.