4 ms·
It eliminates the Most Vexing Parse. Consider this C++ code: Foo bar(); A programmer could make simple mistake thinking that is declaring a variable of typ
by vazgriz 4y ago
It eliminates the Most Vexing Parse.
Consider this C++ code:
Foo bar();
A programmer could make simple mistake thinking that is declaring a variable of type Foo. Carbon eliminates this by having explicit keywords for variable and function declaration. (This style is much more Rust based than C++)
fn bar() -> Foo;
var bar : Foo;
It makes parsing easier for both the users and maintainers of the language.
- compiler-guy 4y agoThere are literally thousands of shipping languages that don't have the most vexing parse problem. If that is Rust's entire syntax advantage, it isn't a very big one.
- Joker_vD 4y agoIf that's the only criterion then Pascal's syntax, which doesn't have "the most vexing parse" problem either, and for the same reason, is also almost better than anything else.
- arinlen 4y ago> It eliminates the Most Vexing Parse. C++'s most vexing parse issue ceased to be a concern around a decade ago with the introduction of uniform initialization.
- xigoi 4y agoSo by this logic, pretty much every language other than C++ has “objectively best” syntax.