manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.42k stars 125 forks source link

Change final for mut keyword #505

Open JorgeCepeda opened 1 year ago

JorgeCepeda commented 1 year ago

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 commented 8 months ago

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 commented 8 months ago

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