-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
STL: WE SHOULD REMOVE THE SHOUTY COMMENT BANNERS! #306
Comments
I use these to find the definitions of a given feature, since searching for the thing directly often finds uses rather than the definition, and the implementation of a given thing often starts well above where it is declared. (Don't have a super strong opinion on keeping or dropping them, but I think they provide nonzero value. Whether that nonzero value is higher than the cost is arguable) |
I just found the definition of 1-arg |
I'm the person he found the 1-arg |
Will normal |
Here we are, one year later. Since we don't really care about these shouty banners, we have added lots of new code without them despite the inconsistency. Is it time to restore consistency by removing all of them yet? |
Yeah, I think they should be removed |
We talked about this in our weekly maintainer meeting and there's agreement - let's remove the shouty banners from the product code, and avoid adding new ones. This could be a "good first issue" except that it involves editing a whole bunch of files, which is difficult to ask of very new contributors (especially because such PRs tend to accumulate merge conflicts if they're open for any amount of time, and resolving merge conflicts is difficult for git novices). An experienced contributor could easily do this in a single PR. |
We currently follow a convention of introducing structs, classes, functions, etc. with "SHOUTY COMMENT BANNERS". A few examples:
STL/stl/inc/vector
Lines 410 to 412 in 580e61a
STL/stl/inc/algorithm
Lines 29 to 41 in 580e61a
STL/stl/inc/type_traits
Lines 536 to 541 in 580e61a
We've been thinking about changing this convention. It hasn't been applied rigorously, even for publicly-documented components (e.g. we have
// STRUCT TEMPLATE is_empty
but not// VARIABLE TEMPLATE is_empty_v
). It might have helped file navigation many years ago, but IDE/editor support for Go To Definition and Find In Files (e.g. VSCode Ctrl+Shift+F) makes it easy to find where components are defined.In theory, the banners could be most useful when publicly-documented components are preceded by internal support machinery, but in practice, we haven't always used them like that. For example, some but not all of the helpers for
is_permutation()
are introduced with// FUNCTION TEMPLATE is_permutation
:STL/stl/inc/xutility
Lines 4395 to 4455 in 580e61a
As these comments seem to provide minimal value today, are commonly overlooked by new contributors, and consume valuable lines, we should decide whether to keep or discard them.
The text was updated successfully, but these errors were encountered: