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

Naming convention: enum and enum-like member names #445

Closed
eladb opened this issue Apr 10, 2019 · 4 comments
Closed

Naming convention: enum and enum-like member names #445

eladb opened this issue Apr 10, 2019 · 4 comments
Assignees
Labels
feature-request A feature should be added or improved. style Issues related to coding style

Comments

@eladb
Copy link
Contributor

eladb commented Apr 10, 2019

Currently, we use two conventions for enum member names:

  1. Enum.PascalCase (like lambda.Runtime.NodeJs8)
  2. Enum.CAPS_SNAKE_CASE (like codebuild.LinuxBuildImage.UBUNTU_14_04_ANDROID_JAVA8_26_1_1)

It would be intractable to use pascal case for the 2nd example (Ubuntu1404AndroidJava82611...), and we should also be cognizant that jsii languages need to be able to delimit words for case conversions (see #980).

I am proposing that we standardize (at the jsii level) that all enum member and static property names will always be snake upper case (e.g. like C constants).

Any objections?

@rix0rrr
Copy link
Contributor

rix0rrr commented Apr 10, 2019

This is going to be ugly AF in many many places. But I don't have a better solution :(

@RomainMuller
Copy link
Contributor

I'm in favor of TRUMP_CASE.

This isn't going to look "pretty" in JS/TS, but that's a sacrifice I'm willing to make.

The current problem outlined in #980 and several other issues (some in awslabs/jsii even) can't really be fixed in another way (that looks constant-y).

@eladb
Copy link
Contributor Author

eladb commented Apr 10, 2019

@skinny85 suggests Ubuntu_14_04_Android_Java8_26_1_1

@eladb
Copy link
Contributor Author

eladb commented Apr 10, 2019

TRUMP CASE IT IS

@eladb eladb transferred this issue from aws/aws-cdk Apr 10, 2019
@SomayaB SomayaB added the feature-request A feature should be added or improved. label Nov 18, 2019
@SomayaB SomayaB added the style Issues related to coding style label Jan 7, 2020
@SomayaB SomayaB closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. style Issues related to coding style
Projects
None yet
Development

No branches or pull requests

4 participants