Hacker News new | ask | show | jobs
by locuscoeruleus 875 days ago
I think dict(name=name, age=age) can be definitely be more readable and ergonomical to write than {"name": name, "age": age}.
1 comments

I still miss coffeescript's ability to do dict(@name, @age) though I understand that it creates an unwelcome coupling between the parameter names and their names in the calling scope.

For my part, those names are often the same anyway, though, since the calling scope names are often arbitrary and might as well match the parameter names.

    {name, age}
does the same in modern JS, assigning the variable to the key with the same name.