220 40961 <CAMmfjbMHae=pbG7LMjjjqWAE-5Zaiwi3rpWXr-HpwBRo0bjvfA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Brian Bi <bbi5291@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 16:38:15 -0500
Lines: 347
Approved: news@gmane.org
Message-ID: <CAMmfjbMHae=pbG7LMjjjqWAE-5Zaiwi3rpWXr-HpwBRo0bjvfA@mail.gmail.com>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="000000000000ad2b00057a6a6797"
X-Trace: blaine.gmane.org 1541972188 11735 195.159.176.226 (11 Nov 2018 21:36:28 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 11 Nov 2018 21:36:28 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDS5ZX5VU4NBBVOCULPQKGQEODHALPA@isocpp.org Sun Nov 11 22:36:24 2018
Return-path: <std-proposals+bncBDS5ZX5VU4NBBVOCULPQKGQEODHALPA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ed1-f69.google.com ([209.85.208.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDS5ZX5VU4NBBVOCULPQKGQEODHALPA@isocpp.org>)
	id 1gLxP1-0002sI-Eg
	for gclcip-std-proposals@m.gmane.org; Sun, 11 Nov 2018 22:36:19 +0100
Original-Received: by mail-ed1-f69.google.com with SMTP id c12-v6sf3832419ede.6
        for <gclcip-std-proposals@m.gmane.org>; Sun, 11 Nov 2018 13:38:30 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1541972310; cv=pass;
        d=google.com; s=arc-20160816;
        b=J5snMfiNK4GH2GKTJcbatuFy6lDOByH7+bdCU1RSQ83L7zRO9wUs021mr3tYvFR6bm
         e/xqyLH6n1OeIsHtcLST7sRHVnxaBrf5CdRzfBq3wRM60LgYdKLpFM/yyimr4w9LvZ06
         FJF9ou8mTT+2e7cMwwceYI9A846F58SHFhPpzayeJMMWNuttEOeZkT1Bndw5STc8yvNj
         9UqgLY1gHJzGMWbd4gVjyWcHHHryYkz6n4GtScVnMM4QeGngPJ8FGQbTS6p3YUQDHclw
         l0TGMJ1GFx6LONO0mxTHG8iMol4i5OV01KeNZQxWFiaCyIcM2o1nZvapiIUL3QRLifeP
         4pwA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:in-reply-to:references:mime-version:dkim-signature;
        bh=pmyujyJxAWbDKML7a4yclX6oZce3Xi0Qnh0cmrFxjvo=;
        b=x86+pI8gUvlfZi4uF4gNS4HynNH8Q4yBYz6RB+ypEFJZ1D+agzTryUl/OEPIdDz9LF
         SSWO3dgbAYd48dKeTflrZapDf2j/Cv3856lR8OpvNJA80tGe4v3/T9mCWrRRZk2SWu+8
         D3eUyHfhE6gp4pnQPfaUtr+m0+Sf1IdhkQWsbcG3wT5jYMLRcJ03Nl4LlbTfiBERZ3+F
         odo6ofhRJmW8MRuq9SOD7RgfJ2hGTcdjDiiV+Ibp68ML8hdphqAjnQ42NQXkcR8lvna9
         XagpX7rqWB6zKec7lTbngcHc15OUWvh3dukEAkmaw7JBqFQpcZ5V39nm8ZIemfQ+4ns7
         hShQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=eqfzdfuh;
       spf=pass (google.com: domain of bbi5291@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=bbi5291@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=pmyujyJxAWbDKML7a4yclX6oZce3Xi0Qnh0cmrFxjvo=;
        b=Vv+KAysJtLrDVCk1jns6i7b5ScSeXSs7S+OeyeZxtw+r/FYwzYNzUioDyXMm+GNYoL
         0SRF5Dqn2OWMPMeBmXewqbk8gIP/RfYcyMXVhqrUr4KgdFeb3YykT2FBxG+S4r76cK0y
         rzNwOPKTl2KCdn0UcuxOk0wrqF4cLeGTcAWWi0knKQgsakVhQxNLEqsOilfqMT88AOL5
         AruYuAhERnL31bKM+29Ha9y1j+0QcWfck5ke3dcjYvfkIy5//BylUveoVfuNeupi757p
         qKq48Tt8w/lSDijxDi6pwBCVvjWXe7ebj6DDAkz3iufkEqAxcAyLuk8XtVgNQ1wykmpi
         gHJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=pmyujyJxAWbDKML7a4yclX6oZce3Xi0Qnh0cmrFxjvo=;
        b=EbVkwlZYKODVlx1osxzZ/Eg8XHAr09PniHhJF6iM4JPaS79QNdRtWT7knuY26rDbwF
         /iQPlnF13wcc0+dZVbOrHn81Ltt2sFFbHG9CIBZeXaO9WPkXfznJC1PCNNJkliPlUA6+
         jLBXZ9uXpKKbNikINx5e4Jv/046WltiwCU2SYi4ZNMGD6mckGos4GDlsWtqCXF+wj2ua
         jPrNOQw4j1rv9r/XN20TQThLcaxaHEGkvB5iYgTysFsP/llNliMIZODGS7Dio8sjqjFH
         5J5+UyDTUbEINCiX1VXiXmAJOyckxdJCiKrHvifwF6Uz4hNkP7Jrhm9kM61maV6lFT85
         +DLg==
X-Gm-Message-State: AGRZ1gK+dq747aLYHD1ki7BEdwKoFtVF7z9N8k9tYwM66eKgcUsk8G+A
	jeU4/Lp5Lz8dRhWU0haWVukv1Q==
X-Google-Smtp-Source: AJdET5e9JiSHyxM7pxKk6NRRFheM/3OO5vIhvsNlG11hVMJk8O+cFYzUiV7dn4wZdz4atznkSHyvxw==
X-Received: by 2002:a17:906:6006:: with SMTP id o6-v6mr1299452ejj.4.1541972310095;
        Sun, 11 Nov 2018 13:38:30 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a50:fb93:: with SMTP id e19-v6ls1589250edq.4.gmail; Sun, 11
 Nov 2018 13:38:28 -0800 (PST)
X-Received: by 2002:a50:98c4:: with SMTP id j62-v6mr9726225edb.106.1541972308825;
        Sun, 11 Nov 2018 13:38:28 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1541972308; cv=none;
        d=google.com; s=arc-20160816;
        b=cbccqRGDJ/Qmg69woXbxeCv3bL6tSmv32uSt51/+XrOu1U4rmYj0FYU1+Bke6Xj9nF
         aMSUBl30MF7MjwfdsnCLKudERXfSWJRvOsxk1OlL2HmgmmzC9owNc6z8dZR8X4/YJuom
         nJp/F361z0r785Z7drCOKW3LVu4wde8ZLwTG/h855KzxgQxZ02DJLmSJVD4gMzu7kkw+
         yjdhfRAL47PgXQauQYyTY6AYGWTD2N8EjDMI9Q0vzpAPHM+I6BK9rjaebPAfWtMRPycD
         On2WtKiPp8k0pS7sNaG6GBTiPrwi26zLqawgMgOo812BnoSTsdsv8tVXLhVesFaOyfNK
         FtbQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=GhAUWowD0H6Fw+DQ01TzxwyIBJpO5By2r0bGUxyfRzs=;
        b=XcqTT5CS4jUR/56cxcBjXpie770xfb42kHSh/1li6U641g6VC75tX0L8GN9duZO/wV
         gHWjAVmuhIAfu78q9hQL+lbXjOLN6xAkQbjMYK4VZ8X9aga+wyaYMt8eoq/xFydU1rA2
         U71V5DULpIg7TjY+zEtEN4HoLg2+IQq1ji2W29EvZIFPavGgOoemjrlQg2e/t56nnBN1
         wzsjCWv6ePh8UYsWjTmzKF856L/+USLPyzAQEe4wgKWrDqI82YqgYGJPu4kY2c0avTA4
         kym900Gk3qshjSqES/SInYZSw8RGcpyhgzFhYqg4A7VsGoj7s9Nkw9/UfQKVtQJ74shz
         7w/A==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=eqfzdfuh;
       spf=pass (google.com: domain of bbi5291@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=bbi5291@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id y19-v6sor7322878edt.14.2018.11.11.13.38.28
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Sun, 11 Nov 2018 13:38:28 -0800 (PST)
Received-SPF: pass (google.com: domain of bbi5291@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a50:ce5e:: with SMTP id k30-v6mr9821064edj.207.1541972308075;
 Sun, 11 Nov 2018 13:38:28 -0800 (PST)
In-Reply-To: <7da1f33f-c2c1-482f-8fc2-c23a9767a5ec@isocpp.org>
X-Original-Sender: bbi5291@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=eqfzdfuh;       spf=pass
 (google.com: domain of bbi5291@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=bbi5291@gmail.com;       dmarc=pass (p=NONE
 sp=QUARANTINE dis=NONE) header.from=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:40961
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40961>

--000000000000ad2b00057a6a6797
Content-Type: text/plain; charset="UTF-8"

On Sat, Nov 10, 2018 at 10:24 AM <mihailnajdenov@gmail.com> wrote:

>
>
> On Friday, November 9, 2018 at 6:50:59 PM UTC+2, Brian Bi wrote:
>>
>>
>>
>> On Fri, Nov 9, 2018 at 3:19 AM <mihailn...@gmail.com> wrote:
>>
>>> There are multiple problems with '\n'
>>>
>>> First - it is ultimately C ("way")
>>>
>> This mailing list is about C++, not Java, Rust, Swift, etc.
>> This is not an argument.
>>
>
> There is some sort of miscommunication.
> The fact there no C++ way to insert a new line (only a UNIX special
> character way) is what I state an issue,
> considering the rest of the API
>

'\n' is standard C, which became standard C++ about 20 years ago. I don't
see the issue.


>
>
>>
>> Second, when we introduce simple output to beginners, for which cout is
>>> actually good because of overloading,
>>> when using '\n' we have to introduce additional topics
>>>  - the fact a char can be more the one, well, character
>>>  - special magic characters
>>> We also create asymmetry b/w what is used to start the output std::cout
>>> (an object), to modify it (hex) and what is used to end it ("magic").
>>>
>>
>
>> What do you mean, "what is used to end it"? A semicolon?
>>
>
> std::cout     //< start
>   << 12.f
>   << ' '
>   << std::hex //< modify
>   << 255
>   << '\n';    //< finish (magic)
>
>
Note that printf (and other languages) already use special characters to
> modify the output, so having an '\n' is not abrupt.
>
> But C++ streams are different, having to spell out a special character is
> odd and unintuitive for a beginner and a design deficiency in general.
>

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 screams some design flaw - we should be able to insert a new lines
>>> the same way we modify the stream!
>>>
>> Yes, the way to do that is with '\n'.
>>
>>
>>>
>>> On its own std::endl has the flaw that it does not obey the "do one
>>> thing" rule.
>>> Once we deprecate it, this will shut down all the naive
>>> tutorials/courses still teaching it as the default!
>>>
>>>
>>> As for std::newline, we have options -
>>>
>>> std::nl //< even a beginner can "read" it
>>> std::newl //< orthogonal to endl
>>> std::br //< why not at this point!
>>> std::brl
>>> std::bl
>>>
>>> Geeks can still use `\n`, but a beginner (and a teacher) will have a
>>> simple, *correct, *go-to option that models the syntax already
>>> introduced (std::cout)!
>>>
>>>
>>> On Friday, November 9, 2018 at 8:22:26 AM UTC+2, PeterSommerlad wrote:
>>>>
>>>> So the better way is do better teaching. I show my students that they
>>>> should not use endl, except when they need it.
>>>>
>>>> Sent from Peter Sommerlad's iPad
>>>> +41 79 432 23 32
>>>>
>>>> On 8 Nov 2018, at 23:43, Hyman Rosen <hyman...@gmail.com> wrote:
>>>>
>>>> On Thu, Nov 8, 2018 at 5:08 PM Brian Bi <bbi...@gmail.com> wrote:
>>>>
>>>>> I think the reason why novices use std::endl is that they're under the
>>>>> impression (no doubt perpetuated by incompetent educators) that std::endl
>>>>> is portable whereas '\n' isn't.
>>>>>
>>>>
>>>> I think novices use std::endl because that's how C++ formatted I/O
>>>> was presented for ages.  I have the feeling, completely unsupported
>>>> by evidence, that the iostreams designers thought manipulators were
>>>> really keen, and wanted to have one that would always get used.
>>>>
>>>> --
>>>> 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-proposal...@isocpp.org.
>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYYZjeHHbRZ5bcHLYVsWfspwCeQ8oxEDRbuJ8dqAtsX5A%40mail.gmail.com
>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYYZjeHHbRZ5bcHLYVsWfspwCeQ8oxEDRbuJ8dqAtsX5A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> --
>>> 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-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/b49f4c85-816b-4b35-851d-407061a8ef9f%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/b49f4c85-816b-4b35-851d-407061a8ef9f%40isocpp.org?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> *Brian Bi*
>>
> --
> 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/7da1f33f-c2c1-482f-8fc2-c23a9767a5ec%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7da1f33f-c2c1-482f-8fc2-c23a9767a5ec%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>


-- 
*Brian Bi*

-- 
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/CAMmfjbMHae%3DpbG7LMjjjqWAE-5Zaiwi3rpWXr-HpwBRo0bjvfA%40mail.gmail.com.

--000000000000ad2b00057a6a6797
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Sat, Nov 10=
, 2018 at 10:24 AM &lt;<a href=3D"mailto:mihailnajdenov@gmail.com">mihailna=
jdenov@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><br><br>On Friday, November 9, 2018 at 6:50:59 PM UTC+2, Bria=
n Bi wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:=
0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br=
><div class=3D"gmail_quote"><div dir=3D"ltr">On Fri, Nov 9, 2018 at 3:19 AM=
 &lt;<a rel=3D"nofollow">mihailn...@gmail.com</a>&gt; wrote:<br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div dir=3D"ltr">There are multiple problems with=
 &#39;\n&#39;<div><br></div><div>First - it is ultimately C (&quot;way&quot=
;)</div></div></blockquote><div>This mailing list is about C++, not Java, R=
ust, Swift, etc.</div><div>This is not an argument.</div></div></div></bloc=
kquote><div><br></div><div>There is some sort of miscommunication.=C2=A0</d=
iv><div>The fact there no C++ way to insert a new line (only a UNIX special=
 character way) is what I state an issue,=C2=A0</div><div>considering the r=
est of the API=C2=A0</div></div></blockquote><div><br></div><div>&#39;\n&#3=
9; is standard C, which became standard C++ about 20 years ago. I don&#39;t=
 see the issue.<br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr"><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"=
margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><div class=3D"gmail_quote"><div><br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"><div>Second, when we introduce simple output=
 to beginners, for which cout is actually good because of overloading,</div=
><div>when using &#39;\n&#39; we have to introduce additional topics=C2=A0<=
br><div>=C2=A0- the fact a char can be more the one, well, character</div><=
div>=C2=A0- special magic characters</div><div>We also create asymmetry b/w=
 what is used to start the output std::cout (an object), to modify it (hex)=
 and what is used to end it (&quot;magic&quot;).</div></div></div></blockqu=
ote></div></div></blockquote><div>=C2=A0</div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding=
-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>What do you mea=
n, &quot;what is used to end it&quot;? A semicolon?</div></div></div></bloc=
kquote><div><br></div><div><div><font face=3D"courier new, monospace">std::=
cout=C2=A0 =C2=A0 =C2=A0//&lt; start=C2=A0</font></div><div><font face=3D"c=
ourier new, monospace">=C2=A0 &lt;&lt; 12.f=C2=A0</font></div><div><font fa=
ce=3D"courier new, monospace">=C2=A0 &lt;&lt; &#39; &#39;=C2=A0</font></div=
><div><font face=3D"courier new, monospace">=C2=A0 &lt;&lt; std::hex //&lt;=
 modify</font></div><div><font face=3D"courier new, monospace">=C2=A0 &lt;&=
lt; 255</font></div><div><font face=3D"courier new, monospace">=C2=A0 &lt;&=
lt; &#39;\n&#39;;=C2=A0 =C2=A0 //&lt; finish (magic)=C2=A0</font></div></di=
v><div>=C2=A0</div></div></blockquote><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div d=
ir=3D"ltr"><div></div><div>Note that printf (and other languages) already u=
se special characters to modify the output, so having an &#39;\n&#39; is no=
t abrupt.</div><div><br></div><div>But C++ streams are different, having to=
 spell out a special character is odd and unintuitive for a beginner and a =
design deficiency in general.=C2=A0</div></div></blockquote><div><br></div>=
<div>It&#39;s only &quot;magic&quot; if you teach beginners that &#39;\n&#3=
9; is a special magic=20
command, rather than the literal representation of the newline=20
character.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D=
"ltr"><div>=C2=A0</div><div><br></div><div><br></div><blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>=C2=A0</=
div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div><br></div><di=
v>This screams some design flaw - we should be able to insert a new lines t=
he same way we modify the stream!</div></div></div></blockquote><div>Yes, t=
he way to do that is with &#39;\n&#39;.</div><div>=C2=A0</div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><div><div><br></div><div>On its own std:=
:endl has the flaw that it does not obey the &quot;do one thing&quot; rule.=
</div><div>Once we deprecate it, this will shut down all the naive tutorial=
s/courses still teaching it as the default!=C2=A0</div><div><br></div><div>=
<br></div><div>As for std::newline, we have options -=C2=A0</div><div><br><=
/div><div><font face=3D"courier new, monospace">std::nl //&lt; even a begin=
ner can &quot;read&quot; it</font></div><div><font face=3D"courier new, mon=
ospace">std::newl //&lt; orthogonal to endl</font></div><div><font face=3D"=
courier new, monospace">std::br //&lt; why not at this point!</font></div><=
div><font face=3D"courier new, monospace">std::brl</font></div><div><font f=
ace=3D"courier new, monospace">std::bl</font></div><div><br></div><div>Geek=
s can still use `\n`, but a beginner (and a teacher) will have a simple, <i=
>correct,=C2=A0</i>go-to option that models the syntax already introduced (=
std::cout)!</div><div><br><br>On Friday, November 9, 2018 at 8:22:26 AM UTC=
+2, PeterSommerlad wrote:<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">So the better way is do better teaching. I show my students that =
they should not use endl, except when they need it.<br><br><div dir=3D"ltr"=
>Sent from Peter Sommerlad&#39;s<span>=C2=A0iPad</span><div><span>+41 79 43=
2 23 32</span></div></div><div dir=3D"ltr"><br>On 8 Nov 2018, at 23:43, Hym=
an Rosen &lt;<a rel=3D"nofollow">hyman...@gmail.com</a>&gt; wrote:<br><br><=
/div><blockquote type=3D"cite"><div dir=3D"ltr"><div dir=3D"ltr"><div class=
=3D"gmail_quote"><div dir=3D"ltr">On Thu, Nov 8, 2018 at 5:08 PM Brian Bi &=
lt;<a rel=3D"nofollow">bbi...@gmail.com</a>&gt; wrote:</div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>I think th=
e reason why novices use std::endl is that they&#39;re under the impression=
 (no doubt perpetuated by incompetent educators) that std::endl is portable=
 whereas &#39;\n&#39; isn&#39;t.</div></div></div></blockquote><div><br>I t=
hink novices use std::endl because that&#39;s how C++ formatted I/O<br>was =
presented for ages.=C2=A0 I have the feeling, completely unsupported<br>by =
evidence, that the iostreams designers thought manipulators were<br>really =
keen, and wanted to have one that would always get used.</div></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/CAHSYqdYYZjeHHbRZ5bcHLYVsWfspwCeQ8oxE=
DRbuJ8dqAtsX5A%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter"=
 rel=3D"nofollow" target=3D"_blank">https://groups.google.com/a/isocpp.org/=
d/msgid/std-proposals/CAHSYqdYYZjeHHbRZ5bcHLYVsWfspwCeQ8oxEDRbuJ8dqAtsX5A%4=
0mail.gmail.com</a>.<br>
</div></blockquote></div></blockquote></div></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/b49f4c85-816b-4b35-851d-407061a8ef9f%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposa=
ls/b49f4c85-816b-4b35-851d-407061a8ef9f%40isocpp.org</a>.<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
><div dir=3D"ltr"><div><div dir=3D"ltr"><font color=3D"#c0c0c0"><i>Brian Bi=
</i></font><br><div></div><div></div><div></div></div></div></div></div></d=
iv>
</blockquote></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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/7da1f33f-c2c1-482f-8fc2-c23a9767a5ec%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7da1f33f-c2c1-=
482f-8fc2-c23a9767a5ec%40isocpp.org</a>.<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><d=
iv dir=3D"ltr"><font color=3D"#c0c0c0"><i>Brian Bi</i></font><br><div></div=
><div></div><div></div></div></div></div></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/CAMmfjbMHae%3DpbG7LMjjjqWAE-5Zaiwi3rp=
WXr-HpwBRo0bjvfA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAMmfjbMHae%3Dp=
bG7LMjjjqWAE-5Zaiwi3rpWXr-HpwBRo0bjvfA%40mail.gmail.com</a>.<br />

--000000000000ad2b00057a6a6797--

.
