

The C++ Programming Language (4th Edition) - lispython
http://www.stroustrup.com/4th.html

======
sramsay
What sort of cover art should we use for the book?

How about a snow-capped mountain peak? You know, the kind of mountain peak
where people die either for lack of oxygen, or because crevasses open randomly
across the landscape. The kind of mountain where you might go blind if you
take off your sunglasses.

That kind of place.

~~~
n00b101
How about a picture of an F35 fighter jet? Because a fighter jet goes much
faster than [insert your preferred hipster language]? Or, you know, the F35
uses C++ code (and not Python/Clojure/LISP/PHP/Ruby/whatever).

~~~
rbehrends
The F-35 is about embedded software, i.e. it's about C/C++ vs. Ada, not C/C++
vs. Python. The reason they didn't go with Ada was a lack of programmers, not
language design issues, as I recall.

In any event, I don't think the F-35 with its numerous software-related
problems [1, 2] is a good advertisement for C++.

[1]
[http://spectrum.ieee.org/riskfactor/aerospace/military/f35-s...](http://spectrum.ieee.org/riskfactor/aerospace/military/f35-software-
dod-operation-test-evaluation-director-not-impressed)

[2] [http://www.nextgov.com/defense/2013/03/f-35-joint-strike-
fig...](http://www.nextgov.com/defense/2013/03/f-35-joint-strike-fighter-not-
ready-combat-until-least-2019-gao-says/61832/)

------
cageface
I expect to see all the usual writeoffs of C++ here. And, to be sure, it's an
easy language to criticize. But, for better or for worse, it's still the only
reasonable choice for a lot of very interesting application domains. And a lot
of its less elegant features make more sense when you think carefully about
the specific design goals for the language.

I'd love to be able to write my DSP code in cleaner, simpler language but for
now I'm happy that I have a tool that lets me build the software I care about.

~~~
minamea
I think that's true, but it's also sad. I've looked at D and it's criticism
seems reasonable to me: it actually seems to have _more_ features than C++.

I really hope Go catches on more and fixes some of the (imho) bad things about
it (like lack of generic programming). And then C++ won't be the _only_ option
anymore.

~~~
fauigerzigerk
Go is nice but it's a replacement for Java or Python not for C++. I'm working
on an in-memory analytics engine, something that has only become affordable in
recent years because memory prices have fallen so much.

In-memory computing is a very important trend and garbage collected languages
just don't work. You can't have the system stall for seconds or even tens of
seconds unless it's purely a batch workload.

I have to admit that I haven't really researched what can be done in Go to
keep in-memory data off-heap so the garbage collector doesn't see it. I have
done that research for Java and it's unworkable. It's either slow or extremely
unproductive to work with or both.

~~~
minamea
Are garbage collection pauses really a concern? You're still running atop a
multitasking operating system with all kinds of pauses.

~~~
fauigerzigerk
Garbage collection pauses are a huge concern with larger heap sizes. Depending
on the application it may be OK to make a user wait for a second or two, but
not for 30 seconds. Multitasking doesn't cause that kind of lag usually.

It's even more problematic for some types of trading systems or stream
processing of sensor data, etc.

All the trends are working against garbage collection right now. Memory sizes
are growing and we're moving away from batch processing for many workloads.

------
girvo
I've recently started learning C++ again to get into game programming.
Initially I was learning Flash/AS3 based engines, as I used to be quite a
great AS2 programmer back in the day.

I want to learn to create cross-platform games, but want to get in the guts a
bit more than, say, Unity lets you. So, C++ is what I decided on.

It's a beast of a language, I'll tell you that much, but it's actually really
quite enjoyable to program in! It was the first real language I tried to learn
when I was 12 years old. I got as far as making a text game with `switch'
statements ;)

Definitely going to order this one I think. Coming from an ALGOL-derived
language background for the most part, having something like this as a
reference will be brilliant, and a good addition to go with my `Pro C++' book
(handles architecture and idioms more than the language itself per se, but
does cover some advanced features).

The only thing I wish I could find was a reference on how games are actually
_built_: what development patterns, what tools I'll need to write, etc. All I
can find are low-level OpenGL based things for writing engines, or fluffy
"Design a Game!" crap. *sigh

~~~
mkilling
Game Coding Complete: [http://www.amazon.com/Game-Coding-Complete-Fourth-
ebook/dp/B...](http://www.amazon.com/Game-Coding-Complete-Fourth-
ebook/dp/B00B7RE4GQ/)

~~~
girvo
Holy crap, that's perfect. Thanks so much! You don't have a refferal link by
any chance, I'd love to make sure you get something for a rec like that: i've
been looking for something like this for weeks now!

~~~
mkilling
No referral link - just glad I could help ;-)

------
bokglobule
If Bjarne had been able to keep C++ his own creation instead of letting the
"standards" people come in and take the thing over, C++ might have avoided
becoming the over-designed language its become. Anyone recall the differences
between [const const {star}], [const {star} const], etc ?

Language design has come a long way since the early 80's. His concerns back
then were a programming language that would retain the performance of 'C' on
most hardware and be straightforward to generate from 'C' code due to re-use
of the 'C' syntax (the early C++ systems relied on converters that translated
C++ to 'C'). Over time compilers were created to generate machine code
straight from C++. When 4k was a lot of RAM, it made sense to focus on this;
it still does if you're developing embedded software with very limited
hardware. (FWIW, I've written software in C++ since 1990).

I'd argue hard that today, in most cases, and in particular in web
applications, the issue is developer productivity. Today we're focusing more
on expressing solutions in code that are much closer to the way that we think.
Whether it's Ruby, F#, Scala, or Javascript, the tools we're using allow for
more powerful solutions in far less code and complexity than C++.

Let the flames begin..

~~~
dorolow
Some developers need tools that offer better performance than the languages
you enumerated. Not that I have anything against those languages or more
abstract languages in general. Quite the contrary, if it was up to me we'd all
be writing lisp. Outside of serving as a prototyping tool, a role that Python
and Matlab admittedly fill pretty well, I don't believe using Javascript or
Ruby or any other (interpreted/high level/more abstract) language would bring
much to the problem domain I do most of my work in, realtime computer vision.

It may be a shock to some on HN, but there are other applications for
computing than web development. I doubt Scala is going to be penetrating
triple-A game development any time soon, although I do think it's neat that
Javascript has become popular for game UI work. I really like that C#/Unity is
going strong and I'm really itching to do something cool with WebGL, asm.js,
and/or emscripten.

But despite all the progress these languages have made, some problems still
haven't been overcome and it's disingenuous to imply that they have. I doubt
many would make the argument that C++ is suitable for web development, and I
would expect most people to realize that native code still has its place, at
least for now. The day I can use Python, Ruby, F#, Haskell, Erlang, or
something cool, I will officially be the happiest person on the planet. It
hasn't happened yet. Maybe Rust (oh yes) or Go will set everyone free.

With all that being said, C++11 is a very welcome addition to the language.
While adding more bulk to the language, it ends up reducing the complexity of
your code. Auto and decltype have been fantastic for eliminating redundant
typing info and boilerplate by making code more generic. Smart pointers,
unique_ptr particularly, have been great. For Lambda functions combined with
STL algorithms like for_each have eliminated a substantial amount of code on
their own. Move semantics have had the effect of reducing the amount of line
noise by reducing the frequency of seeing things typed const& and the double
whammy of bringing performance gains for little or no effort in many cases. I
don't think anyone can deny that C++ is a bit heavier than any language ought
to be, but it's what we have and I'll welcome any attempt to make my life
easier.

Software and programming languages are not zero sum. The use and existence of
C++ doesn't preclude the existence or use of another language. Don't try to
convince yourself and others that all problems are nails just because you
really like hammers.

edit: for the record, I mostly do Python and Clojure outside of work when I'm
not doing something graphics oriented

~~~
n00b101
> I would expect most people to realize that native code still has its place,
> at least for now.

Native code has always had a place and will always have a place. New
applications will be written in C++, 20 years from now, when all the
inefficient, fadish languages (and the inconsequential websites that they
power) have long been forgotten.

~~~
pjmlp
Any language can be native, it is just a matter of providing a native code
compiler implementation for it.

------
pfedor
I like C++, I think I know it reasonably well, I've been programming in C++
full time for the last 10 years.

I never managed to warm up to Stroustrup's book. I've tried reading it a
couple of times. It feels like a schlep. There are many great books on C++.
Koenig and Moo, Josuttis, "Effective C++", they all convey the technical
information and at the same time read like page turners. I only read fragments
of "Thinking in C++" but I think it's in the same category, it reads great.
Some of them will no doubt have new editions, updated for C++11. So, not that
there's anything wrong with Stroustrup's book, but it just can't compete. Much
as I'm looking forward to reading a book on C++11 the language--there already
exists an excellent one on the standard library, which is the new edition of
Josuttis--it will not be "The C++ Programming Language", 4th edition.

~~~
n00b101
I think of Stroustrup's book as a reference manual. It is very comprehensive
in covering the standard. Fact is that you don't learn to program by reading
books any more than you learn to play a sport by reading books.

~~~
danieldk
Actually, I like Brokken's C++ annotations far more as a reference:

<http://www.icce.rug.nl/documents/cplusplus/>

It's written more lively and opinionated. Also, it's apt-gettable on Debian
and Ubuntu :).

------
dionidium
I have the first edition of this book here on my desk. It's 328 pages
(including the index). Amazon says the 4th edition will be 1368 pages.

I don't really have a point, I guess. I haven't tracked C++ in many years and
was just surprised at such a large difference.

------
Svip
Still can't overload the semicolon operator. I asked Stroustrup about this
critical feature lack in C++, and he admitted that he simply forgot.
Embarrassing!

~~~
demallien
Yup. The day I discovered "smart" pointers was the day I vowed to never use
C++ again. I mean this is a language that touts being close to the metal as an
advantage, and then it allows you to create something that looks like a
pointer but doesn't fit into the space for a pointer. Genius...

I'll take C any day of the week, and if I need some higher level features,
I'll either write a precompiler that can parse my higher level features before
generating C code, or I'll write a bindings generator to connect to
Javascript/Ruby (I've used both options successfully in the past).

~~~
kamaal
What exactly are smart pointers?

~~~
tonyedgecombe
Pointers that clean up when they go out of scope or a reference count reaches
zero.

------
slackpad
Oh sweet - the code examples are no longer in italics. That drove me crazy
with the earlier editions.

~~~
rtpg
I loved that so much. It made it feel nice.

Anyone know how different the book is from the previous edition (minus the
obvious C++11 stuff)

~~~
zura
Yup, I was even searching what font that was... interesting to see how it will
be in my editor. Any hints/links appreciated.

------
laurentoget
Considering the expected audience for this book, isn't the $75 sticker price
some form of racketeering?

~~~
n00b101
The expected audience for this book are hard-core hackers who work on
important systems, are paid accordingly and can probably expense it on their
corporate AMEX. So no, I don't think $75 is unreasonable. Maybe you're
thinking of "Scala for Social Media Hipsters Trying to Code a Startup on a
$10,000 YCombinator budget"

~~~
laurentoget
I was more thinking of the indian, malaysian or chinese college student who
wants to work on important system and for which $75 is a fortune.

------
digikata
This would really benefit from being an ebook - for years I had the 3rd
edition with hanging sheets of errata folded into the back (ahh wait, I still
have that edition...) . I'd soo much rather get an email with a note that a
new correction was available for download...

------
sramsay
Wake me up when there's a 3rd edition of _The C Programming Language_.

~~~
akadien
I write ANSI C for a living, and I still learn new tricks and insights from
the second edition. In fact, many of the neatest ways we use C are things that
we learned from references published the 1980s and early 1990s.

------
jason_slack
I already pre-ordered my copy via Amazon. I love how Stroustrup writes his
books. Concise.

~~~
tekacs
Now _if only_ he would take that conciseness across to his programming
language design. :P

(I kid, I kid... please don't hurt me?)

~~~
twoodfin
Hey what do you think "auto" is for?

It's true that it's hard to shrink a language, but several of C++'s new
features are designed to make modern designs expressible in much more concise,
elegant code.

~~~
kostya-kow
It doesn't really "shrink" the language. It adds a level of abstraction. But
the problem is that it doesn't really implement the abstraction very well. The
complexity doesn't go away, you still have all
std::vector<std::ostream::operator<<std::iterator<T><2<std::bla_bla>>>>
underneath, and if you make a small error in the code, compiler will still
spit out an incomprehensible error message.

------
hackerpolicy
Is his C+11 FAQ enough if I've read the third edition?

~~~
SupremumLimit
Not really. The FAQ only provides a high level overview of the new features,
and it isn't complete.

------
pjmlp
Looking forward to buy it.

------
pkrumins
YES!

------
L0j1k
YAY!! I preordered months ago. Can't wait!

