Are there any developer experience advantages for `x := 1` over `let x = 1`?
A `let` keyword probably improves parsing error behaviour, and makes declarations more visible.
:= is more concise though.
Wilfred Hughes
4 Comments
@wilfredh : requires a key combination on most keyboards as well: shift-; for qwerty. “let” feels easier to type even though it’s more keystrokes
@wilfredh for me they are two very different things. := is assignment in an imperative programming language, leading to a state change. Let is the declaration of an equivalent name of an expression in a functional programming language.
@cstanhope Interesting, I didn't know that about Pascal!
Go does make returning an accumulator a little more concise. Compare with e.g. Python:
def foo():
res = [] # not needed in Go
for x in y:
if z:
res.append(x)
return res
That's the biggest advantage I can see though.
Wilfred Hughes
Shared words: concise, advantages, though
Score: 70.5
You can a design a new PL so it's easy to write for humans and analyse by a computer.
Alternatively, if you can win the popularity contest, the tooling will emerge anyway! This makes it hard for new PLs to leverage their advantage.
(C.f. parsing C++.)
Wilfred Hughes
Shared words: parsing, advantages, makes
Score: 57.4