[TUHS] // comment in C++

Tony Finch dot at dotat.at
Thu Feb 9 23:11:27 AEST 2017


Paul McJones <paul at mcjones.org> wrote:

> > I'm fairly certain it was originally in BCPL.
> >
> > You could just drop a note to Bjarne Stroustrup and ask. :-)
>
> On page 44 of _The Design and Evolution of C++_ (Addison-Wesley, 1994),
> Stroustrup says:
>
> “However, only C, Simula, Algol68, an in one case BCPL left noticeable
> traces in C++ as released in 1985. Simula gave classes, Algol68
> operating overloading, references, and the ability to declare variables
> anywhere in a block, and BCPL gave // comments.”
>
> He says a bit more about // comments on page 93, including an example of
> how they introduced an incompatibility with C.

There's more in Stroustrup's paper for the second History of Programming
Languages conference, http://www.stroustrup.com/hopl2.pdf

See especially the prehistory section 2.1 on page 3 where he talks about
the painful tooling he was faced with in Cambridge, where Simula was nice
for program design but had a woefully slow implementation, whereas BCPL
was fast but grievously unsafe.

The quote above is repeated in the HOPL2 paper on page 12 in section 2.4.4
on "Why C?" and there's a bit more about comment syntax in section 3.3.1
on page 21.

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/  -  I xn--zr8h punycode
Wight, Portland: East or northeast 4 or 5, increasing 6 at times. Slight or
moderate, occasionally rough in Portland. Showers. Moderate or good.


More information about the TUHS mailing list