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

Remove Container-owned Constants Rules #21

Merged
merged 5 commits into from
Feb 14, 2018
Merged

Remove Container-owned Constants Rules #21

merged 5 commits into from
Feb 14, 2018

Conversation

brycebostwick
Copy link
Contributor

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)

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
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.
Copy link
Member

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.

Copy link
Contributor Author

@brycebostwick brycebostwick Feb 14, 2018

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 cezarywojcik merged commit 5f238fd into linkedin:master Feb 14, 2018
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.

2 participants