DIP 1019--Named Arguments Lite--Final Review

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Aug 27 17:39:44 UTC 2019


On Tue, Aug 27, 2019 at 05:01:21PM +0000, Yuxuan Shui via Digitalmars-d wrote:
> On Monday, 26 August 2019 at 21:48:42 UTC, Jonathan M Davis wrote:
[...]
> > The _only_ use case IMHO where they add any real value is when you
> > have a long parameter list where most of the parameters having
> > default arguments.
> 
> Disagree. Oftentimes having the name clarifies a function, so the
> _reader_ doesn't have to read the document to figure out what a
> function call does
[...]

That's exactly Jonathan's point.  The reader *assumes* semantics based
on the names of the function and parameters.  But without actually
reading the documentation, you cannot know for sure.  And I think by now
we all know what happens when we make assumptions about a function that
we don't actually understand.  So the point is that if you want to
understand what the code actually does, you have to read the docs.
Having named arguments doesn't relieve you of that need.

I can't say I 100% agree with Jonathan, but he certainly has a point
that you can't avoid reading documentation at *some* point.


T

-- 
First Rule of History: History doesn't repeat itself -- historians merely repeat each other.


More information about the Digitalmars-d mailing list