Practical C++ Programming, Second Edition
Practical C++ Programming is a fairly large book: 549 pages organized into six parts containing 30 chapters and 5 appendixes. The parts are as follows:
- The Basics
- Simple Programming
- Advanced Types and Classes
- Advanced Programming Concepts
- Other Language Features
- Appendixes.
I must start by saying that I like the book -- I think it has value. There are a number of things I really appreciate about the book. There are also some problems that adversely impact one segment of the book's intended audience (more about those later.)
The book discusses all the essential elements of C++. Areas covered include: Class definition, namespaces, scope definition and resolution, operator and function overloading, object memory allocation (i.e. new and delete,) type casting, exceptions, inheritance, templates (including an introduction to the Standard Template Library,) the Input/Output system (including the C I/O library), and pointers. All language operators are discussed (i.e. relational, assignment, etc.) Also covered are language elements that C++ has in common with C. The other areas of instruction (programming style, software development concepts, programming tools) are intertwined with the primary topic throughout the course of the book.
One of the book's strong points is the author's excellent conversational writing style. It's hard to find books that combine good technical information with clear expository writing (O'Reilly seems to publish most of them.) Practical C++ Programming definitely succeeds in this area. The author frequently references his own experience to reinforce concepts on programming style, design and debugging. I found his anecdotes useful and occasionally humorous. The book also contains small sections of text that serve to warn the reader of pitfalls (these are marked with a bear trap icon) and areas where caution should be exercised (marked with bear paw tracks). Also, some of the source code examples contain intentional bugs, which the author explains at the end of each chapter. Diagrams, tables and source code examples are found on almost every page of the book, and these are used to keep the reader engaged with the textual discourse. My favorite diagram is Figure 7-1. "Software life cycle," on page 88; I emphasize with the dinosaur.
The book contains some interesting programming examples. The chapters on operator overloading and floating-point math contain source code illustrating how to deal with the numeric precision problems that plague all computers and computer languages. The chapter on the Standard Template Library contains a program showing how to create and use objects that manage a simple roster for enrollment and grading of students. The book also contains several examples of linked-lists and trees, for the purpose of teaching the reader how to use pointers, and to also show the reader the power and usefulness of the Standard Template Library.
Now to speak about the book's shortcomings. First, although the book does a good job of covering the important C++ topics of classes, inheritance, and templates, I think it falls a bit short in these areas (especially the coverage of inheritance). Also, the terms instantiation, polymorphism and encapsulation are not used in the book. The book could have provided a bit more insight into object-oriented concepts. Also, these areas of the book are sparsely diagrammed. Second, source code errors and typos appear regularly enough to frustrate an inexperienced reader. I also found a couple of diagrams to be confusing. Third, there are occasional misleading statements that a beginner probably won't recognize as such. Because of these problems, I cannot recommend the book to people with no previous programming experience. I'm surprised that these problems made it into a second edition.
I think that despite these problems, the book has value to experienced programmers who want to learn C++. C programmers in particular will have an easier time dealing with the source code errors. Also, I think that the book can be used by beginning programmers in a classroom environment, providing the instructor understands the book's problems and is prepared to guide students around them. The book should be particularly useful when read in conjunction with a good C++ reference guide.
Practical C++ Programming is an ambitious work in its breadth and depth. It covers more areas of software development than other C++ books. It takes an interesting approach that some readers will appreciate and others may not.
I would like to have seen a more detailed and complete explanation of the object-oriented aspects of C++ (including more diagrams). A table showing all functions for Standard Template Library containers would have been nice (the book does make reference to two STL web sites). Some mention of third-party object libraries (such as Rogue Wave, Qt, etc.) and their uses would have been helpful.
The lack of a detailed explanation of inheritance may not be bad. I'm one of those who believe that heavy reliance on inheritance causes serious maintainability problems. However, I think the book should have covered this topic more fully, so the reader would understand this issue.
In summary, Practical C++ Programming is a good book that really shines in some aspects and falls short in others. With some improvement, it could be a great book.
You can purchase Practical C++ Programming, Second 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.
Amazon has it for $4 less and with free shipping!
Embracing C# and the CLR with open arms, but sometimes its nice to get back to C++, with ATL, or WTL...but not MFC or COM stuff.
We were somewhere around Barstow on the edge of the desert when the drugs began to take hold. - HST
Practical C++ Programming is dedicated to teaching the reader how to program in the C++ programming language.
No shit, I thought it was the next in the Harry Potter series. My kids are going to be disappointed.
Sorry, it's just that thats the kind of retarded formula-generated opening statement you'd expect from an 8th grader with no interest in the material. Ie; "The Treasure of Pirate Cove is about a treasure in a place called Pirate Cove"
By the way, I love iPods, so mod me up up up!
I don't need no instructions to know how to rock!!!!
All you need for debugging is print statements everywhere. Always works :)
Rus
Cheap UK and US VPS
That's sweet, four goals: 1.) 2.) 3.) 4.) 4.) ;-)
Otherwise, good review! Thank you!
Practical C++ Programming
it goes together like linux and microsoft
gah I mean "..as Lung Cancer is to Lung"
I'm a retard.
Trolling is a art,
Practical C++ programming is C.
After programming in C++ extensively for the last 9 years, I've come to the conclusion that it's much better to program in C (or a scripting language). C++ encourages you to avoid solving the problem by trying to introduce abstractions that also don't solve the problem. This lets you pat yourself on the back for how clever your abstractions are, but you end up with longer code and a half assed solution.
C++ has probably set back the computing industry by 10 years.
1) Write practical C++ programming book 2) Get it published 3) Have it reviewed on Slashdot 4) ??? 4) Profit!!!
...should, I have decided, always involve the text Accelerated C++, by Koenig and Moo. They have been working with C++ since its inception, down the hall from Stroustrup.
The book takes two relatively new approaches to teaching C++: 1) don't teach C first, and 2) assume that the standard C++ library is there. So, they introduce "Hello, World" using std::string and std::cout, and they keep using std::string without trying to first teach template classes with default template parameters. The resulting intro programs are very clean and simple, easy to follow.
The word "pointer" isn't even mentioned until chapter 9. By that point, they're using strings and vectors to solve useful programs, and since both of those containers manage memory themselves, the user needs to know nothing about dynamic memory management (and thus, pointers) before doing the exercises.
Pointers and user-defined types are introduced, of course, but they don't need to be introduced before showing the reader how to use the basic library features. You don't need to know how an internal combustion engine works before learning how to drive, although going back later and learning what's under the hood will always reward the observant driver.
This approach has gotten rave reviews, and from actual C++ people, not just fluff reviewers. It's the produce of years of teaching C++ courses.
Final note: the book is one of the fantastic "C++ In-Depth" series, of which Stroustrup is the series editor. All are very high quality. One of the series' rules is that the main body of the book can be no more than 300 pages, so "make your point, make it simple, make it clear" rules the day.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
This was terrible.
My favorite diagram is Figure 7-1. "Software life cycle," on page 88; I emphasize with the dinosaur.
Ok, if I own the book, I'm not going to take the time to read this "review". If I don't own the book I obviously have NO FREAKING clue what figure 7-1 looks like! Also, does "Emphasizing with a dinosour" involve time travel and a shitload of highlighters or what? Or does it mean you hire a dinosour to stand next to you for emphasis? I don't get it...
They who would give up an essential liberty for temporary security, deserve neither liberty nor security
Any new book - and certainly a second edition- on programming (whatever the language) should have a full chapter on security.
http://blog.astyran.sg
As for me...I'm never going to "emphasize" with a dinosaur...I might "empathize" with one (if I met one in a deplorable condition)...who knows?
Now to speak about sentence fragments.
In summary, this review is a good review that really shines in some aspects and falls short in others. With some improvement, it could be a great review. Of course...if you improve anything, it gets better, now doesn't it?
Ack.
Why buy the book when you read it on safari, along with thousands of other books with a free 14 day trial..
"C++ has probably set back the computing industry by 10 years."
Damn! I thought it was Microsoft. Guess I lost that bet.
The author did a very nice job on Practical C Programming.
But Steve O. shouldn't have let himself be conned into writing the Practical C++ Programming, though. His C bias weighs too heavily and the first edition spent all kinds of time talking about wonderful linked lists with structs just like the C book did.
If you want to learn C++, my suggestions are:
- C++ Distilled by Pohl
- Effective C++ by Scott Meyers
- More Effective C++ by Scott Meyers
- The C++ Standard Library by Josuttis
some other are also good, and of course no guru should be without one of Stroustrup's tomes."Provided by the management for your protection."
... is reviewed here, at the 'net's largest C++-oriented book review site. This review is decidedly in the negative, although Steve Oualline is given a chance to issue a response which is worth reading.
It seems that the 2nd edition of this book may have brought forward some previous problems. I have the first edition but never liked it, never thought it really achieved it's goals.
If you're looking for an uncompromisingly amazing first book on C++, please check out Accelerated C++ by Andrew Koenig and Barbara Moo. This is how I learned C++ and, by using the concepts of teaching core language skills alongside library concepts and best practices in OOP, it truly accelerates the process. Amazing.
Chr0m0Dr0m!C
I remember the first edition of Practical C++ Programming. Readers who wished to get something out of that book should've noticed that it was absolutely necessary to debug the book's programming examples first.
Errata? 'Er sure smella like it!
Chapter VII: How to sign up for unemployment benefits.
Goal 4) teaching proper iteration.
When we can steal it all from SCO...
Also, the terms instantiation, polymorphism and encapsulation are not used in the book.
Seem odd to me that a book that is designed to teach C++ would skimp on the object oriented features of C++. I find polymorphism extremely powerful in many situations. For example, I use it often with bison when writing parsers, and for writing cool Zoo example programs where you call a function MakeSound and it automatically says "Ooo Ooo" for the Monkey, and "Eeeee haaaaa" for the Ass.
Honk if you're horny.
If/when I finally learn C++, it's going to have to be with the help of a book that teach C++ for Windows programming, or C++ for Linux programming. I took a data structures class in college and learned about binary trees and pointers and linked lists and all that stuff, but without being able to write a program that I could imagine actually using, I've had little incentive to remember how to overload the ++ operator.
Are there any good programming books that focus on learning to create GUI's and modern applications? Such as, something that addresses modern concepts like internet connections and DVD drives and database connectivity and such. I don't need to relearn the concepts behind OOP (although a quick overview of syntax would be nice), I want to know how programmers use this stuff, what they create vs. what they have access to (like common dialog boxes), and basically the steps between writing a "sort the list of student records" console app and writing a full-blown application (I know the latter takes a lot of time and code, but I don't know what direction to go in, or how programmers organize all the code).
I really hate signatures, but go to my website.
Without debating the whether C++ is the best choice for beginners, I wish new books on the subject would stop rehashing the same old concepts and methods - not everyone is a C programmer trying to transition to C++. There are a lot of areas that merit greater attention and that will get beginners started on the right foot - and messing with raw pointers isn't one of them.
On top of trying to get the basic OO mindset accross (yes instantiation, polymorphism and encapsulation are big words but the concepts are essential and not that difficult to explain), I'd like to see some more modern and useful concepts explored in depth. For instance:
Just my $0.02 for potential authors out there.
>My favorite diagram is Figure 7-1. "Software life cycle," on page 88; I emphasize with the dinosaur.
i emphasize with yelling or CAPS, but if this dinosaur thing get the point across, bully for you.
did you perhaps mean empathise?
(while attempting to steal a definion from dictionary.com i was asked to purchase a premium account to obtain a definition. sad really.)
turn up the jukebox and tell me a lie
Counting four twice still makes it five.
I also recommend a reference card to help people learn C++. When programming in a new language, it is helpful to be able to look up syntax quickly.
This is a plug for the card, but you can download a PDF of the card for free.
http://github.com/gbook/nidb
Back when O'Reilly had a _Practical_C_ book, but no _Practical_C++_ book, I called them and said that they should do one. They rejected my suggestion without pause, saying that their kind of readers didn't think that C++ was better than a pitcher of warm spit. Then some other author came out with a _Practical_C++_ book (now out of print), which wasn't very practical, since it was muchly about the C++ standard, which wasn't a standard then and had barely started to congeal when the book was written. Hence, when O'Reilly finally realized that their old readers had already been educated far beyond their intelligence and that they needed to broaden their appeal, they came out with _Practical_C++_Programming_. You can't copyright a title, but at least it cuts down on the confusion. Now it's gone multiple editions. It's pretty good, but nothing is worse than being ahead of your time before the world is ready.
Some people like his writing style but tutorial and reference books are not novels. It is unacceptable when they are full of mistakes especially when the author does not understand his own errors and appears authoritative to those that do not know an better yet and are just learning the ropes.
This is not a flame, it is important to warn everybody about some BAD C/C++ books out there. You can read more about the opinions of Schildt's books at the ACCU book reviews. The alt.comp.lang.learn.c-c++ FAQ has more info on why not to use his books. In particular The Annotated Annotated C Standard lists many of the problems in Schildt's The Annotated C Standard including errors in the transcription of the standard itself.
>The author encourages the reader to use a computer to enter, run and debug the book's programming examples. I concur with this advice, though it isn't absolutely necessary.
This is something that novice programmers are well advised to listen to. I constantly am asked by junior programmers 'What happens when I do x', where x is something simple, like try to print out an array.
Half the time, the problem can be answered by simply trying it. And the other half of the time, you end up with a better question (I want to print out the values of an array, but print @array didn't work. What's the trick?) (In perl, see 'perldoc -f join'. That's not my point, but I don't want to leave you hanging!)
And even better, learning the value of experimentation makes you a better programmer, and a much more pleasant junior employee. Instead of spending all your time asking a series of questions, you try a whole bunch of things. By actually stopping to think about the problem, which this approach forces you to do, you end up learning a lot more, and sometimes the failed efforts are exactly what you need later. And if you're stumped, you still end up looking smarter, because you at least tried some approaches. And more often than not, it's easier to learn the answer if you've taken the time to struggle with and really learn the problem you're trying to solve, and remember the answer next time.
I think this is one of the unheralded keys to becoming a good professional programmer.
Caveat: This works a lot better in some development environments than others. I do most of my work in perl, which is ideally suited to this rapid prototype approach. In environments with long compile times, it's more tedious. This is thankfully decreasingly true, with faster machines making the hours-long compiles a historical problem, so take advantage of it, learn to experiment, and reap the rewards.
-- Kate
Instead of comparing just B&N vs. Amazon all of the time, why not use the book shopping bots? (Amazon and B&N are not the cheapest books every time you buy a book (they may be in this case (I checked), but in many cases, the others are much cheaper)! The bots search a lot of the book stores and rank the prices (including handling/shipping), present opportunities for discounts, and even point out the ability for finding books which may be out of print but can be purchased used.
Think of this as a book equivalent to PriceWatch
(these links were tested in 'preview' mode before posting.
BookPool
AddAll
BestBookBuys
I mean, if you're going the 'don't need to understand 'C', pointer-free, high-level only route, use something interesting and easy to use like Perl, (heaven forbid) VB, Java, or Python.
To me, the STL was like putting lipstick on a garbage can. It may look prettier now but I'm still never going to kiss it. It's still something you have to wrangle, bang around and not look at when you don't have to.
Does it hurt to hear them lying? Was this the only world you had?
He probably meant to type 'empathize', though I agree with your criticism.
... OK ... so, which was it? Does it do a good job or does it fall short?
I was also did a double take with this remark:
First, although the book does a good job of covering the important C++ topics of classes, inheritance, and templates, I think it falls a bit short in these areas (especially the coverage of inheritance).
Um
The little guy just ain't getting it, is he?
How many "How to program in C++" books to we need?
More power to 'em, I guess. It just seems to me that the language has been around for awhile, has aged gracefully, and has an entire library's worth of books written for it.
I suppose it's good to update every once in awhile, but this book doesn't seem to have anything new (based on the review). I'll stick to the 4 or 5 I have, thanks.
My sig sucks.
Great now I dont have to buy it now that I know how it ends! Thanks Timothy!! *note this is supposed to be funny
I think he meant empathize. This is what editors are good at fixing.
It's 10 PM. Do you know if you're un-American?
visual studio's IDE (well if you're a purist you can not use the visual part of VC++) allows you to debug your functions and watch your memory allocation [stack/heap] and registers as you step through. I think this is what you want.
I don't mean to bag on Steve Oulline. Maybe in person he's a great guy and gets tons of chicks...
But I happen to have his "Practical C Programming", and i discovered after the fact that it gets lots of thumbs down from both comp.lang.c and #c on freenode.
I've also got some personal beefs with it, in that there are many places where it is either implied or specifically stated that C is merely a stepping stone to C++.
"Get into the habit of pre-fixing your increments and decrements (i.e. ++i, --i, as opposed to i++ and i--) because it will make your transition easier to C++"
"A lot of the concepts that are involved with structures in C will become relevant when you move up to Object Oriented Programming C++"
"The next logical step for C programmers is to learn C++"
Maybe some of these statements can be benign or true for most, but me personally, i don't want to learn C++. I think the same end result could be sought with C than with C++.
Just MHO.
Karma be damned.
do() || do_not();
I already have, and love, PC++P, so why should I "upgrade" to the new version. It looks shorter, based on page count!
Does it discuss some of the C++ features that never made it into the 1995 version, such as templates, STL, exceptions.
Anybody?
Another problem with a debugger is if your app is split into DLL's: how do you debug into a DLL if that is where it is choking? How do you run the DLL stand-alone in that case?
An idea I have tried under Windows is to output the trace to an out-of-process (.EXE style) Automation server program. That Automation server can optionally show the trace in a console window or it can redirect the trace to a file. This is usable with a GUI or a non-GUI app. Also, if the process containing your program shuts down, crashes, or locks up, you still have the trace displayed or saved to disk by another process. Not only that, you can implement some kind of "error level" system or perhaps simply unregister the Automation server when you don't want to see the trace -- I put a singleton object in my app as the connection to the Automation server, and that object can check if the Automation server is available before forwarding the text display.
This Automation server seems to work in just about every case -- except for inside ActiveX components. That's my whole point: you can unit-test stuff all you want, but weirdness happens when you hang it all together. My Automation server linkup locks up on program termination if an ActiveX component is using the Automation server. Hey, its Windows, and who knows what kind of prolog-postlog is happening in wizard-generated ActiveX base object and skeleton code, so the only thing I can think of for tracing an ActiveX is writing to a file, MessageBox() (not always good -- sometimes pops up zillions of message boxes on account of thread issues). If anyone has a better idea of how to trace inside an ActiveX control while that control is used in a designer or an app, I would like to know.
...and in the next edition, the book will have the additional goals of 5) Introduce the reader to US Copyright law 6) How to stay out of prison after violating the DMCA and 7) Learn how to pick the best copyright lawyer to defend against SCO lawsuits.
Well you're a fine curmudgeon then.
Why are people so hostile to political awareness? I don't understand it.
microsoftword.mp3 - it doesn't care that they're not words...
I have run the same argument with programmers I know and have reached similar conclusions. The real problem is when you have to start working with code someone else has made. With C++ you have to start delving into the mind of the other programmer and find out how he decided to OO. What did he feel constituted an object? It adds another layer of abstraction that you have to "figure out" in order to work on the code.
I think in this case, I'd just head on down to the library and flip through their C++ books until I found one I liked. Or grab a copy of Deitel & Deitel since that seems to be a pretty standard introductory textbook for programming classes.
The sending of this message pretty much inconveniences everyone involved.
there are occasional misleading statements that a beginner probably won't recognize as such.
Even one example would have greatly bolstered the reviewer's argument here.
When no examples are given, we do not have any idea in what way the author is "misleading," on which topics the author is liable to slip, or how serious the problem is.
Can you believe that this kind of code could make it in here? It's the kind of thing that developers would call "ugly."
I really hate signatures, but go to my website.
On Linux I've had a ton of success using Valgrind to find memory errors. It can identify bad memory reads, writes, uninitialized values, etc. during runtime. Figuring out what is causing those errors is up to you, however. It doesn't substitute for intelligence but it helps narrow the search incredibly.
How is this different then any other C++ book out there?
--
silence is poetry.
"Second, source code errors and typos appear regularly enough to frustrate an inexperienced reader."
but earlier you said
"4) The author encourages the reader to use a computer to enter, run and debug the book's programming examples"
Everyone that's ever had a programming class knows all of those errors were intentionaly put there to test you. At least that's what my profs always told me when they gave the class buggy code.
Perhaps this will help:
C ++2_0701.gif
http://safari.oreilly.com/images/0596004192/figs/
Ok, if I own the book, I'm not going to take the time to read this "review". If I don't own the book I obviously have NO FREAKING clue what figure 7-1 looks like! Also, does "Emphasizing with a dinosour" involve time travel and a shitload of highlighters or what? Or does it mean you hire a dinosour to stand next to you for emphasis? I don't get it...
I have Practical C Programming by the same author, and it has a Figure 6-1 "The Software Lifecycle" that also uses a dinosaur to represent the software. I wonder how similar these two books are? Is the C-like subset of C++ taught by just reprinting parts of the older book?
where there's fish, there's cats
Some problems with this review:
1. Where's the basic information about this book? Author, publisher, ISBN, list price, etc. None of these are mentioned in the review (yes, there's a link to B&N, but, c'mon).
2. Sequencing is an essential aspect of a technical book review. In what order does the author address the topics? Are there many forward references? Does the author march through the topics one at a time or is the subject matter gradually explored, step-wise? A Table of Contents listing (instead of the simplistic 6 parts) would be nice, at a minimum.
Some problems with this book:
1. Having found the TOC on O'Reilly's website (http://www.oreilly.com/catalog/cplus2/toc.html), it's clear that this book features the Bad Old Style of C++ pedagogy: namely, teach C first. The author tackles arrays before std::vector, structs (and unions!) before classes, C-style linked lists before std::list, switch statements before virtual functions, and macros before templates. The new approach to teaching C++ is to give the user familiarity with the powerful utilities of the standard library, so that useful programs can be written right off the bat, and then to explore the dizzying array of language constructs which make the standard library what it is. I encourage those new to C++ to check out Accelerated C++ as an alternative introduction to C++.
2. The reviewer points out that there are many code errors in the book. This is unacceptable, especially for a beginning book. A small number of obvious typos can be forgiven, but anything more than that should consign a tech book -- again, especially an introductory book, where the audience has little experience for dealing with errors -- to the circular file.
While I love many of O'Reilly's offerings, their coverage of C++ has always seemed spotty and outdated. I encourage anyone trying to learn C++ to check out the C++ In Depth series published by Addison-Wesley, starting with Accelerated C++ and Essential C++.
Jon
But supporting the cause of my noise isn't going to make me quiet- look, I've already made two responses to an AC just because of your position, and the more profit Amazon makes the more I (and folks like me) will complain.
You don't hear shrill Amazon supporters because no one likes them. Help us solve the problem if you don't want to listen to us.
microsoftword.mp3 - it doesn't care that they're not words...
"In summary, Practical C++ Programming is a good book that really shines in some aspects and falls short in others."
I saw a movie the other day. It had some really good parts and some really bad parts. In summary, it was a movie. If you like watching movies, then here's another option for you. If you don't like watching movies then WTF are you reading this for?
Incidentally, is this the same Steve Oualline that got his MS OS refund and managed to document it?
Right... In case slashdot gets slashdotted?
Anybody care to hazard a guess how much the reviewer makes from their affiliate links in these articles?
Must not be bad, since submitted reviews occur at a regular basis on slashdot.
John Kerry is a Joke!
You youngins and your fancy schmancy computer thingies. Back in my days we didn't have no fancy "computers" and we were grateful! We all did are programming using pseudocode. We never had to deal with memory or speed restrictions! The sky was the limit! Things have gone downhill since they made the switch to those fancy computers. So show some respect, sonny!
Yes sir, those were the good ol' days.
The standard library and templates have nothing to do with OOP.
Welcome to generic programming.
- I don't need to go outside, my CRT tan'll do me just fine.
What does user input have to do with C++? C++ is a programming language. You can do things with it like traverse a file structure, poll the registers on some hardware on your PCI bus, figure out the optimal way to use fuel to boost your satellite into a higher orbit or identify a potential missile target. What the hell place does "checking user input" have in a book about a tool that does these thongs? Being able to code CGI routines doesn't make you a programmer. Programmers do a lot more than write code to check credit card numbers on second rate ecommerce web sites.
Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
OH NOES!!! IT APPEARS YUO DO NOT HAVE ENOUGH MONEY TO PAY FOR DIS HERE PIZZA! WAHT EVER ARE YOU GOING TO DO!?!?
My understanding of the C language is rather limited. Reason being, never needed to development anything other than perl, php and python so I have a pretty good understanding of programming concepts.
I am interested in developing some C++ apps for the GUI, should I get out a C book first?
No, I think you missed the point. C was a sweet spot in the evolution of computer languages. Nothing since then has delivered that much improvement over what went before, although I think Perl comes close.
The entire journey into OO with java and C++ will probably be regarded as a bizarre and pointless fad by future programmers.
This has been one of my biggest gripes about Slashdot operation since forever. I set my prefs to have 200 or 300 comments per page, since otherwise it takes 10 or 15 pages to go through a busy article, but it always comes back with 50. I just assumed it was a bug in the code, but it was never annoying enough to submit a bug report.
Looking now, it appears that they've changed things, a bit. From the configuration page:
Comment Limit (only display this many comments, for best results, set this to a low number and sort by score) If set above 100, then it is ignored and 50 is used instead.
Which would be one of the hokiest things I've ever seen, if not for the fact that my previous setting of 200 was still there, which is even hokier. If you're going to cap the value, fine, but change the damn thing in the database, and tell me about it. And for god's sake, why would you clamp values above 100 to 50? Why not to -- 100?
Like I said, this new behavior showed up sometime in the last month or so. Who knows, because there appears to be no actual release process for Slashode, other than "I changed something, let's push it live." Am I the only one that realizes that, in the real world, you test your changes on a staging server, then, if nothing is broken, push them live on a defined schedule, say, Fridays at midnight? I'm really tired of seeing randomly generated pages or broken story links showing up out of nowhere.
Okay, I know it's all free, and if I don't like it I should start my own site, and all that. It's still not very professional and it still pisses me off. I'll quit my bitching now.
Java: the bastard demon spawn of C++ and Ada
void main? No points.
? Not part of Standard C++, which has instead.
The rest of the card doesn't look much better. The reserved words are listed and the card notes that they can't be used as identifiers, but it doesn't mention that there are other reserved identifiers.
The description of while(x) says that x must be an expression, but for a long long time C++ has allowed a variable declaration at this point, and such use is idiomatic.
The example of operator overloading is far from ideal: the argument is idiomatically passed by const reference, not by value, and for operator- it's normal to copy and then subtract the rhs, rather than the more C-inspired code shown.
This card might be helpful in its free version, but if you pay money you probably want something that's teaching correct/good C++.
Maybe with an update the card would be a good thing. Visually it's not unappealing and some thought has clearly gone into it: it's just that it has not been written by a C++ expert.
RAM_START equ $80 ; yes this is code but here is some padding but here is some padding
CODE_START equ $8000 ; yes this is code but here is some padding but here is some padding
rsset RAM_START ; yes this is code but here is some padding but here is some padding
val1low rb 1 ; yes this is code but here is some padding but here is some padding
val1high rb 1 ; yes this is code but here is some padding but here is some padding
val2 rb 1 ; yes this is code but here is some padding but here is some padding
res1low rb 1 ; yes this is code but here is some padding but here is some padding
res1high rb 1 ; yes this is code but here is some padding but here is some padding
factlow rb 1 ; yes this is code but here is some padding but here is some padding
facthigh rb 1 ; yes this is code but here is some padding but here is some padding
counter rb 1 ; yes this is code but here is some padding but here is some padding
org CODE_START ; yes this is code but here is some padding but here is some padding
Testbed ; yes this is code but here is some padding but here is some padding
; Initialisation ; yes this is code but here is some padding but here is some padding
ldx #$ff ; yes this is code but here is some padding
txs ; yes this is code but here is some padding
sei ; yes this is code but here is some padding
cld ; yes this is code but here is some padding
; Perform task ; yes this is code but here is some padding
lda #5 ; yes this is code but here is some padding
jsr CalcFactorial ; yes this is code but here is some padding
; A contains result ; yes this is code but here is some padding
brk ; yes this is code but here is some padding
; Input: A ; yes this is code but here is some padding
; Output: A=factorial (note that (a-1)! must fit into 8 bits)
CalcFactorial ; yes this is code but here is some padding
sta counter ; yes this is code but here is some padding
lda #1 ; yes this is code but here is some padding
sta factlow ; yes this is code but here is some padding
floop lda counter ; yes this is code but here is some padding
cmp #2 ; yes this is code but here is some padding
bcc fend ; yes this is code but here is some padding
ldy factlow ; yes this is code but here is some padding
jsr Mult8x8 ; yes this is code but here is some padding
sta factlow ; yes this is code but here is some padding
sty facthigh ; yes this is code but here is some padding
dec counter ; yes this is code but here is some padding
jmp floop ; yes this is code but here is some padding
fend lda factlow ; yes this is code but here is some padding
ldy facthigh ; yes this is code but here is some padding
rts ; yes this is code but here is some padding
; Multiply 8 bit * 8 bit = 16 bit (Input: A,Y) (Output: A:Y=result)
Mult8x8 ; yes this is code but here is some padding
sta val2 ; yes this is code but here is some padding
lda #0 ; yes this is code but here is some padding
sta res1low ; yes this is code but here is some padding
sta res1high ; yes this is code but here is some padding
sty val1low ; yes this is code but here is some padding
sta val1high ; yes this is code but here is some padding
ldx #8 ; yes this is code but here is some padding
mloop ; Is this bit set?
lsr val2 ; yes this is code but here is some padding
bcc nobit ; yes this is code but here is some padding
; 16 bit add
lda res1low ; yes this is code but here is some padding
clc ; yes this is code but here is some padding
adc val1low ; yes this is code but here is some padding
sta res1low ; yes this is code but here is some padding
lda res1high ; yes this is code but here is some padding
adc val1high ; yes this is code but h
In fairness, Accelerated C++ has a lot going for it and does indeed break new ground (after an amazingly long time with an obvious hole in the market, I thought -- shoulda written it myself!) in how C++ is taught. OTOH, I find a lot of the comments about it somewhat annoying. It isn't perfect, far from it.
Basically, it's too trendy. Sure, it covers lots of STL things, but in practice a lot of people won't be using STL. (Except for fairly recent projects, it's far more likely that some other class library's containers will be the status quo on a project, and even some quite recent compilers don't support templates and/or don't have a good STL implementation.) The coverage of exceptions -- an equally if not more important topic than templates -- is almost non-existant. That was a great disappointment, in a book trying hard to look at C++ for its unique features and not the ones it borrows from C.
I think the book is much better for those who've programmed in other languages and then come to C++ than for beginners. As anyone who follows the C++ newsgroups can tell you, beginners who meet AC++ without other programming exposure are frequently overpowered by its fast-paced approach, and give up in frustration. Those with a "frame of reference" seem to get much more out of it.
Finally, it's written by the in-crowd. Many of the reviews were also written by the in-crowd. Draw your own conclusions about the objectivity of those reviews. This is my big problem with the ACCU book reviews, which are otherwise excellent IMHO. It's also a problem with the book's reputation on-line; so many "helpful" people on the newsgroups were bowing down at the creation of K&M that they recommended it with barely a second thought, and obviously without reading it first in many cases.
In summary, I think Accelerated C++ has a lot going for it, but it's way over-rated (mostly through no fault of its own) and it's not a book that stands alone (because it's in a short-but-sweet series, not a comprehensive one).
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
how useful is this book if you don't already know the c language?
If you want to learn from one of the best books ...
...), and look that it
...
about C++, I could say you that "Thinking in C++"
is the one of the best
"Thinking in C++" 2nd Edition by Bruce Eckel
is freely downloadable in its entirely at
www.bruceeckel.com
and
www.planetpdf.com
You just need to see the index of this
great book, the content(good designing,
architecture, etc
is the same author of the best book about java
("Thinking in Java").
But just if you really want to enjoy learning
about C++
Read this book and have fun
Have you ever thought about looking at the book the next time you visit your local bookstore? Then you can look at the diagram. Maybe I think the book is interesting enough to entice people to look at it, by making reference to a cute diagram on the software development life cycle. Gee, you guys want everything spoon fed to you!
Hey Timothy, The review I submitted didn't have that extra "4)". My guess is the first paragraph got mangled when you converted it from text to html. The review I submitted used periods, not parentheses. I appreciate having the periods changed to parentheses (more readable,) but the repeating "4)" is a real drag. Hey, a misspelled word is embarassing enough. Thanks.
An explanation can do a "good" job, but not a complete job (i.e. "It falls short.") Most people don't have a problem understanding this concept.
Actually, what I've done is present the book the way it reads. Also, a complete explanation of those concepts doesn't necessarily make it a bad book. That's why a reviewer will comment that the explanation of those areas "falls short." Given the books wide intended audience, I wasn't sure whether it made sense to rip the book for those ommissions. People can still use the book to learn the basics of C++. I think the book is probably most useful to C programmers who want to learn C++, but again I don't want to make that an unequivical statement because people with other backgrounds may benefit from the book. Its a big world out there, with lots of different people. Who are we to be absolute arbiters of what people should read?
I thoroughly disagree. If one reads a review in order to determine the instructional utility of a given text, one typically wishes to determine if it adequately covers a topic (good) or does not (falls short). Using both descriptions is ambiguous, particularly when referencing a particular topic (like inheritance).
It would be quite useful to say something to the effect of it does a good job covering the basics of the topics while specific illustrations would have been helpful or perhaps it provides a very good overview of the concepts of inheritance but does not convey a appreciation for its importance in object oriented programming. It is less so to say that it does a good job inadequately.
The little guy just ain't getting it, is he?
BTW, nothing personal. I was commenting on wording, not ideas. At least you took the time to write a review, rather than the comparitively simple activity of criticism the rest of us are doing.
The little guy just ain't getting it, is he?