-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Camel case types #3060
Comments
Let me add something to the discussion that crossed my mind multiple times ofter the last few years. One thing I always admired about Ruby was that as a side effect of how it implements constant lookups class names had to be CameCased. Now exceptions. This was huge for me because it made Ruby code look very consistent compared to Python. As a side effect of Python's history some internal types (which previously were factory functions) like The sadness does not stop there. Even within the standard library you will see both That problem is not unique to Python. C++ started with Since Rust already started questioning a few things I propose thinking about enforcing identifier naming for non export types. For externed things this should not apply to make it still easy to call into things like I understand that this is a super controversial thing to do, but since Rust is all about exploring things and at the same time being a very usable language I wanted to bring it up. Note that I do not want anyone to enforce a specific style to indent or place whitespace. That's something internal to your codebase. However the names are exported through crates or ABIs and as such are something more programmers than just the original author are concerned with. Especially when it comes to inheriting or traits this is shared space. At the end of the day I don't think forcing people to adhere to rules there is a too crazy thing to do. You can have discussions about |
I'm in favor of enforcing naming conventions as well. There is already a lint check for camel case (turned off by default currently since most code isn't using camel case) and I think there should be checks for both the rules you mentioned, as well as others that are agreed upon in the future. I would be ok with turning them on be default. I do think lint is the right place to put these checks so that they can be switched on and off as needed - making the conventions strictly required is too strict for my tastes. |
See also #3070 |
@mitsuhiko all very well said. I like this proposal. (i wonder if i would like the proposal less if i didn't also happen to agree with the specific style guidelines proposed...) |
@bblum you almost certainly would, I've worked in languages that enforced styles I don't like and it's something of a hell. That said this is my preferred style as well. However, something to me feels fundamentally wrong about specifying this type of information implicitly with a style guide, on the other hand when the alternative is more syntax clutter this idea seems much more palatable. |
Both core and std are converted. Other code will just have to be converted in passing. |
extra ABI tests, in particular for DispatchFromDyn
Adds a CI test for --use-local-toolchain. This test will run after every push to main. Additional cleanup to the setup as mentioned in rust-lang#3060 in next PR's. (In interest of keeping changes small & focused). By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.
Convert existing rust code to camel case types, variants and traits.
The text was updated successfully, but these errors were encountered: