|
|
|
|
|
by cesarb
2230 days ago
|
|
I would say the try!() macro is an exception to that rule: if the ? operator existed since the beginning, it would be seen as "too much magic" (in a language that already used up most of its "strangeness budget" in lifetimes/borrowing), while try!() is just a very simple macro you could write yourself, with no special compiler support. Only later, after people got used to try!() everywhere, the ? operator became viable, as "just a shortcut to try!() with better precedence (and it also works on Option)". That is, there's a path dependence, where the existence of try!() made the ? operator viable. |
|
Yes, C++ creator Bjarne Stroustrup made a similar observation:
- For new features, people insist on LOUD explicit syntax.
- For established features, people want terse notation.
There seems to be an invisible "Overton Window" of evolving programming language features and syntax.