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

Mixed snake_case and camelCase in the codebase #4

Open
jgaskins opened this issue Aug 6, 2024 · 0 comments
Open

Mixed snake_case and camelCase in the codebase #4

jgaskins opened this issue Aug 6, 2024 · 0 comments

Comments

@jgaskins
Copy link

jgaskins commented Aug 6, 2024

The case conventions around method and argument names are inconsistent, which makes it difficult to remember whether I should use camelCase or snake_case for a given call.

The convention in Crystal is to use TitleCase (which some also call CamelCase, but that's confusing) for class/struct/module names and snake_case for everything else*. Would you be open to a PR for this? I can attempt to keep existing calls backwards-compatible with deprecation warnings using the Deprecated annotation.


*Constants and enum members are an exception to this, and they seem to be pretty split between TitleCase and SCREAMING_SNAKE_CASE, even in the stdlib. However, at least in the case of enums, we can use snake_case in most places anyway through automatic symbol->enum conversion (when passing an enum value as a method argument) and automatically generated enum predicate methods (like HTTP::Status#not_found?)

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

No branches or pull requests

1 participant