-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Update Coding Conventions to match Compose conventions #4154
base: master
Are you sure you want to change the base?
Conversation
I'm really in favour of this. Pascal case is much more readable. |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Update: the proposal got a green light from the Kotlin team (see the Slack thread), but the migration process to the new convention still needs to be figured out. |
bd5bedf
to
04d16ba
Compare
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
What are the next steps needed for this to be merged? I don't see any obvious marker of required future work, is this just waiting for a reviewer? |
@CLOVIS-AI I believe there needs to be a migration plan first. I suggested one on the Slack thread but I think the team was very busy at the time due to KotlinConf, so we didn't discuss further. Feel free to bump the thread – it's linked in the PR description. |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Bump. |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Bump. |
Hey! We are still not sure how to proceed with that because the change is beyond technical -- we have to revisit all our educational materials (as well as, potentially, books, StackOverflow answers, our own libraries and recommendations), update the toolchain (e.g. the default IDEA settings) and, what's the most important, make an assertive decision that this is the way and adopt it everywhere. Basically, we are changing an invariant and coding practice that was held true for 10-29 years. The best way here is to lay out your arguments in https://youtrack.jetbrains.com/issue/KT-48496/Top-level-name-of-constants-convention in a structured manner |
While discussing on Slack, there was an overall consensus that the current
SCREAMING_SNAKE_CASE
convention is inconsistent for a few reasons:PascalCase
convention. They have their own convention and reasoning for it written down here.PascalCase
andSCREAMING_SNAKE_CASE
allowed for enums isn't a good convention because it allows developers to make individual decisions on which style to pick and leads the project to a mixed (or no?) convention (Ktor's public enums are an example), defeating the purpose of a convention, which is to standardize the way developers write code and eliminate bike-shedding.Given that Kotlin 2.0 is about to be released, this is the perfect time to make this change, and the community, as well as some JetBrains team members, have voted in favor of this change. I will be linking the PR on the Slack thread so the community and the Kotlin team are up-to-date and can add feedback.
* On a side note, the current convention is likely inherited from Java, which in turn inherited it from the C/C++ convention for macros, as they were used for constants. However, macros indeed require more attention because of arbitrary code expansion, so the shouting makes sense.