220 19898 <29c34a3c-e65d-4f4c-894d-baed2fbcc60d@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Arthur Tchaikovsky <atch.cpp@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: default arguments
Date: Tue, 18 Aug 2015 10:00:59 -0700 (PDT)
Lines: 124
Approved: news@gmane.org
Message-ID: <29c34a3c-e65d-4f4c-894d-baed2fbcc60d@isocpp.org>
References: <ef9c7cbe-e8f1-4196-83bc-11a1c9b2798c@isocpp.org>
 <CANu6V4UOxgZ9GV9f8DTbtW6BXrBPA7_2yUDRyhXv5BptvybHFA@mail.gmail.com>
 <ab64c760-eeca-426a-953f-99d7a19919f6@isocpp.org>
 <CAD6_Qj_SkX1r_Egr0FHgk21ASVQuDkYrn1Cy7+dRAJFwHpG72w@mail.gmail.com>
 <mqvdv7$6tc$1@ger.gmane.org>
 <7066b166-9472-4ad6-ac3c-2db527ed7818@isocpp.org>
 <CAEhD+6BWGem3qOoWUj26b0ksnuet=wp6RRuN9vkuGHmcr459SA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2570_821305239.1439917260085"
X-Trace: ger.gmane.org 1439917273 26810 80.91.229.3 (18 Aug 2015 17:01:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 18 Aug 2015 17:01:13 +0000 (UTC)
Cc: mwoehlke.floss@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDL6FI4NYYERBTOJZWXAKGQE6AOZ3AA@isocpp.org Tue Aug 18 19:01:08 2015
Return-path: <std-proposals+bncBDL6FI4NYYERBTOJZWXAKGQE6AOZ3AA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f69.google.com ([209.85.220.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDL6FI4NYYERBTOJZWXAKGQE6AOZ3AA@isocpp.org>)
	id 1ZRkFz-000261-O8
	for gclcip-std-proposals@m.gmane.org; Tue, 18 Aug 2015 19:01:03 +0200
Original-Received: by pabyb7 with SMTP id yb7sf388040078pab.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 18 Aug 2015 10:01:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:content-type:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=1g0aIgfV2hMdGIjozRV/a/FoHqGX9C0KLO0N8TLHeMQ=;
        b=Z1Id1rBcsYNWJLo94NeK811QNF4eKNLQNf4yeYVE7TEqih/c4EeSZ7EygMNzJAVEuw
         VfZWordwUzII7+/hn2rflqq/y5ckdQF/+LWgknKuDXiX9u/OlCKFKI6iPULJBV7prf01
         Jq4lo7EVFF9aGaa7m6lqr3yC2Cyb+7Gmh4OWbakgHG8r/Z9cQaRRCh3surUJJGSES9iT
         Pk7Muoq4e7MadFftAvD47COeSP27BSDWZl9bsqd/eEHlDiyY83jzeBIlljOfiaDYu5+z
         sUD8KZXZP44L5I3vkqRHkRZqrPD3CsIZXq2JvYz7RIsWHIuKVWv+ategxMccjc91WWNd
         ZHXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:content-type:x-original-sender
         :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=1g0aIgfV2hMdGIjozRV/a/FoHqGX9C0KLO0N8TLHeMQ=;
        b=MUIh7MyAai+HNkiJe/00PuCbCez7hdr64G63tFknLBymHbS23e6KYuLWbNbt+ck2Zj
         JZisZfsEmtPmz1gmHhBySBdbmwqtwjNpWUhf6D688/IUGUSg9EcYfR5JVn7jkG557rH0
         0EdRIfbTI+6JPyfsNwHjygqKohYMz4mFaCDjvbo9LGe+7xqU0foOFCdZHkqaO5nnOAtN
         7rjyOBKzoPePdfwc6hhm75dZDCghpm5SVyNPMxnKxGorxtuxI9K5BpW3jVJ07Bqo19CP
         WzQ9X8Ul7keJjWD2gU137lVb+DGOeCX+8FtJkbtSvZupZWvYXymM4dOb55IaQpyDisR7
         8+AA==
X-Gm-Message-State: ALoCoQkq77OEkHTCHH0Q+KNhazqaB64HXVPNWH3afAujZm/Yky1GkXRqAwPD1nTNbuUewhf7Znqs
X-Received: by 10.67.24.73 with SMTP id ig9mr6590792pad.25.1439917262805;
        Tue, 18 Aug 2015 10:01:02 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.30.52 with SMTP id c49ls3127039qgc.81.gmail; Tue, 18 Aug
 2015 10:01:00 -0700 (PDT)
X-Received: by 10.140.81.149 with SMTP id f21mr100830qgd.8.1439917260684;
        Tue, 18 Aug 2015 10:01:00 -0700 (PDT)
In-Reply-To: <CAEhD+6BWGem3qOoWUj26b0ksnuet=wp6RRuN9vkuGHmcr459SA@mail.gmail.com>
X-Original-Sender: atch.cpp@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:19898
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19898>

------=_Part_2570_821305239.1439917260085
Content-Type: multipart/alternative; 
	boundary="----=_Part_2571_748565907.1439917260085"

------=_Part_2571_748565907.1439917260085
Content-Type: text/plain; charset=UTF-8

I believe that the conclusion is that they both have pluses and minuses.

On Tuesday, 18 August 2015 17:49:08 UTC+1, Andrey Semashev wrote:
>
> On Tue, Aug 18, 2015 at 7:37 PM, Arthur Tchaikovsky <atch...@gmail.com 
> <javascript:>> wrote: 
> > I dear to disagree with the statement that the following example is self 
> > documenting and easier to read: 
> > auto c3ptr = new C{.timeout = 1}; 
> > How is this^^^ easier to read? And how is this self documenting? Only on 
> > surface it seems that it is, both, but when you really think about it it 
> is 
> > neither self documenting nor easy to read. Why? Because having only one 
> > argument initialized in {}, that is .timeout, leaves us with question, 
> is 
> > that the only argument to that class, or are there any other? If so, are 
> > those arguments inited by default? If so, how many? Etc. 
> > Compared to this: 
> > auto c3ptr = new C(default, 1); // use a shorter timeout 
> > It is immediately obvious how many arguments there are and which one of 
> them 
> > are default. 
>
> Your argument works both ways - I cannot tell what other members C has 
> and how they are initialized by this constructor. In addition I don't 
> see what the constructor arguments are without looking at the 
> interface or docs. 
>
> > And as for self documentation? 
> > auto c3ptr = new C(default, /*timeout*/1); // use a shorter timeout 
>
> Multi-line comments are evil - they cause problems when you want to 
> comment a block of code. Besides interface documentation I try to 
> avoid them as much as possible. 
>
> IMHO, the true named member initialization is much more 
> self-explanatory and less error prone. 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_2571_748565907.1439917260085
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I believe that the conclusion is that they both have pluse=
s and minuses.<br><br>On Tuesday, 18 August 2015 17:49:08 UTC+1, Andrey Sem=
ashev  wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Tue, Aug 18, 2=
015 at 7:37 PM, Arthur Tchaikovsky &lt;<a href=3D"javascript:" target=3D"_b=
lank" gdf-obfuscated-mailto=3D"kcrlsfXrAwAJ" rel=3D"nofollow" onmousedown=
=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D=
&#39;javascript:&#39;;return true;">atch...@gmail.com</a>&gt; wrote:
<br>&gt; I dear to disagree with the statement that the following example i=
s self
<br>&gt; documenting and easier to read:
<br>&gt; auto c3ptr =3D new C{.timeout =3D 1};
<br>&gt; How is this^^^ easier to read? And how is this self documenting? O=
nly on
<br>&gt; surface it seems that it is, both, but when you really think about=
 it it is
<br>&gt; neither self documenting nor easy to read. Why? Because having onl=
y one
<br>&gt; argument initialized in {}, that is .timeout, leaves us with quest=
ion, is
<br>&gt; that the only argument to that class, or are there any other? If s=
o, are
<br>&gt; those arguments inited by default? If so, how many? Etc.
<br>&gt; Compared to this:
<br>&gt; auto c3ptr =3D new C(default, 1); // use a shorter timeout
<br>&gt; It is immediately obvious how many arguments there are and which o=
ne of them
<br>&gt; are default.
<br>
<br>Your argument works both ways - I cannot tell what other members C has
<br>and how they are initialized by this constructor. In addition I don&#39=
;t
<br>see what the constructor arguments are without looking at the
<br>interface or docs.
<br>
<br>&gt; And as for self documentation?
<br>&gt; auto c3ptr =3D new C(default, /*timeout*/1); // use a shorter time=
out
<br>
<br>Multi-line comments are evil - they cause problems when you want to
<br>comment a block of code. Besides interface documentation I try to
<br>avoid them as much as possible.
<br>
<br>IMHO, the true named member initialization is much more
<br>self-explanatory and less error prone.
<br></blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_2571_748565907.1439917260085--
------=_Part_2570_821305239.1439917260085--

.
