220 40966 <7ea647c8-9bfb-4cd9-b55f-4e8b83160451@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: mihailnajdenov@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Can we have beginner friendly new line and
 deprecate std::endl?
Date: Sun, 11 Nov 2018 15:01:33 -0800 (PST)
Lines: 127
Approved: news@gmane.org
Message-ID: <7ea647c8-9bfb-4cd9-b55f-4e8b83160451@isocpp.org>
References: <e17189bf-51be-496d-845a-3707a516a210@isocpp.org>
 <CAMmfjbOkdN63EON+hrCJWj94n48vtVvMfUjzeau5KmPWSpwkow@mail.gmail.com>
 <CAHSYqdYYZjeHHbRZ5bcHLYVsWfspwCeQ8oxEDRbuJ8dqAtsX5A@mail.gmail.com>
 <AB167E1A-FA59-4B72-A9C2-1624D1B56614@hsr.ch> <b49f4c85-816b-4b35-851d-407061a8ef9f@isocpp.org>
 <CAMmfjbOjpJvBWEke1z0XXnHXhjtEO_otNN5-jayGPwe3RHO0Rw@mail.gmail.com>
 <7da1f33f-c2c1-482f-8fc2-c23a9767a5ec@isocpp.org> <CAMmfjbMHae=pbG7LMjjjqWAE-5Zaiwi3rpWXr-HpwBRo0bjvfA@mail.gmail.com>
 <CAC+0CCOudOQQYextom6SH8AvuK+4cPtbVaGNmNojkd+PFsEQcQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1671_639710727.1541977293548"
X-Trace: blaine.gmane.org 1541977172 1200 195.159.176.226 (11 Nov 2018 22:59:32 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 11 Nov 2018 22:59:32 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUJ3A7GRAPRBTXJULPQKGQER6P7LYY@isocpp.org Sun Nov 11 23:59:27 2018
Return-path: <std-proposals+bncBCUJ3A7GRAPRBTXJULPQKGQER6P7LYY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw1-f69.google.com ([209.85.161.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUJ3A7GRAPRBTXJULPQKGQER6P7LYY@isocpp.org>)
	id 1gLyhR-00007u-7k
	for gclcip-std-proposals@m.gmane.org; Sun, 11 Nov 2018 23:59:25 +0100
Original-Received: by mail-yw1-f69.google.com with SMTP id g82-v6sf1092865ywe.22
        for <gclcip-std-proposals@m.gmane.org>; Sun, 11 Nov 2018 15:01:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=yGTE6nkpki67HTq9Xf4WFYXi7CHqQHk0t7d0pvsk56I=;
        b=jcpjw4RmDqjwzUMG0aJCk1Fh3K96awsV7vX57BorskxpmDNERO9wUM6DgeqZG6kLbG
         /qU5lEkIXBZaETTNsht+Z9gCdaZYXti4GCncIWyXU5k4qAzYW5MzObQN2URs5youCxoQ
         wgbUpV5Zxfh3dyrrtoXjPvLHlb2YJDTeKDfLaPlHXFBdxOvl7JIm5FAQYyVj6x/P67df
         Tqjdf5X3ysbxc8umXuZ2P+YHDk+53KYB5WDm1V7T+2vU5CIMUZqg5QA74bbgjnIqyMYA
         pxPuU5W/tV5cwr69cLlTK6PJ5wzRoI9GFFqVvyuBjUMkzgfMlCDS9ItbzG6BHr3TKpv7
         GkXw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=yGTE6nkpki67HTq9Xf4WFYXi7CHqQHk0t7d0pvsk56I=;
        b=ZA8knhKY4pxGWWL1ZAEanTrGrjCMNGBJ7+MvI00ik2DJPjrHZ//MfM2POZfurhV7WJ
         1m2M9ZHmJT1RT+jJZY7VRkavXo29Yh2r0sKpU21P/yOu3i3ohdTb96c/KJMcKmfSjseM
         mR4bhQ9stU/GCvdVVOK+n6E5pf5GytT8sKO56HSiCG/tEuDRGx1bWRQtwaMtut3ebHPU
         osbpOmBqugMbWeLrHDGEjuQH+0CH0iuN5VMjXfGtul09mJ8ldAg8hmXjoNtcVZXwvVx9
         pbxin7DM/nXKELkcD6yE1Bo/JJ+NvvHIAO3Azi5Jooh1Wj8gg9ec+OKw0A1jQcdkZhq9
         QmkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version: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=yGTE6nkpki67HTq9Xf4WFYXi7CHqQHk0t7d0pvsk56I=;
        b=G98qnPMvFV9/F19Z5OuhreKjjWTQWYXypyKujMtcvTOwuB7CTmq8RWswe63LGI/C0r
         CLiYADeeOHjO1kvhDRYArGNl1u01yIHivz/CwOmOhZWjOsxq9MPZRSY0l0zgkRmGTq6M
         fUHetnvCMUkgav/dDGTe4pWuwlC4VGAu1TmrPXPP5V0RCDiTjTXc4W7O1siGNnXX603J
         SrMQxGs4mcdtpHuuNGWNiz6Th59SlmoSSVNTswC/eu2MfV7ZF3cVKUKx/HQEeCS7RT4B
         pZS7OhQkf+QF7ErmEWlRUSwNYDapKfY9xXxootoOyOif9i5iRndo5TNJWhoPw+L4iQR/
         y/0Q==
X-Gm-Message-State: AGRZ1gLBgTBIoRsWYt/Q8MEJ6n1sPDw4F1fLW77vfz9o8ZyBXZWHDzfv
	YEAfMlz13k5QMjjNMW3oGYPHCA==
X-Google-Smtp-Source: AJdET5e9ZjiwQzJBWL25NkscMMh4igpW2I7yKqcUSUxZBfYEQ8ZmI9fmU1m3+yZbssR1FuZznBRYzw==
X-Received: by 2002:a25:d2d5:: with SMTP id j204-v6mr9093431ybg.46.1541977295355;
        Sun, 11 Nov 2018 15:01:35 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:3d45:: with SMTP id k66-v6ls3504366ywa.11.gmail; Sun, 11
 Nov 2018 15:01:34 -0800 (PST)
X-Received: by 2002:a81:83d2:: with SMTP id t201-v6mr58030ywf.6.1541977294198;
        Sun, 11 Nov 2018 15:01:34 -0800 (PST)
In-Reply-To: <CAC+0CCOudOQQYextom6SH8AvuK+4cPtbVaGNmNojkd+PFsEQcQ@mail.gmail.com>
X-Original-Sender: MihailNajdenov@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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:40966
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40966>

------=_Part_1671_639710727.1541977293548
Content-Type: multipart/alternative; 
	boundary="----=_Part_1672_75946876.1541977293548"

------=_Part_1672_75946876.1541977293548
Content-Type: text/plain; charset="UTF-8"



On Monday, November 12, 2018 at 12:26:14 AM UTC+2, Jake Arkinstall wrote:
>
> On Sun, 11 Nov 2018, 21:38 Brian Bi <bbi...@gmail.com <javascript:> wrote:
>
>> It's only "magic" if you teach beginners that '\n' is a special magic 
>> command, rather than the literal representation of the newline character.
>>
>
> This. A thousand times this. 
>
> '\n' isn't magic in the same way that '\0' and '\t' aren't magic. They're 
> well known representations of special characters, and such ideas have been 
> in use in encodings in one form or another for well over a hundred years. 
> Avoiding them in any learning setting is fruitless in my opinion and, 
> perhaps, gives the opposite of the intended outcome - we replace a "magic" 
> that is consistent across dozens of languages with a "magic" command that 
> creates a newline.
>

By no mean I suggest avoiding them altogether. I only point out that
 - A beginner will have to be abruptly introduced to special characters in 
his first day (in an API that does not used any special characters!)
 - It is a glaring API inconsistency on its own
 

>
> I agree that endl is badly named, but it's one of those things where 
> deprecation (in terms of renaming) would cause a lot of friction. I'd 
> sooner just see a better (I.e. more efficient, better compile time support, 
> and less verbose - especially the disaster that is stream modifiers, that 
> make printf look user friendly) output approach and let std::endl die out - 
> not with a bang, but with a whimper.
>

We all do, but I don't see that coming anytime soon. 

Maybe we could just deprecate endl and advocate using '\n' "until something 
better comes along".
This will play nicely with format() as people will get used to adding it as 
part of the formating string. 

As mentioned, deprecating it will (hopefully) prevent teaching it. 

 

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7ea647c8-9bfb-4cd9-b55f-4e8b83160451%40isocpp.org.

------=_Part_1672_75946876.1541977293548
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, November 12, 2018 at 12:26:14 AM UTC+2,=
 Jake Arkinstall wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div di=
r=3D"auto"><div class=3D"gmail_quote" dir=3D"auto"><div dir=3D"ltr">On Sun,=
 11 Nov 2018, 21:38 Brian Bi &lt;<a href=3D"javascript:" target=3D"_blank" =
gdf-obfuscated-mailto=3D"WMtkPFSCBQAJ" rel=3D"nofollow" onmousedown=3D"this=
..href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;jav=
ascript:&#39;;return true;">bbi...@gmail.com</a> wrote:</div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>It&#39;s =
only &quot;magic&quot; if you teach beginners that &#39;\n&#39; is a specia=
l magic=20
command, rather than the literal representation of the newline=20
character.</div></div></div></blockquote></div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">This. A thousand times this.=C2=A0</div><div dir=3D"auto"=
><br></div><div dir=3D"auto">&#39;\n&#39; isn&#39;t magic in the same way t=
hat &#39;\0&#39; and &#39;\t&#39; aren&#39;t magic. They&#39;re well known =
representations of special characters, and such ideas have been in use in e=
ncodings in one form or another for well over a hundred years. Avoiding the=
m in any learning setting is fruitless in my opinion and, perhaps, gives th=
e opposite of the intended outcome - we replace a &quot;magic&quot; that is=
 consistent across dozens of languages with a &quot;magic&quot; command tha=
t creates a newline.</div></div></blockquote><div><br></div><div>By no mean=
 I suggest avoiding them altogether. I only point out that</div><div>=C2=A0=
- A beginner will have to be abruptly introduced to special characters in h=
is first day (in an API that does not used any special characters!)</div><d=
iv>=C2=A0- It is a glaring API inconsistency on its own</div><div>=C2=A0</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;=
border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"auto"><div dir=
=3D"auto"><br></div><div dir=3D"auto">I agree that endl is badly named, but=
 it&#39;s one of those things where deprecation (in terms of renaming) woul=
d cause a lot of friction. I&#39;d sooner just see a better (I.e. more effi=
cient, better compile time support, and less verbose - especially the disas=
ter that is stream modifiers, that make printf look user friendly) output a=
pproach and let std::endl die out - not with a bang, but with a whimper.</d=
iv></div></blockquote><div><br></div><div>We all do, but I don&#39;t see th=
at coming anytime soon.=C2=A0</div><div><br></div><div>Maybe we could just =
deprecate endl and advocate using &#39;\n&#39; &quot;until something better=
 comes along&quot;.</div><div>This will play nicely with format() as people=
 will get used to adding it as part of the formating string.=C2=A0</div><di=
v><br></div><div>As mentioned, deprecating it will (hopefully) prevent teac=
hing it.=C2=A0</div><div><br></div><div>=C2=A0</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7ea647c8-9bfb-4cd9-b55f-4e8b83160451%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7ea647c8-9bfb-4cd9-b55f-4e8b83160451=
%40isocpp.org</a>.<br />

------=_Part_1672_75946876.1541977293548--

------=_Part_1671_639710727.1541977293548--

.
