-
Notifications
You must be signed in to change notification settings - Fork 195
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
Remove Container-owned Constants Rules #21
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modifies a few rules to match our switch away from keeping class-level constants in an intermediate container. The rule changes are fairly simple; additionally changes the format of 2.5's code example (things were about to get a bit weird with both comments and marks), and completely removes rule 3.1.16 (this rule was specifically a justification for keeping constants in an `enum` over `class` or `struct`, but without using containers the rule doesn't have much use)
Update recommended case back to `camelCase` for constants
cezarywojcik
requested changes
Feb 13, 2018
README.md
Outdated
@@ -187,27 +187,26 @@ class URLFinder { | |||
} | |||
``` | |||
|
|||
* **2.5** All constants other than singletons that are instance-independent should be `static`. All such `static` constants should be placed in a container `enum` type as per rule **3.1.16**. The naming of this container should be singular (e.g. `Constant` and not `Constants`) and it should be named such that it is relatively obvious that it is a constant container. If this is not obvious, you can add a `Constant` suffix to the name. You should use these containers to group constants that have similar or the same prefixes, suffixes and/or use cases. | |||
* **2.5** All constants other than singletons that are instance-independent should be `static`. All such `static` constants should be placed in a marked section of their class, struct, or enum. For classes with many constants, you should group constants that have similar or the same prefixes, suffixes and/or use cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add tick marks for class, struct, enum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, + updated the "updated" line further up on the guide per offline discussion
cezarywojcik
approved these changes
Feb 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modifies a few rules to match our switch away from keeping class-level constants in an intermediate container.
The rule changes are fairly simple; additionally changes the format of 2.5's code example (things were about to get a bit weird with both comments and marks), and completely removes rule 3.1.16 (this rule was specifically a justification for keeping constants in an
enum
overclass
orstruct
, but without using containers the rule doesn't have much use)