
An Interview with C++ Creator Bjarne Stroustrup - jseliger
http://www.codeguru.com/cpp/misc/print.php/c18357/An-Interview-with-C-Creator-Bjarne-Stroustrup.htm
======
Sniffnoy
> I declared p without explicitly mentioning the type of p. Instead, I used
> auto, which means "use the type of the initializer." So p is a
> vector<pair<string,int>>::iterator. That saves a fair bit of typing and
> removes the possibility of a few kinds of bugs. This is the oldest C++0x
> feature; I implemented it in 1983, but was forced to take it out for C
> compatibility reasons.

I don't understand this. Yes, "auto" is a reserved word in C... but couldn't
Strostrup just have named it something else?

~~~
jemfinch
Using auto means 100% compatibility with existing C++ code. Using some other
name would potentially require updates to existing code, which is bad.

------
ghenne
Here's another copy of the 'interview' with a reply from Bjarne...
<http://www.nsbasic.com/app/info/interview.htm>

------
iwwr
The ISO body is needlessly large and hugely bureaucratic, we could have had a
better c++ years before with a more effective standards body (ECMA?).

~~~
bane
Oh my, if that isn't the truth. Looking through this list, some of the new
features are embarrassing to be honest (and a good reminder why I'm not a C++
dev anymore).

"A regular expression standard library component"

"Hashed containers"

"The local struct is_key is used as a template argument type. Maybe you didn't
even notice, but that was not allowed in C++98."

"I declared p without explicitly mentioning the type of p. Instead, I used
auto, which means "use the type of the initializer." So p is a
vector<pair<string,int>>::iterator. That saves a fair bit of typing and
removes the possibility of a few kinds of bugs. This is the oldest C++0x
feature; I implemented it in 1983, but was forced to take it out for C
compatibility reasons."

...and suddenly I'm back in 1999, writing my own version of all of these in
some form or another because they aren't language/standard library features
and are so bleedingly obvious I literally sat there banging my head against
the desk wondering why I was wasting my time doing this. C++ is like a time
machine these days -- overcome by uncountable revolutions in language, slowly
plodding it's way to standard (and expected) features the rest of the world
has been enjoying for decades.

------
Stormbringer
I prefer this 'interview':

[http://www.oceanwave.com/technical-
resources/humor/c++-hoax....](http://www.oceanwave.com/technical-
resources/humor/c++-hoax.html)

:D

(In the proper article) The first improvement he mentions, being able to end
the template with >> instead of > > is of course because of potential clashes
with the >> operator. This reminds me how much I despise C++ templates.

I used to read Dr Dobb's journal(?) in the late 90s and I remember this long
running discussion about creating a generic pointer with templates. Every
issue someone would point out the subtle faults with the previous attempt and
then make a brilliant improvement... repeat ad nauseam. I don't know if they
ever got one that actually worked with no bugs.

I also remember the enormous screaming matches over adding generics to Java.
Fundamentally the problem was that there wasn't any way to vote no. That
showed that the JCP was broken long before Apache tossed their toys out of the
cot.

~~~
jemfinch
C++ templates are great. It's the almost-templates that cause so much trouble.

The late 90s was not a good decade for C++. Regardless, today I can write a
general, reference-counting pointer off the cuff in about 50 lines of code and
it will work for any type. I had to do exactly that for a school project where
we couldn't use boost, actually :)

