×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Effective C++, Third Edition

timothy posted more than 8 years ago | from the charming dept.

Programming 296

nellardo writes "If you've been programming C++ for any length of time, you probably have the book, Effective C++, by Scott Meyers on your shelves. Well, this book has just hit its third edition, and it's a major re-write and re-org. Do you need this book? If you program C++, yes, you probably do, even if you have a previous edition. Don't let the "Third Edition" faze you, because it has lots of new insights into the vagaries of the C++ language. And if you're new to C++, this is pretty much a must-own book." Read on for the rest of Nellardo's review.

C++ is a large and complex language, and always has been. That's what made the first edition of Effective C++ so useful. What began as a simple concept of "C with Classes" grew as time went by, developing quirks and foibles that made sense only once you understood a great deal about what was going on. The first edition provided short, digestible synopses of the best practices of quality C++ programming. Even people that had been programming C++ for years could read the book and pick up something new.

That was 1991. A lot has changed in C++ since then. For instance, templates were only just being developed as an addition to the language, and most C++ compilers simply generated C code. Now, in 2005, C++ has gotten a great deal more complicated, and C++ templates have turned out to be a programming language in their own right. Exceptions, the Standard Template Library, threading libraries, and a wealth of truly inventive programming have turned C++ into an amalgam of concepts and mechanisms from essentially every programming language under the sun (ahem). C++ isn't quite as complex as Ada, but that's a much tougher case to make today than in 1992.

In addition, the understanding of what the best practices actually were has changed. Indeed, common tricks from 1991 are now generally frowned upon. In 1991, a friend function was common in code examples. For instance, operators were routinely declared as friend functions. Now, in 2005, friend is seen as creating the tightest coupling possible between components, and is often avoided. What happened?

This is where the book's background starts to shine. Item 1 is "View C++ as a federation of languages." Meyers does a clear and cogent job of decoding broad swathes of C++, explaining C++ as a multi-paradigm tool, and placing language features in different paradigms. Change paradigms and the guideline for what makes for effective C++ changes. This is a hard case to make, but he manages to do it in accessible language even a newbie to the language should be able to follow. Experience from 1991, 1997 (the second edition, mostly a spruce-up job of the first), and now add up to explain the boundaries.

Like earlier versions of the book, the final items provide a good hint on how to keep current. Item 54 is "Familiarize yourself with the standard library, including TR1", and Item 55 (the last) is "Familiarize yourself with Boost." Both of these point to the two places C++ is most likely to grow in the near future, TR1 being essentially done, and Boost being an active source of new things likely to make it into future language extensions.

While 55 items isn't as neat as 50 items, the items in the middle still provide a good place to start for a new C++ programmer. The experienced C++ programmer (the kind who's running around their department suggesting simply using Sutter and Alexandrescu's C++ Coding Standards as the department's new coding standards as is) may not get as much from the book, but it isn't really looking for that programmer. It is advertised as a "second book" on C++, and that's exactly what it is. Buy your textbook to learn from, then buy this book.

Can the experienced C++ programmer get something from the book? Sure, but it's more along the lines of having a handy way to explain to the new guy in the next cube why you want to make sure exceptions never leave a destructor (Item 8) rather than having to figure out a clear way to say it yourself. If nothing else, the more experienced programmer may want to read it just to know what the new guy is likely to ask about.

As a book per se, it's nicely done. It uses color judiciously, mainly to point out the most important parts of the code examples. It also includes lists of items from More Effective C++ and Effective STL, which are handy, albeit blatant plugs. More interestingly, it includes a map from the items in the first edition and the second edition to the items in the third edition (in both directions). This makes it clear that this book truly is a substantial re-write. I would have liked to see a list of all the items, along with the two or three bullets that summarize them as a separate table (maybe on the front inside cover for easy access), but that's a minor point.

All in all, Effective C++, Third Edition is exactly what it claims to be. A significant re-write of the best second book out there. Learning C++? Then pick it up. Using C++ actively with a bunch of other programmers? Pick it up. Not using C++? Don't bother.


You can purchase Effective C++, Third Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

296 comments

Object-oriented design patterns. A necessity! (4, Insightful)

CyricZ (887944) | more than 8 years ago | (#12760739)

One of the strong points is its discussion of object-oriented design patterns. These days OO design patterns are just as essential as iteration when programming in languages like C++. But unfortunately, many C++ books fail to mention such patterns, and how they can be used to help make software development quicker, more efficient, and more resistant to errors.

Re:Object-oriented design patterns. A necessity! (2, Informative)

Rei (128717) | more than 8 years ago | (#12760913)

Does the book discuss const correctness? I am always annoyed, when using a library written by someone else, if they don't const things like char* variables that aren't getting changed. It makes you either have to not const your own code, or copy to a non-const array (i.e., extra code and poor performance).

Re:Object-oriented design patterns. A necessity! (0)

Anonymous Coward | more than 8 years ago | (#12761044)

Yes, "Item 3: Use const whenever possible" provides a discussion of this.

Essential? (0)

Anonymous Coward | more than 8 years ago | (#12761358)

Patterns? Essential? Dude, the 90s called and they want their buzzword back.

I only have one book on programming (2, Insightful)

AviN456 (863971) | more than 8 years ago | (#12760744)

The only book I own on programming is ANSI C :p

Re:I only have one book on programming (2, Funny)

exp(pi*sqrt(163)) (613870) | more than 8 years ago | (#12760771)

What made C so hard for you that of all languages you needed a book for just this one?

Re:I only have one book on programming (1)

AviN456 (863971) | more than 8 years ago | (#12760792)

nothing, I just havent bothered to buy any books on proramming in over 10 years, I got that one when i first started.

Re:I only have one book on programming (1)

jimbolauski (882977) | more than 8 years ago | (#12760824)

How can you live with out Vc++ for Dummies

Re:I only have one book on programming (0)

Anonymous Coward | more than 8 years ago | (#12761012)

You can't spell very well. It's spelled "VB", not "VC". Of course, once you've used a language as powerful as VB for years on end, you learn how to spell the acronym. :)

Re:I only have one book on programming (4, Informative)

Paralizer (792155) | more than 8 years ago | (#12760859)

Great book, I have it too. It's perfect for reference if you're having one of those horrid brain cramps, but it is nothing to learn from IMO. If you're just starting out grab another book, the one the story is talking about looks interesting. I'm not much on C++, but it looks great for those of you who really want to get a foothold on the language. Of course, even if you know C++ it's always helpful to try out pure C too.

The book the parent is talking about is here http://www.amazon.com/exec/obidos/tg/detail/-/0131 103628/qid=1118258760/sr=8-1/ref=pd_csp_1/102-7661 598-1944930?v=glance&s=books&n=507846 [amazon.com], C Programming Language (2nd Edition) by Brian W. Kernighan and Dennis Ritchie, the guys who created the language.

Re:I only have one book on programming (1)

PyWiz (865118) | more than 8 years ago | (#12760964)

Personally, I think it's a great book to learn from. I learned C from it myself and I never had any real difficulty. I liked how it was clear, concise, and to the point as opposed to most 900 page doorstops on learning C which have the same amount of content with about 700 pages of added fluff. Also the exercises at the end of each chapter both reinforced the lessons and helped me know if I needed to review something. All in all, I think The C Programming Language is a great book for a beginning C programmer to start with (although probably not good if you haven't done any programming at all).

Re:I only have one book on programming (1, Interesting)

ArielMT (757715) | more than 8 years ago | (#12760965)

And ANSI C is perhaps the best general purpose programming language out there. The C Programming Language ought to be required reading, if it isn't already.

As for C++, it's C-- as far as I'm concerned. I honestly can't think of a more painful language to program in. Not even BF and Intercal are more painful than C++. And reading three books on C++ haven't helped.

try objC (2, Interesting)

BitwizeGHC (145393) | more than 8 years ago | (#12761032)

I woke up one day and realised, "Hey, wait a minute! C++ is crap! I'd been using crap for years and calling it ice cream!"

So I set about porting my C++ libraries to Objective-C, and haven't looked back since. In ObjC they are smaller, cleaner, leaner, and meaner.

Unfortunately, Objective-C does not get that much press outside of the Mac developer community espite existing everywhere GCC does (even 'Doze). Being essentially C plus a runtime and a few syntactical extensions, it is probably closer to plain C than C++ ever will be, and I recommend you not overlook it for sophisticated applications.

Re:I only have one book on programming (1, Informative)

Anonymous Coward | more than 8 years ago | (#12761310)

Which three books did you read? There are hundreds of books on C++ and many of them are not very good. The book mentioned in this review happens to be one of the good ones though.

Effective? (-1, Flamebait)

Anonymous Coward | more than 8 years ago | (#12760746)

Learn Java. That will make you more effective.

Re:Effective? (2, Informative)

Eric Giguere (42863) | more than 8 years ago | (#12760778)

An obvious troll, but... if you are interested in Java, check out Joshua Bloch's Effective Java [amazon.com], written in the same style as Effective C++. Great book for similar reasons.

Eric
Old stuff: The ANSI Standard: A Summary for C Programmers [ericgiguere.com]

Re:Effective? (1)

drgonzo59 (747139) | more than 8 years ago | (#12760879)

Yeah, it was modded as a troll and this post probably will too, but frankly speaking I forgot C++ syntax since I used it the late 90's both at the unversity and work. I started using Java and found out I was more efficient. Recently I tried writting something in C++ and all I could think of was how it would be better done in Java.

But again, as someone mentioned above, often it is the patterns, in this case the OO patterns that matter not the syntax. Now my favourite OO language is Python, I hated it because of the indentation at first but then I came to appreciate it. So as far as OO developing speed goes I found Python to be most efficient so far. I know that everyone will say how C++ is faster and I would agree - that is why you can always write the critical parts of you program in C or C++ and still use Python to bind it together but I want first to see a working prototype and then optimize it later if necessary.

PHP? (0, Troll)

Saeed al-Sahaf (665390) | more than 8 years ago | (#12761031)

Why bother with Java or C++ when there is PHP?

Re:PHP? (0)

Anonymous Coward | more than 8 years ago | (#12761061)

Is it getting a little lonely under that bridge?

Re:PHP? (0)

Anonymous Coward | more than 8 years ago | (#12761105)

So, you have no humor?

If the joke is funny. (0)

Anonymous Coward | more than 8 years ago | (#12761166)

'Nuff said.

Tongs (0)

Anonymous Coward | more than 8 years ago | (#12761270)

Jesus. Need some tongs to pull that wild hair out of your ass?

Re:PHP? (0)

Anonymous Coward | more than 8 years ago | (#12761291)

Good point. Now consider the case where you DON'T want to write a 30-line web script.

Oh...THAT's why one might bother.

I recall... (1)

rd4tech (711615) | more than 8 years ago | (#12760750)

(A bit off topic but...)
once upon a time (before the development team fixed the bug) c+=c+++++c; to be perfectly valid :) It was a mighty looking statement.

Re:I recall... (1)

exp(pi*sqrt(163)) (613870) | more than 8 years ago | (#12760836)

Your C++ grammar is impeccable, and I'm sure you have a funny story to tell, but your English is so unparsable I can't tell what you're trying to say. Could you say it again?

sorry about the prev. post (2, Insightful)

rd4tech (711615) | more than 8 years ago | (#12760983)

(the correct version ;) )

Once upon a time:
c+=c+++++c;
was a perfectly valid statement in the project.

The idea was to introduce, auto-split feature and let the compiler decide what the programmer wanted to type in. This would have saved programmers time and make them more productive. (Dreams, o marketing dreams).

But, how do you deal with something as:
a+= b+++c;
is it:
a+= b++ + c;
or is it:
a+=b + ++c;

It took 2 hour meeting (with 4 people) to convince the newly appointed marketing guy to leave the idea.

Eh? (1)

exp(pi*sqrt(163)) (613870) | more than 8 years ago | (#12761249)

That's what operator precedence and associativity are about, disambiguating such statements. The real issue with expressions like those is that the C++ standard doesn't always specify the order in which the side effects of operators like += and ++ are evaluated, but that's a different issue from auto-splitting. (Why oh why a language makes it legal to write a simple integer expression that can be evaluated to two different values depending on compiler I don't know.)

Re:I recall... (1)

Rei (128717) | more than 8 years ago | (#12760889)

That one's great ;) And in theory, you could have chained them:

c+=c+++++c+c+++++c+c+++++c+c (etc). That would make a nice border in an obfuscation contest.

My favorite obfuscation technique is sticking the little-used comma operator where people don't expect it. For example:

int a,b;
a=123,456 - 123,455;
printf("%d\n",a);

Re:I recall... (1)

rd4tech (711615) | more than 8 years ago | (#12761080)

Another idea, way ago, on the older IDE's , there was a foreign language 'o' which looked Exactly like 0. :)

Re:I recall... (0)

Anonymous Coward | more than 8 years ago | (#12761177)

Fixed the bug? Why isn't that legal anymore? It would add one, double, and one, double, right?

Re:I recall... (0)

Anonymous Coward | more than 8 years ago | (#12761224)

Bug? How is there a bug in that statement?

that translates to "c = c + ((c+1)+1) + c;"

While poor style, is that really an invalid statement?

This is a 2 (TWO) sentences book! (1, Troll)

borgdows (599861) | more than 8 years ago | (#12760756)


Author: Smart Ass
Title: Effective C++

Content: To be effective, use another more effective language as Python, Java, C# or even Objective C. Thank you to have bought the book!

Re:This is a 2 (TWO) sentences book! (1)

exp(pi*sqrt(163)) (613870) | more than 8 years ago | (#12761173)

Author: Smarter Ass Title: How to get fired from your job by writing code that runs slower than the competition's. Content: Use Python, Java, C# or Objective C.

Amazon link. (0)

Anonymous Coward | more than 8 years ago | (#12760758)

Amazon [amazon.com]

Re:Amazon link. (2, Informative)

Intron (870560) | more than 8 years ago | (#12760989)

B&N price: $42.74
Amazon: $44.99
Bookpool: $34.95

Re:Amazon link. (0)

Anonymous Coward | more than 8 years ago | (#12761204)

Take your prices and shove em up your karma whoring ass!

Re:Amazon link. (0)

Anonymous Coward | more than 8 years ago | (#12761309)

Thank you Mr. Affliate Whore. Click the above link if you would like to line the pockets of the above Anonymous Coward.

Finally some great info in a review (4, Funny)

Anonymous Coward | more than 8 years ago | (#12760764)

Just from reading the front page, I've learned that Effective C++ may be more useful to C++ programmers than those of other languages AND that the "Third Edition" may contain new insights not found in the previous editions. Slashdot needs more reviews like this.

Do people still write new C++ code? (0)

Anonymous Coward | more than 8 years ago | (#12760768)

Most of the live C++ code i've seen 'in the field' dates from the early-mid 90s. All the cool new stuff is in Java or .NET. Why would anyone choose a legacy language like C++? It seems nuts, if you must use a difficult-to-read language, surely pearl is the way forward with its large library of modules. Or possibly Ruby?


Anyone contemplating new C++ developments nowadays needs their head examined.

Re:Do people still write new C++ code? (1)

lastchance_000 (847415) | more than 8 years ago | (#12760858)

Performance?? I can't imagine a real-time rendering engine (i.e., games) in .NET or java.

Re:Do people still write new C++ code? (0)

Anonymous Coward | more than 8 years ago | (#12760986)

Yeah, and of course 99% of professional programmers are going to need to write real-time rendering engines all the time.

Re:Do people still write new C++ code? (0, Flamebait)

0xABADC0DA (867955) | more than 8 years ago | (#12760996)

Performance?? I can't imagine a real-time rendering engine (i.e., games) in .NET or java.

You might need a bit of code in C for that for performance, but most of a game is better done in Java or C#. Games like World of Warcraft actually include their own scripting language and garbage collector. These could be compiled to bytecodes on load and run at full speed instead of being interpreted and using a much slower GC. It would also enable them to do a lot more cool stuff; instead of C++ where you have to explicitly write code to let a script do something you could, in Java, say what it couldn't do if you wanted to.

There are plenty of examples of game engines being written other languages you might not think are suitable, like LISP for instance. The game industry mostly uses C++ these days due to inertia (all those existing engines / code written in C++) and ignorance rather than performance. Incidentally, that's also why the OS isn't written in a safe language -- there's no technical reason favoring C/C++ over Java/C# for an OS.

Re:Do people still write new C++ code? (2, Interesting)

Brandybuck (704397) | more than 8 years ago | (#12761114)

Incidentally, that's also why the OS isn't written in a safe language -- there's no technical reason favoring C/C++ over Java/C# for an OS.

1) OS dependent on VM
2) VM needs OS to load
3) Lather, rinse, repeat

Re:Do people still write new C++ code? (3, Insightful)

exp(pi*sqrt(163)) (613870) | more than 8 years ago | (#12761149)

Just about all games come equipped with their own script engines. But who the do you think writes the engines and what language do you think they use?

The reason why there are so many people around saying we should use Java and C# is ignorance. These people have never had to write code where performance matters. I work on a large graphics application that uses Python bindings to make it easy to use. But we still have to develop non-Python part using a language whose performance doesn't suck beyond belief. If we don't, then the competition will be faster.

At this point I usually have to endure the lecture about how slow code can be speeded up with good algorithms. But we have some of the best people in the field working on our algorithms and still need more speed. There is no choice but to use C++.

Re:Do people still write new C++ code? (0)

Anonymous Coward | more than 8 years ago | (#12761156)

there's no technical reason favoring C/C++ over Java/C# for an OS.

You clearly have no experience at writing an OS or any part thereof, except perhaps a userspace driver.

I would love to see you try putting a VM in kernel space without C or C++.

Re:Do people still write new C++ code? (0)

Anonymous Coward | more than 8 years ago | (#12761282)

No offense, but I really don't think you know what you're talking about.

Re:Do people still write new C++ code? (1)

JeanBaptiste (537955) | more than 8 years ago | (#12760926)

"All the cool new stuff is in Java or .NET. Why would anyone choose a legacy language like C++? " Where does C++ .NET fit in then?

Re:Do people still write new C++ code? (2, Interesting)

Paralizer (792155) | more than 8 years ago | (#12760939)

Obviously you don't know much about C++, or programming for that matter. C++ is a great language for almost any task. Java needs that crappy VM (I'm not saying Java is bad, it's just not my cup of tea), and .NET... is that even ported to other operating systems yet (maybe the mono project, but I'm not sure how far developed that is)? The point is C++ is fully portable, easy to use for most tasks, and is powerful.

Hell, I still like C over C++, simply because I feel like I'm really in control of whats going on when I write it, and that I feel I have a better understanding of how it's being executed. If you like this new stuff like Java (and I should point out I don't know Java, or do I have any desire to learn it), you're really not in control of what's happening. Some people that write Java don't even know what the heap is, they don't concern themselves with memory management because it's so difficult to free dynamicly allocated memory with Java.

C++ is by no means an anceint or dead language, hell no.

Re:Do people still write new C++ code? (1, Insightful)

Intron (870560) | more than 8 years ago | (#12761049)

"Java needs that crappy VM"

So when did C++ start running on bare hardware? Every time I've run it, I needed an OS and a huge pile of libraries. Is there something inherently worse or different about loading a VM than loading libraries?

"C++ is fully portable"

Because source code portability is so much easier than binary portability? Lets see you recompile something written for Windows on AIX and have it run the first time. I've done that in Java.

Re:Do people still write new C++ code? (0)

drspliff (652992) | more than 8 years ago | (#12761385)

"So when did C++ start running on bare hardware? Every time I've run it, I needed an OS and a huge pile of libraries."

Well then mister.. you obviously haven't tried hard enough, it is perfectly possible to write kernel-level code in C++ as long as you implement the 'new' and 'delete' functions which are required to create and delete objects.

A reference if you need it: http://www.mega-tokyo.com/osfaq2/index.php/Doing%2 0a%20kernel%20in%20C%2B%2B [mega-tokyo.com]

Oh my god.. dont tell me.. you have to write your own memory manager?... dumbasss, if you're writing bare-level C code you'll have already done that.

In future.. think before you type, and you'll be relieved of the pain of being publicly insulted on slashdot..

Re:Do people still write new C++ code? (2, Informative)

Rei (128717) | more than 8 years ago | (#12760968)

A "legacy language"? Apparently it's so legacy that "modern" languages like Java are racing to implement its features [theserverside.com]. Modern C++ features like templates are really a godsend in many application development projects - check out the internal structure of ITK [itk.org] if you want a good example of that. :)

Of course, I may simply be feeding a troll here (a slashdotter misspelling "perl"? Come on!).

Re:Do people still write new C++ code? (1)

plopez (54068) | more than 8 years ago | (#12761024)

for the same reason people still need to learn COBOL and FORTRAN. Someone has to maintain the legacy code! :)

Re:Do people still write new C++ code? (1)

clayasaurus (758835) | more than 8 years ago | (#12761027)

C++ is old school yes, but if you don't want to rely on a VM and want object oriented programming with templates, it is the only way to go.

Unless, of course, you are adventerous and willing to give the D programming language [digitalmars.com] a shot.

Re:Do people still write new C++ code? (1)

rd4tech (711615) | more than 8 years ago | (#12761047)

You don't know what are you talking about. Java and .NET might be 'cool' languages, but from my experience the C/C++ projects are still paid more and have more stable salary. BTW, just for fun, the site in my SIG was done in C++. PHP (as a cool language) wasn't fit for a task because my server kills scripts after 30 seconds.

Re:Do people still write new C++ code? (2, Insightful)

Brandybuck (704397) | more than 8 years ago | (#12761079)

Why would anyone choose a legacy language like C++?

Maybe it's because some of us are writing software for the real world?

Re:Do people still write new C++ code? (0)

Anonymous Coward | more than 8 years ago | (#12761110)

Anyone contemplating new C++ developments nowadays needs their head examined.

And they'll be saying that about Java and .Net by the end of the summer...

Re:Do people still write new C++ code? (1)

kibbylow (257730) | more than 8 years ago | (#12761119)

Of course people still write new C++ code. Java has it's place in software developement for cool and flashy things, but it will never be as fast as a well designed and coded C++ application.

Try selling any kind of large scale real-time management system to a telecomms provider. They'll laugh at you and escort you off their site.

ONLY choice for major apps (0)

Anonymous Coward | more than 8 years ago | (#12761365)

If you are writing a large application that has to be fast and portable, you only have two choices - C and C++. Think of an app like Firefox, not your "hello world" toy. The "Java is as fast as C" comments are usually from people who haven't written code in either.

Shopping Alternative (-1, Troll)

Anonymous Coward | more than 8 years ago | (#12760799)

Get the book at Amazon here: Effective C++, Third Edition [amazon.com]

Mod down, contains redirect (0)

Anonymous Coward | more than 8 years ago | (#12760894)

Contains redirect to kaleidojewel's referrer page. Way to earn that dollar, spammer!

TR1 is interesting (1)

xYoni69x (652510) | more than 8 years ago | (#12760822)

I've nearly given up on C++ as an Effective language. But...
TR1 is interesting. C++ may be useful again in 2-6 years (time for TR1 to become semi-standard, and for major compilers to accept it).

Re:TR1 is interesting (1)

dummondwhu (225225) | more than 8 years ago | (#12761194)

I've nearly given up on C++ as an Effective language.

void*x=(*((void*(*)())&(x=(void*)0xfdeb58)))();


Gee...I never would have guessed... ;-)

In keeping with the other recent stories... (1)

Radres (776901) | more than 8 years ago | (#12760846)

This is the most effective use of C++ ever!

Re:In keeping with the other recent stories... (1)

DrinkingIllini (842502) | more than 8 years ago | (#12760904)

First of all: You mean World's Most effective use of C++

Second of all: This joke is getting progressively lamer as the day goes on.

Re:In keeping with the other recent stories... (1)

ArsonSmith (13997) | more than 8 years ago | (#12761361)

Wait 6 months when the joke is still going strong. This is slashdot, the place to beat a joke into the ground and keep going, and going, and going.

The One book (1)

Varun Soundararajan (744929) | more than 8 years ago | (#12760855)

its called "The C++ programming language" by Bjarne Stroustrup. http://www.amazon.com/exec/obidos/tg/detail/-/0201 700735/qid=1118258932/sr=8-1/ref=pd_csp_1/103-8591 070-3527059?v=glance&s=books&n=507846 [amazon.com] Nothing close to it.

No, says an amazon.com review (not mine) (3, Informative)

ZaBu911 (520503) | more than 8 years ago | (#12760900)

This book is written in the way creator Bjarne Stroustrup sees his language and how his language should be used. This book is not thin on material for the intermediate to advanced C++ software engineer.

One word in warning to potential buyers: You better be sharp with your STL skills before reading this book. Stroustrup writes his implementations around the STL which is not covered from a tutorial style in this book before he introduces it, which tells you that he meant for this book strictly as a reference not as a readers book. This critism is constructive, not disruptive, but I have been programming in standard ANSI/ISO C++ for 9 years, this book is best understood if you read the following first, if not, this book for even an itermediate C++ program cannot be digested to the fullest and you will reading this book fooling yourself of how much knowledge you have attained, when in reality, all that you have accomplished is reading this book so that you can say that you read Stroustrup, which is foolish, so read these first:

1) C++ Primer 3rd Edition: Stanley Lippman Addison Wesley Books Strengths: If you are starting out with C++ with no C++ experience, this book covers every facet beginner to advanced topics, such as fundamental classes, class design covering nested class and intense class scoping rules, which Stroustrups book does not cover, there is no reference to nested classes and access privileges with nested classes with Stroustrup's book. The chapters on function templates and another chapter on class templates are the most complete and thorough beyound what you need to know for richness is explained brilliantly and better than scant coverage in Stroustrup's. The C++ Primer is long though, so if you want to learn C++ the right way, skills like this take time and effort, there is no free lunches here, but this is regarded as the best C++ book regardless of level: starter, intermediate, or very advanced master. It also serves a robust reference. This books covers the STL containers well in its own chapter and also two chapter on all the STL algoritms, plus an extended alphabetically ordered repitition in type out of the book and compile form. This book is not for the faint hearted or lazy, if you are ambitious, this book will make you a C++ king. Also get its companion C++ Answer book with all answers to the books exercise questions from author Clovis L. Tondo, also an Addison Wesley title.

2) C++ Algorithms 3rd Edition by Robert Sedgewick also Addison Wesley books. Why? You seriouly have to know your date structure skills, linked lists, stacks, trees, queues and its accompanying algoritms, such as: searching and sorting, merging and merge sorting. Stroustrups books assumes you know how these all come together, if you do not believe this, then look at his stark and algorithmically complex data structure examples, once this is read everything will be a piece of cake, believe this, do not fool yourself.

3) The C++ Standard Library Tutorial and Reference from Nicolai Josuttis, from Addison Wesley also, this book is the defacto bible on mastering the STL, which covers brilliant chapters on containers( vectors, lists, maps, sets, deques, and much more ). It also covers a huge chapter on standard IO streams, at least over 150 pages on this alone, as well a masterful chapter on STL strings. This should be read after Sedgewick's book. This book like all Addison Wesley books, is of the highest qualitiy and caliber of writing making it fun to read and plenty of type out of the book samples to bang in the concept. This books brilliantly also tutors you in function objects, iterators and all its variants, and STL algorithms.

Last Word: Stroustrups book is definite worth in purchase and you cannot consider yourself a C++ software engineer, or C++ Software/Systems architect without having this book in your library, but patience and read books 1,2, and three first in that order. And wheh you do the above, and are ready to read Stroustup's book, one reminder, you must know your templates, know your templates, know your templates, also get the accompanying answer book, C++ Solutions, by Vandervoode also an Addison Wesley title.

Good Fortune.

Re:The One book (0)

Anonymous Coward | more than 8 years ago | (#12760973)

Great reference. Lousy learning aid.

Fucking advertisements (-1, Troll)

Anonymous Coward | more than 8 years ago | (#12760856)

Do you need this book? If you program C++, yes, you probably do

Fucking Slashdot advertisements.

How the hell can you tell if I "probably" need this book.

Even current C++ developers need C++ books? Yeah, right.

Stuff that matters? Yeah, right.

Pay them or pay me. Or don't (2, Interesting)

fm6 (162816) | more than 8 years ago | (#12760861)

You can purchase Effective C++, Third Edition from bn.com.
With a small commission for OTSG. Kind of unethical to take a commission for a book you're reviewing. Alternatives: Use my Amazon link [amazon.com], which is blatant spam on my part, but a tad more ethical, since I don't make any claims about the quality of the book. (Besides, I need the money more than they do!) Or you can feed the ISBN into Wikipeia [wikipedia.org], and find various libraries and booksellers that have the book. Finally, you can just feed the ISBN to Google [google.com], and come up with all kinds of useful links. Your choice.

Re:Pay them or pay me. Or don't (-1, Troll)

Anonymous Coward | more than 8 years ago | (#12760937)

Kind of unethical to take a commission for a book you're reviewing.

Of course, Slashdot pays the fees to host and serve the review. And Slashdot even links to the books when it gives them negative reviews, so it's relatively neutral in that respect.

You could...

Or you could type the title into Amazon, and avoid Google/Wikipedia/whatever.

Use my Amazon link, which is blatant spam on my part, but a tad more ethical.

No matter how sweet your shit smells, it still ain't a rose. Way to go, spammy. Your entire post is useless, except to spread your referral link on yet another book review.

A Good Book For The C++ Newbie? (1)

creimer (824291) | more than 8 years ago | (#12760874)

I just finished a college course in intro C++ programming. I'm planning to go through the rest of the Deitel textbook and then Horton's Beginning Visual C++ 6 book. Would Effective C++ be a good follow up book or should I look elsewhere?

Re:A Good Book For The C++ Newbie? (5, Informative)

SnowDog_2112 (23900) | more than 8 years ago | (#12760997)

I haven't done C++ programming for almost 5 years, but for five years before that I was developing exclusively in C++.

Effective C++ (an earlier edition, obviously) was a huge boost to my early years in the workplace.

It was pretty much required for every new hire to pick it up, our coding standards referred to it, and you were expected to have it nearby if you were messing around with the codebase.

It is full of no-nonsense vital explanations of C++ best practices. If you're going to break a rule from this book, you should be able to explain why you're going to do it :).

I still have it in my bookshelf "just in case" I ever am faced with a C++ question.

Is it a good book for a newbie? I don't know. But it'll help you understand how not to make newbie mistakes, that's for sure.

If all you're writing are toy programs, heck, it still might be interesting as just good background knowledge. But if you're developing professional software, it will help you make your software more solid and more maintainable.

And no, I don't know the author or anything. I just loved this book.

Re:A Good Book For The C++ Newbie? (4, Insightful)

Brandybuck (704397) | more than 8 years ago | (#12761023)

Dump the VC++ book. It's not about C++, it's about an IDE and API.

p.s. If you want an API book, buy "GUI Programming with Qt" instead. It comes with a free copy of Qt noncommercial for Windows. Your programs will be crossplatform and trivially portable to Linux, Unix and OSX. The quality of the Qt API makes MFC drop to its knees in humble supplication.

p.p.s. If you want to learn the VC++ IDE, read the help pages.

Absolutely! (1)

MisanthropicProgram (763655) | more than 8 years ago | (#12761042)

I've been programming in C++ for almost ten years. His books are one of the best in the market. I prefer it over Strousup's book. The CD is awsome. Some of the stuff may be a little over your head at first, but stick with it. He has tips on developing not only good C++ programming habits, but also good overall OO programming habits. This will help you when you get into other OO languages.
Goodluck!

Accelerated C++ (1, Interesting)

devphil (51341) | more than 8 years ago | (#12761100)


By far the best book I've ever seen for beginners, or relative beginners, is Accelerated C++ [acceleratedcpp.com]. The authors have been involved in C++ since its inception and have been teaching it ever since as well.

If you program in C++... (1)

chuckfucter (703084) | more than 8 years ago | (#12760882)

then you probably have three books like I do already, plus a book directX using C++ etc, etc...

I assume its a great book and all, but what new stuff has really come out in C++ in the last ten years that I havent already read on /.

JAVA! (0)

Anonymous Coward | more than 8 years ago | (#12760896)

Even if you spend a couple of years learning C++ and actually manage to get O.K. odds are everyone you play with will write terrible C++.

On the other hand even badly created, first effort code in java is frequently usable.

as you can tell I like Java alot

Re:JAVA! (0)

Anonymous Coward | more than 8 years ago | (#12761142)

On the other hand even badly created, first effort code in java is frequently usable.

Seems like you haven't been employed long enough to be arround for the 'second' effort.

Comprehensive List of Book Reviews (4, Informative)

turgid (580780) | more than 8 years ago | (#12760927)

A wise and learned former colleague pointed me at the Association of C and C++ Users book reviews [accu.org] when I asked about getting a modern C++ book.

Don't let the name of the Association mislead you, they deal with many other programming languages and subjects too.

If a language needs a book this thick, (0)

Anonymous Coward | more than 8 years ago | (#12760994)

and three editions to get there,

then it is too complex for everyday use.

"When you design a language, you should not only consider what to put in, but also what to leave out." - Niklas Wirth

C++ has become an end to itself. Developers love it because they can tinker endlessly with the programming without ever coming close to solving a real-world problem. How do you even pronounce the next generation C++0x - cock-up? (Which, in British English, means about the same as SNAFU.)

Granted, Ada's language spec is even thicker. And while every surprise that you might encounter is properly documented, the sheer bulk ensures you won't know about it until you see for yourself.

Try Smalltalk. Just 20 pages to define the language. The rest of a Smalltalk book describes the IDE (the refactoring browser) and the libraries. Modern Smalltalks have everything that Java has, except the need for a "More Effective Smalltalk".

Re:If a language needs a book this thick, (1)

exp(pi*sqrt(163)) (613870) | more than 8 years ago | (#12761051)

Developers love it because they can tinker endlessly with the programming without ever coming close to solving a real-world problem
How distant are you from this plane of reality that you can complain about C++ not being used to solve real world problems, and how did you get there?

Re:If a language needs a book this thick, (1)

Rakshasa Taisab (244699) | more than 8 years ago | (#12761229)

Some of us are/will be professional programmers, a thick book does not scare us. Have you ever seen physics and calculus books? But wait, we're programmers, we can't handle that amount of information.

Sure you can do calculus with a 20 page set of rules, but not very efficiently. The core language does contain rather more than C or Smalltalk, the templates being a beast. But it's a beast that makes it easier to write efficient code and allows for meta-programming. BTW, why are you comparing Smalltalk to Java's capabilities?

Note that most of the book is about the standard library.

You're an idiot. (0)

Anonymous Coward | more than 8 years ago | (#12761238)

Period.

If only C++ developers read their copy (1)

betelgeuse68 (230611) | more than 8 years ago | (#12761089)

One of those books that many people had on their bookshelf, but it seemed, rarely read... given the mediocrity of C++ knowledge that I constantly ran into during my day.

-M

Effective C++ (0)

Anonymous Coward | more than 8 years ago | (#12761144)

Now there's an oxymoron...

If you've been programming C++ (0)

Anonymous Coward | more than 8 years ago | (#12761219)

for any length of time, and you're still at it, there's something wrong with you.

Troll time. (0, Redundant)

sinserve (455889) | more than 8 years ago | (#12761221)

Unless your superiors at work are of the bondage and discipline persuasion, you don't need to touch C++. This is 2005 and powerful languages are everywhere. You can get strong or weak typing, static or dynamic, near perfect code optimization. First class functions, objects, exceptions and contunuations. Full extensible refelective systems. Full access to C libraries. Portability. and more stuff than you will ever know what to do with.

Just open your eyes and see the possibilities; Choose Common Lisp, Scheme, Standard ML, Ocaml, Haskell. If you must have C syntax, see what Python offers you, Pike too.

Almost everything is better than C++, and some of the above mentioned langauges have implementations which target the Java platform; all the benefits Sun has preached for so long, available on a REAL programming language. Even Java is better than C++ and runs circles around it. If performance is your thing, you can find some Schemes which run at competitive speed, plus they come with full denotation and/or operational semantics, sometimes just a page long, so you can see what the language ACTUALLY does without reading hundreds of Standard pages.

If you still monkeying around with C++, out of your own free will, you have my full sympathy. Break free my friend, and win back your time and peace of mind. /me off his rocker.

Thanks for the tip (1)

farker haiku (883529) | more than 8 years ago | (#12761348)

This is exactly the type of book I've been looking for. It seems that when you walk into Borders, every book on the shelves is something for the absolute n00b or is only a desk reference. Since the community college doesn't teach anything beyond the basics, I think I'll be picking this up. Nicely written review too :)
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...