Syntactic sugar to encourage use of named arguments

I think people use “confusing” in different ways in this discussion. The construct is confusing for people unfamiliar with it (it looks like an assignment or a keyword paramete, but nothing’s getting assigned or passed), but that’s a learning question, and anything can be learned reasonably quickly. But there’s also the confusion that comes from the construct looking unexpected, or incongruous, in code that you’re trying to read. This confusion comes from a feeling that the construct somehow doesn’t “fit” with other parts of the language, and is very hard to define precisely, but it doesn’t go away nearly as quickly as the first sort, and can remain as an ongoing “papercut” type of annoyance when trying to read other people’s code.

Personally I think this syntax is confusing in both senses. I’m OK with the idea that I’ll get over the first form of confusion, but I’m much less confident that I’ll get over the second form - this construct just doesn’t seem to flow naturally in the examples I’ve seen, and I don’t think that feeling will go away easily.

(And yes, I’m aware this is subjective - so the decision will probably come down to “does this feature do more harm than good, in terms of the number of people who will love or hate it?”)

9 Likes