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

src: document headers members in src/util.h #33070

Closed

Conversation

juanarbol
Copy link
Member

Document the used members of the headers in src/util.h,
also removes the assert header which is not being used.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Apr 26, 2020
@juanarbol juanarbol force-pushed the juanarbol/add-headers-information branch from 13881f5 to dfe3f44 Compare April 26, 2020 01:14
@juanarbol juanarbol added the review wanted PRs that need reviews. label May 5, 2020
@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed review wanted PRs that need reviews. labels May 19, 2020
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@sam-github sam-github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not blocking, but in my experience, these comments are not useful. They are difficult to evaluate as to whether they are correct now, and they are impossible to keep up to date with changes. The std library headers declare many types, methods, functions, etc. Someone will use one of those types in a .cc file in node, it will be present, their code will compile, PR will merge. But, they will not go hunting through src/util.h (or any other headers) and update these comments, so the comments will become out of date very quickly.

Also, I don't see the comments having any value. Anyone who wants to know what features are declared by <cstring> can and will read the docs for that header, we don't need to document it.

The only time comments are needed on header includes is when they are being used for suprising reasons. Perhaps some system has a bug, and requires a header included where other systems would not, so a comment is needed so the include isn't removed during cleanup. Or perhaps, a symbol is availble in a non-standard location. Etc.

Sorry, but I've removed enough of these comments from old code bases where they have been found, and found completely out of date, and never found them to be useful. On the other hand, they don't actively harm a reader of the code, anyone reading can just ignore them as "probably out of date", so I don't object to adding them if some folks here think they can keep them up to date and find them useful.

@juanarbol
Copy link
Member Author

to be honest, if we're deleting code like this, I'd definitely close this PR, It does not make sense, I'll be deleted soon.

Or I could change this PR, I mean, cassert is not being used, I could delete the nominated "non-useful comments" and just remove the inclusion of cassert

@sam-github what do you think?

@sam-github
Copy link
Contributor

IFor unused headers, deleting their include statements SGTM, totally uncontroversial.

@juanarbol juanarbol removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 21, 2020
@juanarbol juanarbol force-pushed the juanarbol/add-headers-information branch from dfe3f44 to a667ed2 Compare May 21, 2020 20:33
@juanarbol juanarbol requested a review from sam-github May 21, 2020 20:33
Copy link
Contributor

@sam-github sam-github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@juanarbol
Copy link
Member Author

@sam-github you're welcome, thanks for your feedback, btw.

@nodejs-github-bot
Copy link
Collaborator

@juanarbol juanarbol added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 21, 2020
jasnell pushed a commit that referenced this pull request May 22, 2020
PR-URL: #33070
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
@jasnell
Copy link
Member

jasnell commented May 22, 2020

Landed 39ceb6a

@jasnell jasnell closed this May 22, 2020
codebytere pushed a commit that referenced this pull request Jun 18, 2020
PR-URL: #33070
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
@codebytere codebytere mentioned this pull request Jun 28, 2020
codebytere pushed a commit that referenced this pull request Jul 8, 2020
PR-URL: #33070
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
@codebytere codebytere mentioned this pull request Jul 13, 2020
@juanarbol juanarbol deleted the juanarbol/add-headers-information branch January 19, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants