3 ms·
> having the type follow the variable is vastly superior from a readability point of view? [citation needed] The way Nim, Rust, etc do it, with a useless 'var
by a1369209993 8y ago
> having the type follow the variable is vastly superior from a readability point of view?
[citation needed]
The way Nim, Rust, etc do it, with a useless 'var' keyword even when a type is present, is clearly needlessly verbose (ie, inferior, though I'd hesitate to say vastly), but I'd be interested to see a analysis of the merits of something like "Foo[2] foo = bar()" vs "foo Foo[2] = bar()" (or maybe that should be "foo [2]Foo = bar()"?), since it hadn't actually occurred to me to use the latter order seperate from the useless keyword.
- steveklabnik 8y agoIt’s not useless in Rust, it significantly simplies the grammar. This is good for both humans and tooling.
- mratsim 8y agovar isn't useless, it indicates mutability.
- a1369209993 8y agoAh, that makes sense, thanks. (Although I think that's specific to Nim?)