> I find that the most common reason I go back to check a variable declaration is to determine the type of the variable,
Hover the mouse cursor over it. Any reasonable editor will show the type.
> In Rust, in particular, this leads to some awkward syntactic verbosity, because mutable variables are declared with `let mut`, meaning that `let` is used in every declaration.
Rust is very verbose for strange implementation reasons... namely to avoid parse ambiguities.
> In C or C++ the type would take the place of that unnecessary `let`.
OTOH, that means you can't reliably grep for declarations of a variable/function called "foo". Also consider why some people like using
auto foo(int blah) -> bool
style. This was introduced because of template nonsense (how to declare a return type before the type parameters were known), but it makes a lot of sense and makes code more greppable. Generic type parameters make putting the return type at the front very weird -- reading order wise.Anyhoo...
>> I find that the most common reason I go back to check a variable declaration is to determine the type of the variable,
> Hover the mouse cursor over it. Any reasonable editor will show the type.
That applies to most of us, obviously, but in this context we're talking about Zig. Zig's lead developer, Andrew Kelley, programs in Vim with no autocomplete or mouse support.
Even though I sometimes use editors with these features, I find it frustrating when languages seem to be designed in such a way that presumes their availability. I found Rust particularly bad about this, for example.