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

Change final for mut keyword #505

Open
JorgeCepeda opened this issue Sep 26, 2023 · 2 comments
Open

Change final for mut keyword #505

JorgeCepeda opened this issue Sep 26, 2023 · 2 comments

Comments

@JorgeCepeda
Copy link

JorgeCepeda commented Sep 26, 2023

I don't like the idiom of making most variables final, adding words to the code.

Instead I'd prefer to assume variables are final unless there's a mut keyword added to it, like in other languages, and remove the final keyword altogether.

@CC007
Copy link
Contributor

CC007 commented Mar 17, 2024

Having a setting that can specify final being the default for fields, parameters and local vars would indeed be nice.

You probably don't want to touch final methods and classes though, since it has a somewhat different meaning there.

@JorgeCepeda
Copy link
Author

I agree, in the case of final classes I see it as a good option to favour composition over inheritance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants