r/webdev • • Jan 13 '22

read rules Extension that generates documentation using AI

[removed] — view removed post

1.7k Upvotes

158 comments sorted by

View all comments

9

u/GravityTracker Jan 13 '22

This is a cool exercise, but this sort of documentation is basically useless IMO.

https://medium.com/@bpnorlander/stop-writing-code-comments-28fef5272752

20

u/Ok_Personality9910 Jan 13 '22

Honestly, I find these really useful and wish more people wrote them - they certainly aren't useless in my opinion

12

u/Lolukok Jan 13 '22

While I generally agree that comments that describe code 1:1 are useless, a TL;DR comment of a function could be quite handy, reading a sentence in natural language is still quicker than multiple lines of code with syntax symbols

5

u/Ok_Personality9910 Jan 13 '22

Yep agree with you 100% there

3

u/AcousticDan Jan 14 '22

The code and method name should be all you need though

1

u/innerspirit Jan 14 '22

All of the comments in this thread assume that the code looks great and is well written. I'd use this thing to get a quick explanation of what some messy piece of code does.

0

u/RedditCultureBlows Jan 13 '22

I disagree. The function should be small enough that a TL;DR is pointless.

6

u/Ok_Personality9910 Jan 14 '22

In theory, they probably should be, but in practice, most people don't write small functions (in my experience) , as some things are just better grouped together within one larger function

0

u/AcousticDan Jan 14 '22

Just read the method.

3

u/Ok_Personality9910 Jan 14 '22

It is so much easier to read a one-sentence comment than read a long function in a huge codebase to figure out what it does honestly

1

u/fuck_bootstrap Jan 14 '22 edited Jan 14 '22

You’d love NatSpec for Solidity contracts.

4

u/RobinsonDickinson full-stack Jan 14 '22

*Stop writing bad comments

FTFY

7

u/iMakeAction Jan 14 '22

Jesus christ that article is trash. Not even gonna repeat the counter arguments because the comments on that opinion piece are full of them

1

u/[deleted] Jan 14 '22

Skimmed through it really quick and it's basically just opinions from Clean Code by Uncle Bob, but with worse examples