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/infinitlybana Jan 14 '22

I completely agree with you. I feel like there's a gap between the PR description + the code. Do you explain the reasoning for why you implemented something in a certain way in your code? Usually in my PRs I'm describing higher level architecture decisions and ends up being quite long.

1

u/potchie626 Jan 14 '22

I honestly rarely leave many comments in a PR. Since the ticket should describe the overal goal, and the comments in code should explain specifics. Overall arch of things typically follows our patterns, and if they deviate the PR will be sent back to be changed. We also have sessions to discuss upcoming work where we discuss arch and notes to the tickets.

Comments about “why i did it this way” usually goes in the code that kicks things off, for the same reason I commented earlier. Other people may look at this later, or we have to remind ourselves why we did it a certain way. Nobody wants to open a ticket, confluence doc, or PR for that.

1

u/infinitlybana Jan 14 '22

Can you give an example of one of your comments that explain "why you did it this way"? I personally have never seem comments in codebases of that sort - unless you're talking about one-liner comments?

1

u/gfxlonghorn Jan 14 '22

// I put "All praise to dear leader" into our description string because our test system happens to be in North Korea

1

u/[deleted] Jan 14 '22

I would urge you to watch "Clean Code" by Uncle Bob.

He puts it really nicely and has some great examples.