2 ms·
I agree that syntax matters, but I like that syntax so much better. Here are some reasons: - The variable name comes before the type. Thus if the type name is
by justinpombrio 3y ago
I agree that syntax matters, but I like that syntax so much better. Here are some reasons:
- The variable name comes before the type. Thus if the type name is large it makes it difficult to scan for the variable. This isn't too bad for `let`s in a language like C, but my day job is C++ right now and the fact that the return type for functions comes first is terrible. It's inevitably enormous, so it makes it bloody impossible to quickly see what the damn function is called.
- The keyword `let` is first, so with syntax highlighting you can easily visually see the structure of the code, and which lines declare variables vs. call functions.
Are there reasons to like the C style
type variable = value;
besides familiarity, and it being slightly shorter?