Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix function comments based on best practices from Effective Go #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Daanikus
Copy link

Every exported function in a program should have a doc comment. The first sentence should be a summary that starts with the name being declared.
From effective go.

I generated this with CodeLingo and I'm keen to get some feedback, but this is automated so feel free to close it and just say "opt out" to opt out of future CodeLingo outreach PRs.

@Daanikus
Copy link
Author

Trying out some comment automation. I welcome any feedback as to how this could be improved. Thanks.

@vdobler
Copy link
Owner

vdobler commented Feb 18, 2019

This change has a some major drawbacks
First the Commit message: This CL is not a fix as the old code is not "broken". It should be named something like "adopt naming conventions" or "improve docs" or that like but not "fix".

Second: Go's documentation is made for humans. The convention mentioned in Effective Go are sensible but the proposed fix like "Rect: Draw rectangle of width w and ..." is worse than not starting the doc comment with the method name as is no longer is a sentence suitable for human consumption. A tiny change would make this nonsense a fine english sentence: "Rect draws rectangles of width w and ..."

I would merge a change to the doc comments if these are proper, sensible english sentences made for humans. But not some automatic-lets-please-brainless-tools change.

@Daanikus
Copy link
Author

Hi @vdobler, I agree with this and we are working on improving the logic and not being so naive with our changes. Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants