We have repeatedly run into cases where we could offer equivalent functionality multiple ways.
Add a principle noting the preference is to only provide one way of doing things.
Carbon could focus on providing a lower bar for overlapping functionality, encouraging overlapping syntax. This could be considered as similar to Perl's "There is more than one way to do it.". Overlapping syntax should still receive some scrutiny, but use-cases with small marginal benefits might be considered sufficient to create divergent syntax.
For example:
for (;;).if and similar.class and struct with their C++-equivalent default
visibility rules.and and &&, 0xa and 0XA, etc.; optional, as there's precedent in modern languages to do
so.It's worth noting Perl also has a related motto of "There is more than one way
to do it, but sometimes consistency is not a bad thing either." It's best to
avoid interpreting this alternative to the extreme: for example, this is not
encouraging providing all of extensible, extendable, and extendible as
equivalent keywords, as that is divergence with very minimal benefit
(particularly extendable versus extendible).
Advantages:
Disadvantages:
We are declining this alternative because we value the language simplicity provided by minimizing overlap of features.