Discussion Thread: DIP 1030--Named Arguments--Final Review
Walter Bright
newshound2 at digitalmars.com
Wed May 13 02:36:38 UTC 2020
On 5/12/2020 10:42 AM, Paul Backus wrote:
> The logic behind this feature is that the rules it uses for re-ordering are the
> same ones already used for struct initializers [1], which are in turn based on
> the rules used for designated initializers in C99 [2].
>
> These rules aren't perfect, but consistently using the same rules for everything
> is much better than having two separate sets of rules, and it's too late to go
> back and change the struct-initialization syntax now.
>
> [1] https://dlang.org/spec/struct.html#static_struct_init
> [2] http://port70.net/~nsz/c/c99/n1256.html#6.7.8p17
Thank you for the clear explanation.
Consider the convention that turning a valve clockwise shuts it, and
counterclockwise opens it. This matches the convention for tightening and
loosening a bolt. It matches a meter where more is clockwise.
Except for the hot water faucet, which goes the other way. I always have to stop
and think when I use the hot water faucet.
Consistency and predictability are huge advantages in user interfaces, and
override small optimizations.
More information about the Digitalmars-d
mailing list