3 ms·
I used to dislike the "field-like access" syntax because I was used to "await" being a prefix in other languages, but using await many times in longer function
by dbrgn 7y ago
I used to dislike the "field-like access" syntax because I was used to "await" being a prefix in other languages, but using await many times in longer function call chains with multiple await calls has totally changed my mind. No need for nested parentheses. No need for splitting up the code just to make it more readable.
Syntax is something very emotional and beauty is very subjective. Thanks to the Rust team, the discussion around await syntax was mostly focussed on rational arguments, not around perceived beauty. The outcome is great in my opinion.
- swfsql 7y agoI guess the syntax was already a given, so they just did it regardless of the criticism. I still think there were other, better, postfix options. I also guess that, since part of the implementation was sponsored not by mozilla itself, then also the syntax choice was not led by mozilla itself (nor the overall community). I could be wrong - and I only superficially followed the discussions - but this is the impression that is left on me after all that. edit: but I think that this Ok-wrapping feature is different from the await one, since now there are no more deadline-like pressuring into mozilla/lang team. So I guess that now, something that is generally disliked (if it is) won't actually get into the lang..
- steveklabnik 7y ago> I guess the syntax was already a given, so they just did it regardless of the criticism This is not true. Several people on the lang team (and many community folks) changed their positions several times over the course of the debate.