7 ms·
The C++ Programming Language (4th Edition)
- jason_slack 13y agoI already pre-ordered my copy via Amazon. I love how Stroustrup writes his books. Concise.
- tekacs 13y agoNow if only he would take that conciseness across to his programming language design. :P (I kid, I kid... please don't hurt me?)
- twoodfin 13y agoHey 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.
- adamnemecek 13y ago>> much more concise, elegant code compared with other C++ code that is :-).
- kostya-kow 13y agoIt 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.
- untitledwiz 13y agoHands down funniest comment on HN!!! :D
- ternaryoperator 13y ago>I love how Stroustrup writes his books. Concise. Amazon states it's 1368 pages.
- pjmlp 13y agoHow big are the Java or C# reference, including their libraries?
- ternaryoperator 13y agoWhat's the relevance to Stroustrup being concise?
- pjmlp 13y agoThat they are much bigger than C++, hence Bjarne is being concise.
- danbruc 13y agoC# 2.0/ECMA-334 4th edition [1] is specified on 553 pages - Microsoft did not submit later versions. The underlying virtual machine, the common type system, the assembly language and so on are specified in ECMA-335 6th edition [2] on 574 pages supplemented with 161,593 lines of XML (plus 155 lines DTD) specifying the base class library. TR/84 [3] provides tools to generate documentation in various formats from the mentioned XML file. The included output as PDF sums up to 5,868 pages. Finally there is TR/89 [4] describing some more generic types on 67 pages. [1] http://www.ecma-international.org/publications/standards/Ecma-334.htm http://www.ecma-international.org/publications/standards/Ecm... [2] http://www.ecma-international.org/publications/standards/Ecma-335.htm http://www.ecma-international.org/publications/standards/Ecm... [3] http://www.ecma-international.org/publications/techreports/E-TR-084.htm http://www.ecma-international.org/publications/techreports/E... [4] http://www.ecma-international.org/publications/techreports/E-TR-089.htm http://www.ecma-international.org/publications/techreports/E...
- L0j1k 13y agoYAY!! I preordered months ago. Can't wait!
- bokglobule 13y agoIf 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..
- comex 13y agofor the record, const const * is redundant. I think const is only so confusing because you can write it two different ways (char const * vs. const char *); if only the former was allowed, it would seem a lot more logical.
- n00b101 13y agoint* - pointer to int. int const * - pointer to const int. int * const - const pointer to int. int const * const - const pointer to const int. Is that so hard? Those people posting here who think that THIS is the hardest problem in computing should perhaps find a new line of work.
- comex 13y agoExactly: if 'int const * ' were common, it would be relatively clear that const goes after the type of the thing that is const - but the overwhelming use of the alternate form, 'const int *', makes it more confusing what to do.
- girvo 13y agoI'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
- adamnemecek 13y agohttps://github.com/id-Software/Quake-III-Arena https://github.com/id-Software/Quake-III-Arena
- glurgh 13y agoThat's C, not C++
- adamnemecek 13y agoIf he's interested in overall architectural structure, there isn't all that much difference.
- glurgh 13y agoHe seems to be specifically interested in that, done in C++, while learning C++. The code of the various id games is definitely worth looking at - starting with Fabien Sanglard's code reviews is probably more informative than the raw github dump http://fabiensanglard.net/quake3/index.php http://fabiensanglard.net/quake3/index.php Still, it's not C++. If the goal is C++ sending someone there is akin to suggesting someone interested in studying classic English novels ought to read Les Misérables in French instead of David Copperfield.
- slackpad 13y agoOh sweet - the code examples are no longer in italics. That drove me crazy with the earlier editions.
- sramsay 13y agoWhat 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.
- jamesaguilar 13y agoAt least it's the sort of mountain peak where you can initialize user data types with {} and use closures like every other language in existence. It's a much better peak than it was three years ago.
- aparticulate 13y agoIt looks like a Scientology pamphlet.
- sramsay 13y agoThe Modern Science of Mental Health!
- pootch 13y agoI was thinking more like a picture of a saint bernard taking a dump
- n00b101 13y agoHow 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).
- deleted 13y ago[deleted]
- rbehrends 13y agoThe 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-software-dod-operation-test-evaluation-director-not-impressed http://spectrum.ieee.org/riskfactor/aerospace/military/f35-s... [2] http://www.nextgov.com/defense/2013/03/f-35-joint-strike-fighter-not-ready-combat-until-least-2019-gao-says/61832/ http://www.nextgov.com/defense/2013/03/f-35-joint-strike-fig...
- digikata 13y agoThis 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...
- dionidium 13y agoI 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.
- hackerpolicy 13y agoIs his C+11 FAQ enough if I've read the third edition?
- SupremumLimit 13y agoNot really. The FAQ only provides a high level overview of the new features, and it isn't complete.
- deleted 13y ago[deleted]
- cageface 13y agoI 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 13y agoI 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.
- WalterBright 13y agoI don't really understand your post. You criticized D for having more features than C++, and Go for having fewer.
- minamea 13y agoThat's exactly how I feel, I guess. D seems to have a lot more features (import, public import, and static import?) and I'm no expert but I feel some aren't all that necessary/add enough value. Go has fewer than C++, which I think is really good, except for some few ones that I wish were there. Only generic programming/templates off the top of my head actually.
- zura 13y agoAnd exceptions, or any other way to better handle error conditions, rather than that "if hell".
- 13y ago
- laurentoget 13y agoConsidering the expected audience for this book, isn't the $75 sticker price some form of racketeering?
- n00b101 13y agoThe 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"
- camus 13y agoso according to you everybody not using C++ is a hipster ... right ?
- laurentoget 13y agoI 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.
- sramsay 13y agoWake me up when there's a 3rd edition of The C Programming Language.
- akadien 13y agoI 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.
- pfedor 13y agoI 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 13y agoI 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.
- gurkendoktor 13y agoThat is how I've ended up using his book, but what is the appeal of a heavy, printed reference manual? I could only make sense of the idioms and patterns in C++ by reading the Guru of the Week articles at the same time: http://gotw.ca/gotw/index.htm http://gotw.ca/gotw/index.htm It didn't click at all while using Stroustrup's book, even when I did the exercises.
- danieldk 13y agoActually, I like Brokken's C++ annotations far more as a reference: http://www.icce.rug.nl/documents/cplusplus/ http://www.icce.rug.nl/documents/cplusplus/ It's written more lively and opinionated. Also, it's apt-gettable on Debian and Ubuntu :).
- pootch 13y agoIntroduction: The worst invention since LISP is a serious contender for overdriving specious "features" of OO that noone needs or can even comprehend a use for, while remaining firmly grounded in C since you will need it because without C how could one possibly make such an abomination as C++?
- Svip 13y agoStill 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 13y agoYup. 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 13y agoWhat exactly are smart pointers?
- tonyedgecombe 13y agoPointers that clean up when they go out of scope or a reference count reaches zero.
- deleted 13y ago[deleted]
- pjmlp 13y agoLooking forward to buy it.
- pkrumins 13y agoYES!