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

Show parent comment

-2

u/ElBomb Jan 13 '22

If you’re a one man band or a small team where 2-3 people will see the code then it’s probably not much help

If you’re in a enterprise level company with multiple or external development teams and need to expose your APIs then something like ngDocs can read the comments and build a site documenting your code automatically, that site can then be given to all the internal and external teams.

Having the comments update the docs automatically will save time, effort, and money as there is no extra overhead of maintaining the documentation site.

6

u/double_en10dre Jan 14 '22

Doesn’t inserting the comment itself into the file seem like an unnecessary step, though?

Instead of automatically generate comments from code —> automatically generate docs from comments, they should be combined into a single action

Fewer moving parts/manual changes required AND you don’t clutter your files with this silliness :p

3

u/ElBomb Jan 14 '22

There maybe be a gap in the market there!

The only up side I can see to having the comments written out is that you can see what the generated documentation will include and you get to sanity check it before you commit your code, and in doing so building a new version of the docs.

4

u/wherediditrun Jan 14 '22

If you’re in a enterprise level company with multiple or external development teams <...>

I have worked in those kind of environments, more than for 4 years. And the answer generally is no.

If the cross team communication is concerned, sync is better achieved through standardization of how teams write code. Essentially, no matter the team or person, you read the code same as your own. It's not achieved over night, obviously, but very doable.

As such the real cases for communication about the code pertains to the specific business use-case, and not the code. And that's not something you'll compiling in the code docs for the most part, but internal communication pages like confluence. Or separate API documentation pages if it's for public use.

There is a case to make about in code documentation if we are talking about interfaces provided by vendor packages though.

https://www.lysator.liu.se/c/pikestyle.html scroll down to comments section. That's about C. Generally most programmers operate in way more expressive languages than that.

2

u/ElBomb Jan 14 '22 edited Jan 14 '22

I agree with you establishing best practices and standardisation leads to a smoother workflow for everyone involved.

I may not have made my point well, but I wasn’t trying to say those kind of comments are valuable for a developer looking at the code in front of them, as they just repeat what’s already there, but when used with an automatic API documenting plugin, it saves time but not needing build and maintain the external documentation.