As writing ':=' is not very ergonomic to type, because both characters are typed with the pinky, I would propose an optional 'let' syntax like in Rust.
let x = 5
:= is shorthand for var name int. I don't think this will be done.
Oh, i didn't know about that, could you give an example on how to use var name int?
You can't use this but like Go := means the same thing as it goes against one way philosophy.
What about the c-like u8 x = 5?
You can do it like this x := u8(5) which is more simpler.
I dont think it is simpler because of the colon
The := syntax is not going to change. The linked article explains the benefits well.
and what is the big difference between x := 5 and let x = 5 that prevents it?
it is easier to type the let version tbh
@bashery let just introduces a new keyword and it is long to type as compared to x := 5.
but more ergonomic
(sorry if i'm annoying)
Ergonomic? How? It's still not going to change, but I'm wondering how it can be considered "ergonomic" if it requires more typing, which adds stress to the carpals, increasing the likelihood of carpal tunnel syndrome. That seems anti-ergonomic, to me.
@JalonSolov you don't have to use your pinky twice in a row on two keys which are relatively far apart from each other
So the amount of time is approximately the same, but the code is read a lot more than its typed (90/10), and x := 0 is a lot more concise and readable than let x = 0.
Especially mut x := 0 vs let mut x = 0
Most helpful comment
The := syntax is not going to change. The linked article explains the benefits well.