Topic: Idea for a <prelude> header


Author: Markus Grech <markus.grech@gmail.com>
Date: Wed, 15 Oct 2014 02:22:30 -0700 (PDT)
Raw View
------=_Part_5243_1787254279.1413364950795
Content-Type: text/plain; charset=UTF-8

Hello everyone,

when I first started learning C++, having to memorize all the headers
placed a huge burden on me and I think many beginners feel the same. Other
languages have this thing called a prelude module/import that contains
things that are frequently used. I think that such a header can make C++ a
lot easier to teach. Bjarne Stroustrup uses similar header called
"std_lib_facilities.h" or something similar in his book.

A rough idea is that it would include <iostream>, <vector>, <map>, <string>
etc. and possibly have a using namespace std. A lot of discussion is going
to be needed to decide what should go into the header.

What do you think about the idea? Is that something worth working on?

Markus

--

---
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_5243_1787254279.1413364950795
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello everyone,<div><br></div><div>when I first started le=
arning C++, having to memorize all the headers placed a huge burden on me a=
nd I think many beginners feel the same. Other languages have this thing ca=
lled a prelude module/import that contains things that are frequently used.=
 I think that such a header can make C++ a lot easier to teach. Bjarne Stro=
ustrup uses similar header called "std_lib_facilities.h" or something simil=
ar in his book.</div><div><br></div><div>A rough idea is that it would incl=
ude &lt;iostream&gt;, &lt;vector&gt;, &lt;map&gt;, &lt;string&gt; etc. and =
possibly have a using namespace std. A lot of discussion is going to be nee=
ded to decide what should go into the header.</div><div><br></div><div>What=
 do you think about the idea? Is that something worth working on?</div><div=
><br></div><div>Markus</div></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_5243_1787254279.1413364950795--

.


Author: Saeed Amrollahi Boyouki <amrollahi.saeed@gmail.com>
Date: Wed, 15 Oct 2014 13:29:53 +0330
Raw View
On Wed, Oct 15, 2014 at 12:52 PM, Markus Grech <markus.grech@gmail.com> wrote:
> Hello everyone,
>
> when I first started learning C++, having to memorize all the headers placed
> a huge burden on me and I think many beginners feel the same. Other
> languages have this thing called a prelude module/import that contains
> things that are frequently used. I think that such a header can make C++ a
> lot easier to teach. Bjarne Stroustrup uses similar header called
> "std_lib_facilities.h" or something similar in his book.
>

Agreed

> A rough idea is that it would include <iostream>, <vector>, <map>, <string>
> etc. and possibly have a using namespace std. A lot of discussion is going
> to be needed to decide what should go into the header.
>
> What do you think about the idea? Is that something worth working on?
>
> Markus
>

FYI, Such proposal was first mentioned in Frankfurt Meeting (2009) by
Bjarne Stroustrup under the title:
   N2905. Aggregation headers
Bjarne proposed addition of two header files: <std-all> and <std-checked>
and each file contains a lot of header file inclusion.
IIRC, at Frankfurt, there wasn't enough time to consider the proposal.
I believe, such feature is in direct relation with one major goal of
C++11: Making Simple Tasks Simple.

Best,
   -- Saeed Amrollahi
   www.saeedamrollahi.com

--

---
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/.

.


Author: Peter Sommerlad <peter.sommerlad@hsr.ch>
Date: Wed, 15 Oct 2014 13:58:02 +0200
Raw View
--Apple-Mail=_02ADCDB7-4CE8-48E0-8CD5-83DC91697ADF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1

Hi Markus,

sorry for the advertisement, but we have tool support to automatically deri=
ve required includes from code usage:

see www.includator.com=20

It is based on Eclipse CDT and will be included into our Cevelop IDE in the=
 near future for free (www.cevelop.com)

Google was working on "include what you use" tool in the past, but it might=
 have been abandoned.

Regards
Peter.
On 15.10.2014, at 11:22, Markus Grech <markus.grech@gmail.com> wrote:

> Hello everyone,
>=20
> when I first started learning C++, having to memorize all the headers pla=
ced a huge burden on me and I think many beginners feel the same. Other lan=
guages have this thing called a prelude module/import that contains things =
that are frequently used. I think that such a header can make C++ a lot eas=
ier to teach. Bjarne Stroustrup uses similar header called "std_lib_facilit=
ies.h" or something similar in his book.
>=20
> A rough idea is that it would include <iostream>, <vector>, <map>, <strin=
g> etc. and possibly have a using namespace std. A lot of discussion is goi=
ng to be needed to decide what should go into the header.
>=20
> What do you think about the idea? Is that something worth working on?
>=20
> Markus
>=20
> --=20
>=20
> ---=20
> 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-propo=
sals/.

--=20
Prof. Peter Sommerlad

Institut f=FCr Software: Bessere Software - Einfach, Schneller!
HSR Hochschule f=FCr Technik Rapperswil
Oberseestr 10, Postfach 1475, CH-8640 Rapperswil

http://ifs.hsr.ch http://cevelop.com http://linticator.com=20
tel:+41 55 222 49 84 =3D=3D mobile:+41 79 432 23 32
fax:+41 55 222 46 29 =3D=3D mailto:peter.sommerlad@hsr.ch






--=20

---=20
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 e=
mail 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-proposa=
ls/.

--Apple-Mail=_02ADCDB7-4CE8-48E0-8CD5-83DC91697ADF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Diso-8859-1"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mo=
de: space; -webkit-line-break: after-white-space;">Hi Markus,<div><br></div=
><div>sorry for the advertisement, but we have tool support to automaticall=
y derive required includes from code usage:</div><div><br></div><div>see <a=
 href=3D"http://www.includator.com">www.includator.com</a>&nbsp;</div><div>=
<br></div><div>It is based on Eclipse CDT and will be included into our Cev=
elop IDE in the near future for free (<a href=3D"http://www.cevelop.com">ww=
w.cevelop.com</a>)</div><div><br></div><div>Google was working on "include =
what you use" tool in the past, but it might have been abandoned.</div><div=
><br></div><div>Regards</div><div>Peter.<br><div><div>On 15.10.2014, at 11:=
22, Markus Grech &lt;<a href=3D"mailto:markus.grech@gmail.com">markus.grech=
@gmail.com</a>&gt; wrote:</div><br class=3D"Apple-interchange-newline"><blo=
ckquote type=3D"cite"><meta http-equiv=3D"Content-Type" content=3D"text/htm=
l; charset=3Dutf-8"><div dir=3D"ltr">Hello everyone,<div><br></div><div>whe=
n I first started learning C++, having to memorize all the headers placed a=
 huge burden on me and I think many beginners feel the same. Other language=
s have this thing called a prelude module/import that contains things that =
are frequently used. I think that such a header can make C++ a lot easier t=
o teach. Bjarne Stroustrup uses similar header called "std_lib_facilities.h=
" or something similar in his book.</div><div><br></div><div>A rough idea i=
s that it would include &lt;iostream&gt;, &lt;vector&gt;, &lt;map&gt;, &lt;=
string&gt; etc. and possibly have a using namespace std. A lot of discussio=
n is going to be needed to decide what should go into the header.</div><div=
><br></div><div>What do you think about the idea? Is that something worth w=
orking on?</div><div><br></div><div>Markus</div></div><div><br class=3D"web=
kit-block-placeholder"></div>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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>
</blockquote></div><br><div apple-content-edited=3D"true">
<span class=3D"Apple-style-span" style=3D"border-collapse: separate; color:=
 rgb(0, 0, 0); font-family: Monaco; font-style: normal; font-variant: norma=
l; font-weight: normal; letter-spacing: normal; line-height: normal; orphan=
s: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; whi=
te-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webki=
t-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><span =
class=3D"Apple-style-span" style=3D"border-collapse: separate; border-spaci=
ng: 0px; color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-st=
yle: normal; font-variant: normal; font-weight: normal; letter-spacing: nor=
mal; line-height: normal; -webkit-text-decorations-in-effect: none; text-in=
dent: 0px; text-transform: none; orphans: 2; white-space: normal; widows: 2=
; word-spacing: 0px;"><div style=3D"word-wrap: break-word; -webkit-nbsp-mod=
e: space; -webkit-line-break: after-white-space;"><div style=3D"margin: 0px=
;">--&nbsp;</div><div style=3D"margin: 0px;">Prof. Peter Sommerlad</div><di=
v style=3D"margin: 0px; min-height: 14px;"><br></div><div style=3D"margin: =
0px;">Institut f=FCr Software: Bessere Software - Einfach, Schneller!</div>=
<div style=3D"margin: 0px;">HSR Hochschule f=FCr Technik Rapperswil</div><d=
iv style=3D"margin: 0px;">Oberseestr 10, Postfach 1475, CH-8640 Rapperswil<=
/div><div style=3D"margin: 0px; min-height: 14px;"><br></div></div></span><=
a href=3D"http://ifs.hsr.ch">http://ifs.hsr.ch</a> <a href=3D"http://cevelo=
p.com">http://cevelop.com</a> <a href=3D"http://linticator.com">http://lint=
icator.com</a>&nbsp;<br>tel:+41 55 222 49 84 =3D=3D mobile:+41 79 432 23 32=
<div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line=
-break: after-white-space; font-size: 12px;"><div style=3D"margin: 0px;">fa=
x:+41 55 222 46 29 =3D=3D <a href=3D"mailto:peter.sommerlad@hsr.ch">mailto:=
peter.sommerlad@hsr.ch</a></div><div style=3D"margin: 0px;"><br class=3D"kh=
tml-block-placeholder"></div><br class=3D"Apple-interchange-newline"></div>=
<br class=3D"Apple-interchange-newline"></span><br class=3D"Apple-interchan=
ge-newline"><br class=3D"Apple-interchange-newline">
</div>
<br></div></body></html>

<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 />

--Apple-Mail=_02ADCDB7-4CE8-48E0-8CD5-83DC91697ADF--

.


Author: Andy Prowl <andy.prowl@gmail.com>
Date: Wed, 15 Oct 2014 05:38:44 -0700 (PDT)
Raw View
------=_Part_1656_377157607.1413376724691
Content-Type: text/plain; charset=UTF-8

On Wednesday, October 15, 2014 1:58:32 PM UTC+2, PeterSommerlad wrote:
>
> Hi Markus,
>
> sorry for the advertisement, but we have tool support to automatically
> derive required includes from code usage:
>
> see www.includator.com
> <http://www.google.com/url?q=http%3A%2F%2Fwww.includator.com&sa=D&sntz=1&usg=AFQjCNGcUQJ29P6rxpqTOy6KoZl64UEPRA>
>
>
> It is based on Eclipse CDT and will be included into our Cevelop IDE in
> the near future for free (www.cevelop.com)
>
> Google was working on "include what you use" tool in the past, but it
> might have been abandoned.
>
> Regards
> Peter.
>


Nice. Is this guaranteed to work all the time? I mean, given *any*
translation unit, is this tool capable of inferring all the standard
headers that need to be included? If so, how silly would it be to propose
"#include <auto>" as a standard feature? :) (It sure feels silly, but I
can't think of a counter-argument)

Kind regards,

Andy

--

---
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_1656_377157607.1413376724691
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, October 15, 2014 1:58:32 PM UTC+2, PeterSomm=
erlad wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"word=
-wrap:break-word">Hi Markus,<div><br></div><div>sorry for the advertisement=
, but we have tool support to automatically derive required includes from c=
ode usage:</div><div><br></div><div>see <a href=3D"http://www.google.com/ur=
l?q=3Dhttp%3A%2F%2Fwww.includator.com&amp;sa=3DD&amp;sntz=3D1&amp;usg=3DAFQ=
jCNGcUQJ29P6rxpqTOy6KoZl64UEPRA" target=3D"_blank" onmousedown=3D"this.href=
=3D'http://www.google.com/url?q\75http%3A%2F%2Fwww.includator.com\46sa\75D\=
46sntz\0751\46usg\75AFQjCNGcUQJ29P6rxpqTOy6KoZl64UEPRA';return true;" oncli=
ck=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fwww.includato=
r.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGcUQJ29P6rxpqTOy6KoZl64UEPRA';retu=
rn true;">www.includator.com</a>&nbsp;</div><div><br></div><div>It is based=
 on Eclipse CDT and will be included into our Cevelop IDE in the near futur=
e for free (<a href=3D"http://www.cevelop.com" target=3D"_blank" onmousedow=
n=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fwww.cevelop.co=
m\46sa\75D\46sntz\0751\46usg\75AFQjCNGk6plgwuCw9CohsFjYZcPV73MFPQ';return t=
rue;" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fww=
w.cevelop.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGk6plgwuCw9CohsFjYZcPV73MF=
PQ';return true;">www.cevelop.com</a>)</div><div><br></div><div>Google was =
working on "include what you use" tool in the past, but it might have been =
abandoned.</div><div><br></div><div>Regards</div><div>Peter.<br></div></div=
></blockquote><div><br><br><span style=3D"font-size: 13.3333330154419px;">N=
ice. Is this guaranteed to work all the time? I mean, given *any* translati=
on unit, is this tool capable of inferring all the standard headers that ne=
ed to be included? If so, how silly would it be to propose "#include &lt;au=
to&gt;" as a standard feature? :) (It sure feels silly, but I can't think o=
f a counter-argument)</span><br><br>Kind regards,<br><br>Andy</div></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_1656_377157607.1413376724691--

.


Author: =?UTF-8?Q?David_Rodr=C3=ADguez_Ibeas?= <dibeas@ieee.org>
Date: Wed, 15 Oct 2014 08:59:05 -0400
Raw View
--001a113f14f25fa9d4050575b26b
Content-Type: text/plain; charset=UTF-8

> A rough idea is that it would include <iostream>, <vector>, <map>,
<string> etc. and possibly have a using namespace std.

Please, don't even consider a using directive in a header, and much less in
a standard one. You might as well remove the 'std' namespace altogether.

> how silly would it be to propose "#include <auto>" as a standard feature?

I won't go into the silliness of it, but it seems quite problematic. For
starters, including "the right things" depends on the compiler going over
the code to figure out what needs to be included, but the inclusion happens
during preprocessing time (and the preprocessor does not know how to read
your code).  Part of the problem here is that the library need not come
with the compiler, and many compilers support using different libraries
even when they ship their own.  If this was not the case, the compiler
could *know* it's own standard library and work without even the #include
<auto> (or let the preproccessor ignore that particular include). But once
you allow for different standard library implementations, and in particular
in the presence of ADL, figuring out what to include is non-trivial (as
Peter surely knows).

Consider for example:

accumulate(v.begin(), v.end(), 1, std::multiplies<int>());

Should that be an error as the user might be wanting to use their own
function? Or should it trigger the inclusion of the algorithm header? This
is specially important when instead of using one of the well known
algorithms the code might be wanting to use some extension, like
'iota_n(Iterator it, size_t n)' or in the past, 'copy' or 'copy_if', that
could be provided in some implementations but not others.

In an IDE that is trivially solved: don't decide, place a marker in this
line and offer different options.

    David

On Wed, Oct 15, 2014 at 8:38 AM, Andy Prowl <andy.prowl@gmail.com> wrote:

> On Wednesday, October 15, 2014 1:58:32 PM UTC+2, PeterSommerlad wrote:
>>
>> Hi Markus,
>>
>> sorry for the advertisement, but we have tool support to automatically
>> derive required includes from code usage:
>>
>> see www.includator.com
>> <http://www.google.com/url?q=http%3A%2F%2Fwww.includator.com&sa=D&sntz=1&usg=AFQjCNGcUQJ29P6rxpqTOy6KoZl64UEPRA>
>>
>>
>> It is based on Eclipse CDT and will be included into our Cevelop IDE in
>> the near future for free (www.cevelop.com)
>>
>> Google was working on "include what you use" tool in the past, but it
>> might have been abandoned.
>>
>> Regards
>> Peter.
>>
>
>
> Nice. Is this guaranteed to work all the time? I mean, given *any*
> translation unit, is this tool capable of inferring all the standard
> headers that need to be included? If so, how silly would it be to propose
> "#include <auto>" as a standard feature? :) (It sure feels silly, but I
> can't think of a counter-argument)
>
> Kind regards,
>
> Andy
>
> --
>
> ---
> 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/.
>

--

---
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/.

--001a113f14f25fa9d4050575b26b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><span style=3D"font-size:13px;font-family:arial,sans-serif=
">&gt;=C2=A0</span><span style=3D"font-size:13px;font-family:arial,sans-ser=
if">A rough idea is that it would include &lt;iostream&gt;, &lt;vector&gt;,=
 &lt;map&gt;, &lt;string&gt; etc. and possibly have a using namespace std.<=
/span><div><br></div><div>Please, don&#39;t even consider a using directive=
 in a header, and much less in a standard one. You might as well remove the=
 &#39;std&#39; namespace altogether.</div><div><br></div><div>&gt;=C2=A0<sp=
an style=3D"font-family:arial,sans-serif;font-size:13px">how silly would it=
 be to propose &quot;#include &lt;auto&gt;&quot; as a standard feature?<br>=
<br>I won&#39;t go into the silliness of it, but it seems quite problematic=
.. For starters, including &quot;the right things&quot; depends on the compi=
ler going over the code to figure out what needs to be included, but the in=
clusion happens during preprocessing time (and the preprocessor does not kn=
ow how to read your code).=C2=A0 Part of the problem here is that the libra=
ry need not come with the compiler, and many compilers support using differ=
ent libraries even when they ship their own.=C2=A0 If this was not the case=
, the compiler could *know* it&#39;s own standard library and work without =
even the #include &lt;auto&gt; (or let the preproccessor ignore that partic=
ular include). But once you allow for different standard library implementa=
tions, and in particular in the presence of ADL, figuring out what to inclu=
de is non-trivial (as Peter surely knows).<br><br>Consider for example:<br>=
<br>accumulate(v.begin(), v.end(), 1, std::multiplies&lt;int&gt;());<br><br=
>Should that be an error as the user might be wanting to use their own func=
tion? Or should it trigger the inclusion of the algorithm header? This is s=
pecially important when instead of using one of the well known algorithms t=
he code might be wanting to use some extension, like &#39;iota_n(Iterator i=
t, size_t n)&#39; or in the past, &#39;copy&#39; or &#39;copy_if&#39;, that=
 could be provided in some implementations but not others.<br><br>In an IDE=
 that is trivially solved: don&#39;t decide, place a marker in this line an=
d offer different options.<br><br>=C2=A0 =C2=A0 David</span></div></div><di=
v class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Wed, Oct 15, 2014=
 at 8:38 AM, Andy Prowl <span dir=3D"ltr">&lt;<a href=3D"mailto:andy.prowl@=
gmail.com" target=3D"_blank">andy.prowl@gmail.com</a>&gt;</span> wrote:<br>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span class=3D"">On Wednesd=
ay, October 15, 2014 1:58:32 PM UTC+2, PeterSommerlad wrote:<blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div style=3D"word-wrap:break-word">Hi Markus,<div=
><br></div><div>sorry for the advertisement, but we have tool support to au=
tomatically derive required includes from code usage:</div><div><br></div><=
div>see <a href=3D"http://www.google.com/url?q=3Dhttp%3A%2F%2Fwww.includato=
r.com&amp;sa=3DD&amp;sntz=3D1&amp;usg=3DAFQjCNGcUQJ29P6rxpqTOy6KoZl64UEPRA"=
 target=3D"_blank">www.includator.com</a>=C2=A0</div><div><br></div><div>It=
 is based on Eclipse CDT and will be included into our Cevelop IDE in the n=
ear future for free (<a href=3D"http://www.cevelop.com" target=3D"_blank">w=
ww.cevelop.com</a>)</div><div><br></div><div>Google was working on &quot;in=
clude what you use&quot; tool in the past, but it might have been abandoned=
..</div><div><br></div><div>Regards</div><div>Peter.<br></div></div></blockq=
uote></span><div><br><br><span style=3D"font-size:13.3333330154419px">Nice.=
 Is this guaranteed to work all the time? I mean, given *any* translation u=
nit, is this tool capable of inferring all the standard headers that need t=
o be included? If so, how silly would it be to propose &quot;#include &lt;a=
uto&gt;&quot; as a standard feature? :) (It sure feels silly, but I can&#39=
;t think of a counter-argument)</span><br><br>Kind regards,<br><br>Andy</di=
v></div><div class=3D"HOEnZb"><div class=3D"h5">

<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" 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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--001a113f14f25fa9d4050575b26b--

.


Author: Markus Grech <markus.grech@gmail.com>
Date: Wed, 15 Oct 2014 06:22:02 -0700 (PDT)
Raw View
------=_Part_2816_1051300307.1413379322126
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wednesday, October 15, 2014 2:59:06 PM UTC+2, David Rodr=C3=ADguez Ibeas=
=20
wrote:
>
> > A rough idea is that it would include <iostream>, <vector>, <map>,=20
> <string> etc. and possibly have a using namespace std.
>
> Please, don't even consider a using directive in a header, and much less=
=20
> in a standard one. You might as well remove the 'std' namespace altogethe=
r.
>
While in general I fully agree (and i never use using-directives in headers=
=20
either), i have to disagree here.
The idea is that this header is for C++ novices. Advanced users should know=
=20
their headers and not use <prelude> anymore. The novice does not want nor=
=20
need to deal with namespaces.
And I consider the fact that it can break code actually a good thing.=20
include-all headers are generally frowned upon, advanced and expert users=
=20
of C++ are expected to know better.

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_2816_1051300307.1413379322126
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, October 15, 2014 2:59:06 PM UTC+2, David Rod=
r=C3=ADguez Ibeas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div d=
ir=3D"ltr"><span style=3D"font-size:13px;font-family:arial,sans-serif">&gt;=
&nbsp;</span><span style=3D"font-size:13px;font-family:arial,sans-serif">A =
rough idea is that it would include &lt;iostream&gt;, &lt;vector&gt;, &lt;m=
ap&gt;, &lt;string&gt; etc. and possibly have a using namespace std.</span>=
<div><br></div><div>Please, don't even consider a using directive in a head=
er, and much less in a standard one. You might as well remove the 'std' nam=
espace altogether.</div></div></blockquote><div>While in general I fully ag=
ree (and i never use using-directives in headers either), i have to disagre=
e here.</div><div>The idea is that this header is for C++ novices. Advanced=
 users should know their headers and not use &lt;prelude&gt; anymore. The n=
ovice does not want nor need to deal with namespaces.</div><div>And I consi=
der the fact that it can break code actually a good thing. include-all head=
ers are generally frowned upon, advanced and expert users of C++ are expect=
ed to know better.</div></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_2816_1051300307.1413379322126--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 15 Oct 2014 16:24:06 +0300
Raw View
On 15 October 2014 16:22, Markus Grech <markus.grech@gmail.com> wrote:
> While in general I fully agree (and i never use using-directives in headers
> either), i have to disagree here.
> The idea is that this header is for C++ novices. Advanced users should know
> their headers and not use <prelude> anymore. The novice does not want nor
> need to deal with namespaces.

I don't think I'll find it difficult to find people who disagree with
the "not need"
part.

--

---
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/.

.


Author: Andy Prowl <andy.prowl@gmail.com>
Date: Wed, 15 Oct 2014 06:27:08 -0700 (PDT)
Raw View
------=_Part_428_188179804.1413379628369
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wednesday, October 15, 2014 2:59:06 PM UTC+2, David Rodr=C3=ADguez Ibeas=
=20
wrote:
>
> > A rough idea is that it would include <iostream>, <vector>, <map>,=20
> <string> etc. and possibly have a using namespace std.
>
> Please, don't even consider a using directive in a header, and much less=
=20
> in a standard one. You might as well remove the 'std' namespace altogethe=
r.
>
> > how silly would it be to propose "#include <auto>" as a standard=20
> feature?
>
> I won't go into the silliness of it, but it seems quite problematic.  [..=
..]
>

Thanks, your arguments make sense, as always.

Kind regards,

Andy

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_428_188179804.1413379628369
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, October 15, 2014 2:59:06 PM UTC+2, David Rod=
r=C3=ADguez Ibeas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div d=
ir=3D"ltr"><span style=3D"font-size:13px;font-family:arial,sans-serif">&gt;=
&nbsp;</span><span style=3D"font-size:13px;font-family:arial,sans-serif">A =
rough idea is that it would include &lt;iostream&gt;, &lt;vector&gt;, &lt;m=
ap&gt;, &lt;string&gt; etc. and possibly have a using namespace std.</span>=
<div><br></div><div>Please, don't even consider a using directive in a head=
er, and much less in a standard one. You might as well remove the 'std' nam=
espace altogether.</div><div><br></div><div>&gt;&nbsp;<span style=3D"font-f=
amily:arial,sans-serif;font-size:13px">how silly would it be to propose "#i=
nclude &lt;auto&gt;" as a standard feature?<br><br>I won't go into the sill=
iness of it, but it seems quite problematic. &nbsp;[...]</span></div></div>=
</blockquote><div><br>Thanks, your arguments make sense, as always.<br><br>=
Kind regards,<br><br>Andy</div></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_428_188179804.1413379628369--

.


Author: Saeed Amrollahi Boyouki <amrollahi.saeed@gmail.com>
Date: Wed, 15 Oct 2014 18:25:58 +0330
Raw View
> Nice. Is this guaranteed to work all the time? I mean, given *any*
> translation unit, is this tool capable of inferring all the standard headers
> that need to be included? If so, how silly would it be to propose "#include
> <auto>" as a standard feature? :) (It sure feels silly, but I can't think of
> a counter-argument)
>
In my opinion, #include <auto>, isn't cute. auto is a keyword and is
meaningful for
the compiler while file inclusion is the pre-processor job.
I believe it's overuse of auto! also which header files will be included
with this directive? It's isn't clear.

> Kind regards,
>
> Andy
>

-- Saeed

--

---
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/.

.


Author: Andy Prowl <andy.prowl@gmail.com>
Date: Wed, 15 Oct 2014 08:00:59 -0700 (PDT)
Raw View
------=_Part_6284_254929259.1413385259820
Content-Type: text/plain; charset=UTF-8

On Wednesday, October 15, 2014 4:55:59 PM UTC+2, Saeed Amrollahi Boyouki
wrote:
>
> > Nice. Is this guaranteed to work all the time? I mean, given *any*
> > translation unit, is this tool capable of inferring all the standard
> headers
> > that need to be included? If so, how silly would it be to propose
> "#include
> > <auto>" as a standard feature? :) (It sure feels silly, but I can't
> think of
> > a counter-argument)
> >
> In my opinion, #include <auto>, isn't cute. auto is a keyword and is
> meaningful for
> the compiler while file inclusion is the pre-processor job.
> I believe it's overuse of auto! also which header files will be included
> with this directive? It's isn't clear.
>
> > Kind regards,
> >
> > Andy
> >
>
> -- Saeed
>

I agree, it was a half-joke. I was basically wondering whether there is the
technical possibility of having language support for deducing the necessary
standard header inclusions from the code (hence the "auto" joke), but (as I
expected) it turned out to be a silly dream. Sorry for the noise.

Kind regards,

Andy

--

---
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_6284_254929259.1413385259820
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, October 15, 2014 4:55:59 PM UTC+2, Saeed Amr=
ollahi Boyouki wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">&gt; Nice=
.. Is this guaranteed to work all the time? I mean, given *any*
<br>&gt; translation unit, is this tool capable of inferring all the standa=
rd headers
<br>&gt; that need to be included? If so, how silly would it be to propose =
"#include
<br>&gt; &lt;auto&gt;" as a standard feature? :) (It sure feels silly, but =
I can't think of
<br>&gt; a counter-argument)
<br>&gt;
<br>In my opinion, #include &lt;auto&gt;, isn't cute. auto is a keyword and=
 is
<br>meaningful for
<br>the compiler while file inclusion is the pre-processor job.
<br>I believe it's overuse of auto! also which header files will be include=
d
<br>with this directive? It's isn't clear.
<br>
<br>&gt; Kind regards,
<br>&gt;
<br>&gt; Andy
<br>&gt;
<br>
<br>-- Saeed
<br></blockquote><div><br>I agree, it was a half-joke. I was basically wond=
ering whether there is the technical possibility of having language support=
 for deducing the necessary standard header inclusions from the code (hence=
 the "auto" joke), but (as I expected) it turned out to be a silly dream. S=
orry for the noise.<br><br>Kind regards,<br><br>Andy</div></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_6284_254929259.1413385259820--

.


Author: "dgutson ." <danielgutson@gmail.com>
Date: Wed, 15 Oct 2014 12:09:29 -0300
Raw View
On Wed, Oct 15, 2014 at 8:58 AM, Peter Sommerlad <peter.sommerlad@hsr.ch> w=
rote:
> Hi Markus,
>
> sorry for the advertisement, but we have tool support to automatically
> derive required includes from code usage:
>
> see www.includator.com
>
> It is based on Eclipse CDT and will be included into our Cevelop IDE in t=
he
> near future for free (www.cevelop.com)
>
> Google was working on "include what you use" tool in the past, but it mig=
ht
> have been abandoned.

FWIW, I developed https://uninclude.googlecode.com a couple of years
ago. It wasn't that easy. It analyses the preprocessor output,
compiles and binary compare the results to determine whether a header
is needed or not.
Sorry for the spam.

   Daniel.

>
> Regards
> Peter.
>
> On 15.10.2014, at 11:22, Markus Grech <markus.grech@gmail.com> wrote:
>
> Hello everyone,
>
> when I first started learning C++, having to memorize all the headers pla=
ced
> a huge burden on me and I think many beginners feel the same. Other
> languages have this thing called a prelude module/import that contains
> things that are frequently used. I think that such a header can make C++ =
a
> lot easier to teach. Bjarne Stroustrup uses similar header called
> "std_lib_facilities.h" or something similar in his book.
>
> A rough idea is that it would include <iostream>, <vector>, <map>, <strin=
g>
> etc. and possibly have a using namespace std. A lot of discussion is goin=
g
> to be needed to decide what should go into the header.
>
> What do you think about the idea? Is that something worth working on?
>
> Markus
>
> --
>
> ---
> 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/.
>
>
> --
> Prof. Peter Sommerlad
>
> Institut f=C3=BCr Software: Bessere Software - Einfach, Schneller!
> HSR Hochschule f=C3=BCr Technik Rapperswil
> Oberseestr 10, Postfach 1475, CH-8640 Rapperswil
>
> http://ifs.hsr.ch http://cevelop.com http://linticator.com
> tel:+41 55 222 49 84 =3D=3D mobile:+41 79 432 23 32
> fax:+41 55 222 46 29 =3D=3D mailto:peter.sommerlad@hsr.ch
>
>
>
>
>
>
> --
>
> ---
> 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/.



--=20
Who=E2=80=99s got the sweetest disposition?
One guess, that=E2=80=99s who?
Who=E2=80=99d never, ever start an argument?
Who never shows a bit of temperament?
Who's never wrong but always right?
Who'd never dream of starting a fight?
Who get stuck with all the bad luck?

--=20

---=20
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 e=
mail 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-proposa=
ls/.

.


Author: corentin.schreiber@cea.fr
Date: Wed, 15 Oct 2014 12:00:18 -0700 (PDT)
Raw View
------=_Part_791_857889453.1413399618417
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Le mercredi 15 octobre 2014 15:22:02 UTC+2, Markus Grech a =C3=A9crit :
>
> The novice does not want nor need to deal with namespaces.
>

You want to introduce this header to teaching purposes, which is a noble=20
cause that I totally support (don't get me wrong), but I am convinced that=
=20
throwing "using namespace std;" in here is clearly not going to help in the=
=20
long term.

Suppose you do: after learning C++ for one year using this header, somebody=
=20
(you, the teacher) will one day tell the innocent student that she has to=
=20
stop using the <prelude> header, because she became a grown up programmer.=
=20
Now, she has to learn which  of the functions and types she uses have to be=
=20
prefixed with "std::", and which should not. Most likely, she (or a=20
fraction of her class mates) will find it annoying and end up sticking=20
"using namespace std;" at the beginning of each of her files anyway. The=20
strength of habits is one of the hardest things to fight against.

I think on the contrary that one should rather teach students as soon as=20
possible that namespaces are not just here to make them type more=20
characters, but are essential in structuring, understanding and clarifying=
=20
code.

On a side note, excluding "using namespace std;", I believe you will soon=
=20
be able to achieve what you are after by just typing "using module std;".

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_791_857889453.1413399618417
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Le mercredi 15 octobre 2014 15:22:02 UTC+2, Markus Grech a=
 =C3=A9crit&nbsp;:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">The novice does not want nor need to deal with namespaces.</div></bloc=
kquote><div><br>You want to introduce this header to teaching purposes, whi=
ch is a noble cause that I totally support (don't get me wrong), but I am c=
onvinced that throwing "using namespace std;" in here is clearly not going =
to help in the long term.<br><br>Suppose you do: after learning C++ for one=
 year using this header, somebody (you, the teacher) will one day tell the =
innocent student that she has to stop using the &lt;prelude&gt; header, bec=
ause she became a grown up programmer. Now, she has to learn which&nbsp; of=
 the functions and types she uses have to be prefixed with "std::", and whi=
ch should not. Most likely, she (or a fraction of her class mates) will fin=
d it annoying and end up sticking "using namespace std;" at the beginning o=
f each of her files anyway. The strength of habits is one of the hardest th=
ings to fight against.<br><br>I think on the contrary that one should rathe=
r teach students as soon as possible that namespaces are not just here to m=
ake them type more characters, but are essential in structuring, understand=
ing and clarifying code.<br><br>On a side note, excluding "using namespace =
std;", I believe you will soon be able to achieve what you are after by jus=
t typing "using module std;".<br></div></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_791_857889453.1413399618417--

.


Author: "'Geoffrey Romer' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Wed, 15 Oct 2014 21:05:25 -0700
Raw View
--001a11c251eaaf91b70505825bd6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I agree. The whole notion of a novices-only language feature seems highly
suspect to me. I understand the idea is to make the learning curve
smoother, but to teach novices something wrong, which they will just have
to un-learn later, should be a tool of last resort. Making the language
more friendly for novices is an important goal, but let's try to focus on
features that will remain useful to them when they stop being novices (e.g.
auto and range-based for loops).

Also, what's the point of actually standardizing this header, if it's only
going to be used in throw-away code? Such code doesn't need to be portable,
and there's no need for cross-platform consistency in the stuff that you're
going to have to un-learn anyway. The pedagogical purpose seems much better
served by leaving this header to individual instructors- they are in a much
better position to choose what goes in it, and unlike the Committee, they
can change their mind the next time they teach the course. Getting the
header from the instructor will also help convey the message that these are
training wheels, not part of the bicycle.

On Oct 15, 2014 12:00 PM, <corentin.schreiber@cea.fr> wrote:
>
> Le mercredi 15 octobre 2014 15:22:02 UTC+2, Markus Grech a =C3=A9crit :
>>
>> The novice does not want nor need to deal with namespaces.
>
>
> You want to introduce this header to teaching purposes, which is a noble
cause that I totally support (don't get me wrong), but I am convinced that
throwing "using namespace std;" in here is clearly not going to help in the
long term.
>
> Suppose you do: after learning C++ for one year using this header,
somebody (you, the teacher) will one day tell the innocent student that she
has to stop using the <prelude> header, because she became a grown up
programmer. Now, she has to learn which  of the functions and types she
uses have to be prefixed with "std::", and which should not. Most likely,
she (or a fraction of her class mates) will find it annoying and end up
sticking "using namespace std;" at the beginning of each of her files
anyway. The strength of habits is one of the hardest things to fight
against.
>
> I think on the contrary that one should rather teach students as soon as
possible that namespaces are not just here to make them type more
characters, but are essential in structuring, understanding and clarifying
code.
>
> On a side note, excluding "using namespace std;", I believe you will soon
be able to achieve what you are after by just typing "using module std;".
>
> --
>
> ---
> 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/.

--=20

---=20
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 e=
mail 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-proposa=
ls/.

--001a11c251eaaf91b70505825bd6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">I agree. The whole notion of a novices-only language feature=
 seems highly suspect to me. I understand the idea is to make the learning =
curve smoother, but to teach novices something wrong, which they will just =
have to un-learn later, should be a tool of last resort. Making the languag=
e more friendly for novices is an important goal, but let&#39;s try to focu=
s on features that will remain useful to them when they stop being novices =
(e.g. auto and range-based for loops). </p>
<p dir=3D"ltr">Also, what&#39;s the point of actually standardizing this he=
ader, if it&#39;s only going to be used in throw-away code? Such code doesn=
&#39;t need to be portable, and there&#39;s no need for cross-platform cons=
istency in the stuff that you&#39;re going to have to un-learn anyway. The =
pedagogical purpose seems much better served by leaving this header to indi=
vidual instructors- they are in a much better position to choose what goes =
in it, and unlike the Committee, they can change their mind the next time t=
hey teach the course. Getting the header from the instructor will also help=
 convey the message that these are training wheels, not part of the bicycle=
..<br></p>
<p dir=3D"ltr">On Oct 15, 2014 12:00 PM, &lt;<a href=3D"mailto:corentin.sch=
reiber@cea.fr">corentin.schreiber@cea.fr</a>&gt; wrote:<br>
&gt;<br>
&gt; Le mercredi 15 octobre 2014 15:22:02 UTC+2, Markus Grech a =C3=A9crit=
=C2=A0:<br>
&gt;&gt;<br>
&gt;&gt; The novice does not want nor need to deal with namespaces.<br>
&gt;<br>
&gt;<br>
&gt; You want to introduce this header to teaching purposes, which is a nob=
le cause that I totally support (don&#39;t get me wrong), but I am convince=
d that throwing &quot;using namespace std;&quot; in here is clearly not goi=
ng to help in the long term.<br>
&gt;<br>
&gt; Suppose you do: after learning C++ for one year using this header, som=
ebody (you, the teacher) will one day tell the innocent student that she ha=
s to stop using the &lt;prelude&gt; header, because she became a grown up p=
rogrammer. Now, she has to learn which=C2=A0 of the functions and types she=
 uses have to be prefixed with &quot;std::&quot;, and which should not. Mos=
t likely, she (or a fraction of her class mates) will find it annoying and =
end up sticking &quot;using namespace std;&quot; at the beginning of each o=
f her files anyway. The strength of habits is one of the hardest things to =
fight against.<br>
&gt;<br>
&gt; I think on the contrary that one should rather teach students as soon =
as possible that namespaces are not just here to make them type more charac=
ters, but are essential in structuring, understanding and clarifying code.<=
br>
&gt;<br>
&gt; On a side note, excluding &quot;using namespace std;&quot;, I believe =
you will soon be able to achieve what you are after by just typing &quot;us=
ing module std;&quot;.<br>
&gt;<br>
&gt; -- <br>
&gt;<br>
&gt; --- <br>
&gt; You received this message because you are subscribed to the Google Gro=
ups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>
&gt; To unsubscribe from this group and stop receiving emails from it, send=
 an email to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-=
proposals+unsubscribe@isocpp.org</a>.<br>
&gt; To post to this group, send email to <a href=3D"mailto:std-proposals@i=
socpp.org">std-proposals@isocpp.org</a>.<br>
&gt; Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/g=
roup/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-propos=
als/</a>.<br>
</p>

<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 />

--001a11c251eaaf91b70505825bd6--

.


Author: =?UTF-8?Q?David_Rodr=C3=ADguez_Ibeas?= <dibeas@ieee.org>
Date: Thu, 16 Oct 2014 16:59:06 -0400
Raw View
--001a113ecb6ee35e070505908421
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

The problem with this approach is that it is a leaking abstraction. It may
seem simpler for the simplest cases, but it will become far harder to
handle once the student's code becomes a bit more complicated. For example,
consider that they decided to create a simple function and they named it
'find', one student uses a namespace for the class (he has just heard that
it is a nifty feature to avoid name clashes):

namespace c101 {
     bool find(Needle n, Haystack h);
}

while another writes the code directly in the global namespace:

bool find(Needle n, Haystack h);

In a different function, maybe inside 'find_impl' they opt to use the
standard algorithm:

//namespace c101 {
bool find_impl(Needle n, Haystack h) {
    return find(h.begin(), h.end(), n) !=3D h.end();
}
//}

At this point, try to explain to the poor guy that did the right thing by
having a namespace why the compiler hates him so much. Why, why! I can see
that other guys code and the exact same function works for him!

If you want to avoid complexity, the best you can do is avoid using
directives that bring far more complexity than namespaces by themselves.
Teach them that symbols in the standard library are prefixed by 'std::' (is
that hard to explain? how hard to explain compared with the complexity of
"you don't need std:: sometimes but sometimes you need it and this is the
set of cases where it does not matter and this is the case where it
matters")

Hiding the real properties of types for novices only means that when they
start feeling a bit less of a novice they will be hit by a complete new
reality and will have to relearn how things really are.

I am not against providing helper headers, and the 'import module std;' is
a *great* thing when it comes, but I strongly believe that making the
language feel different than what it really is does not help anyone.

    David

On Wed, Oct 15, 2014 at 9:22 AM, Markus Grech <markus.grech@gmail.com>
wrote:

> On Wednesday, October 15, 2014 2:59:06 PM UTC+2, David Rodr=C3=ADguez Ibe=
as
> wrote:
>>
>> > A rough idea is that it would include <iostream>, <vector>, <map>,
>> <string> etc. and possibly have a using namespace std.
>>
>> Please, don't even consider a using directive in a header, and much less
>> in a standard one. You might as well remove the 'std' namespace altogeth=
er.
>>
> While in general I fully agree (and i never use using-directives in
> headers either), i have to disagree here.
> The idea is that this header is for C++ novices. Advanced users should
> know their headers and not use <prelude> anymore. The novice does not wan=
t
> nor need to deal with namespaces.
> And I consider the fact that it can break code actually a good thing.
> include-all headers are generally frowned upon, advanced and expert users
> of C++ are expected to know better.
>
> --
>
> ---
> 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/.
>

--=20

---=20
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 e=
mail 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-proposa=
ls/.

--001a113ecb6ee35e070505908421
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">The problem with this approach is that it is a leaking abs=
traction. It may seem simpler for the simplest cases, but it will become fa=
r harder to handle once the student&#39;s code becomes a bit more complicat=
ed. For example, consider that they decided to create a simple function and=
 they named it &#39;find&#39;, one student uses a namespace for the class (=
he has just heard that it is a nifty feature to avoid name clashes):<br><br=
>namespace c101 {<br>=C2=A0 =C2=A0 =C2=A0bool find(Needle n, Haystack h);<b=
r>}<br><br>while another writes the code directly in the global namespace:<=
br><br>bool find(Needle n, Haystack h);<br><br>In a different function, may=
be inside &#39;find_impl&#39; they opt to use the standard algorithm:<br><b=
r>//namespace c101 {<br>bool find_impl(Needle n, Haystack h) {<br>=C2=A0 =
=C2=A0 return find(h.begin(), h.end(), n) !=3D h.end();<br>}<br>//}<br><br>=
At this point, try to explain to the poor guy that did the right thing by h=
aving a namespace why the compiler hates him so much. Why, why! I can see t=
hat other guys code and the exact same function works for him!<br><br>If yo=
u want to avoid complexity, the best you can do is avoid using directives t=
hat bring far more complexity than namespaces by themselves. Teach them tha=
t symbols in the standard library are prefixed by &#39;std::&#39; (is that =
hard to explain? how hard to explain compared with the complexity of &quot;=
you don&#39;t need std:: sometimes but sometimes you need it and this is th=
e set of cases where it does not matter and this is the case where it matte=
rs&quot;)<br><br>Hiding the real properties of types for novices only means=
 that when they start feeling a bit less of a novice they will be hit by a =
complete new reality and will have to relearn how things really are.<br><br=
>I am not against providing helper headers, and the &#39;import module std;=
&#39; is a *great* thing when it comes, but I strongly believe that making =
the language feel different than what it really is does not help anyone.<br=
><br>=C2=A0 =C2=A0 David</div><div class=3D"gmail_extra"><br><div class=3D"=
gmail_quote">On Wed, Oct 15, 2014 at 9:22 AM, Markus Grech <span dir=3D"ltr=
">&lt;<a href=3D"mailto:markus.grech@gmail.com" target=3D"_blank">markus.gr=
ech@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
dir=3D"ltr"><span class=3D"">On Wednesday, October 15, 2014 2:59:06 PM UTC+=
2, David Rodr=C3=ADguez Ibeas 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"><span style=3D"font-size:13px;font-family:arial,sans-seri=
f">&gt;=C2=A0</span><span style=3D"font-size:13px;font-family:arial,sans-se=
rif">A rough idea is that it would include &lt;iostream&gt;, &lt;vector&gt;=
, &lt;map&gt;, &lt;string&gt; etc. and possibly have a using namespace std.=
</span><div><br></div><div>Please, don&#39;t even consider a using directiv=
e in a header, and much less in a standard one. You might as well remove th=
e &#39;std&#39; namespace altogether.</div></div></blockquote></span><div>W=
hile in general I fully agree (and i never use using-directives in headers =
either), i have to disagree here.</div><div>The idea is that this header is=
 for C++ novices. Advanced users should know their headers and not use &lt;=
prelude&gt; anymore. The novice does not want nor need to deal with namespa=
ces.</div><div>And I consider the fact that it can break code actually a go=
od thing. include-all headers are generally frowned upon, advanced and expe=
rt users of C++ are expected to know better.</div></div><div class=3D"HOEnZ=
b"><div class=3D"h5">

<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" 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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--001a113ecb6ee35e070505908421--

.