3 ms·
I always found that kind of surprising. I found it easier to learn new concepts/ways of programming with new syntax. When the syntax feels familiar to a languag
by lostcolony 12y ago
I always found that kind of surprising. I found it easier to learn new concepts/ways of programming with new syntax. When the syntax feels familiar to a language I already know, I find I either am slipping into habits from the language I know, which may or may not be idiomatic, and which may or may not even do what I think it does, or I just don't bother learn them in the first place, assuming they behave the way they do in the other language.
The sort of extreme example of this is this particular bit of Erlang that seems familiar from a C background
myFunc(Val) ->
if Val -> io:format("Val was true", []) end,
io:format("the end", []).
myFunc(false).
When executed you'd expected it to print just "the end". It doesn't; the if statement throws an exception. It looks similar, but behaves differently, and that makes it harder to learn than the constructs that are completely unfamiliar.