Skip to content

final is too long #2868

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

Closed
mgenware opened this issue Feb 26, 2023 · 1 comment
Closed

final is too long #2868

mgenware opened this issue Feb 26, 2023 · 1 comment
Labels
feature Proposed language feature that solves one or more problems state-duplicate This issue or pull request already exists

Comments

@mgenware
Copy link

mgenware commented Feb 26, 2023

Of all the keywords a language introduces, declaring a local final variable could easily be the most frequently used one. final (5 letters) just seems too long compared to other languages (Rust -> let(3), Swfit -> let(3), Kotlin -> val(3)). I usually disable the lint rule prefer_final_locals and go all var in my projects just to type less cuz it's used so frequently, typing 2 less letters can really speed up coding.

One similar language is JavaScript. It uses const (5) for this purpose. JavaScript also has to type function (8) to declare a function. Other languages have much shorter keywoards for that: Rust -> fn(2), Swift -> func(4), Kotlin -> fun(3). You can see the difference here. It would be great if Dart introduces a shorter keyword (like let or val) to replace final.

@mgenware mgenware added the feature Proposed language feature that solves one or more problems label Feb 26, 2023
@lrhn
Copy link
Member

lrhn commented Feb 26, 2023

Duplicate of #136

@lrhn lrhn marked this as a duplicate of #136 Feb 26, 2023
@lrhn lrhn closed this as completed Feb 26, 2023
@lrhn lrhn added the state-duplicate This issue or pull request already exists label Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems state-duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants