Slashdot Mirror


Practical C++ Programming, Second Edition

adrienlamothe writes "Practical C++ Programming is dedicated to teaching the reader how to program in the C++ programming language. The book actually has four goals: 1) Teach the reader C++. 2) Instill good programming style and practice (indeed, the book's subtitle is 'Programming Style Guidelines.') 3) Teach the programmer basic software development concepts. 4) Introduce the reader to debuggers and the make utility. 4) 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." To see how well the book meets its own goals, read on for the rest of Lamothe's review. Practical C++ Programming, Second Edition author Steve Oulline pages 549 publisher O'Reilly & Associates rating 7 reviewer Adrien Lamothe ISBN 0596004192 summary Guide to learning C++ and programming style.

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:

  1. The Basics
  2. Simple Programming
  3. Advanced Types and Classes
  4. Advanced Programming Concepts
  5. Other Language Features
  6. Appendixes.
You will have to read most of the book in order to learn C++, although there are a number of chapters you can avoid if your goal is to learn only the language's mechanics.

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.

266 comments

  1. $4 less and free shipping at amazon! by Anonymous Coward · · Score: 3, Informative
    1. Re:$4 less and free shipping at amazon! by Anonymous Coward · · Score: 0

      Are you trying to emphasize something with a dinosaur? Or are you just empathizing?

      LOL

    2. Re:$4 less and free shipping at amazon! by Anonymous Coward · · Score: 0

      I don't know why people continue to buy from Amazon.com when Books-a-million is almost always cheaper. Books-a-million price is $29.76 and the club price is $26.79 (club is something like $5.00/year).

    3. Re:$4 less and free shipping at amazon! by Lord+Dimwit+Flathead · · Score: 1

      Bookpool has it for $24.50. I can't remember the last time I found technical books cheaper anywhere else. You do have to spend $40 to get free shipping though.

  2. Practically the 1st Post by Papatoast · · Score: 1, Interesting

    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
    1. Re:Practically the 1st Post by yrch93 · · Score: 1

      "Everyone who learned that died in Banzai charges" - Goto Dengo

    2. Re:Practically the 1st Post by Papatoast · · Score: 0

      Stephenson ROCKS!

      I was going to use both quotes as my /. sig, but its too long...

      --
      We were somewhere around Barstow on the edge of the desert when the drugs began to take hold. - HST
  3. Great opening. by stratjakt · · Score: 4, Funny

    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!!!!
    1. Re:Great opening. by cK-Gunslinger · · Score: 3, Funny

      Not only that, but "The author encourages the reader to use a computer..."

      Man, talk about "Practical Programming!"

    2. Re:Great opening. by Goo.cc · · Score: 1

      There is nothing in the title "Practical C++ Programming" that implies teaching will occur. If the title was "Learning To Program in C++", I might agree with you.

    3. Re:Great opening. by JanneM · · Score: 1

      On thge other hand, whenever a submitter does not begin by saying what the subject is all about here on Slashdot, he/she gets flamed to hell and back for not doing so.

      On the whole, far better to be a little obvious than a little obscure.

      --
      Trust the Computer. The Computer is your friend.
    4. Re:Great opening. by jvalenzu · · Score: 1

      It could have been worse. It could have started with a dictionary definition.

      Webster's Dictionary defines practical as being capable of blah blah blah

      or my least favorite

      Programming: programming (n): 1. The designing, scheduling, or blah blah blah

    5. Re:Great opening. by Anonymous Coward · · Score: 0

      'I did my book report on...'

    6. Re:Great opening. by asscroft · · Score: 1

      I don't see your book report on slashdot.

      --
      because I have been enjoined by this Holy Office to abandon the false opinion which maintains that the Sun is the centre
    7. Re:Great opening. by Anonymous Coward · · Score: 0

      Pah, the author is in lala land! Doesn't he know how impractical it is to fit a computer in the bathroom?

    8. Re:Great opening. by BitterOak · · Score: 1
      Not only that, but "The author encourages the reader to use a computer..."

      To paraphrase Homer Simpson: "Cool! They have C++ on computers now!

      --
      If I can be modded down for being a troll, can I be modded up for being an orc, or a balrog?
    9. Re:Great opening. by adrienlamothe · · Score: 1

      Yeah, I agree the first sentence is bad. Thanks for the feedback.

  4. Debugging by rf0 · · Score: 4, Funny

    All you need for debugging is print statements everywhere. Always works :)

    Rus

    1. Re:Debugging by saddino · · Score: 2, Funny

      Even better debugging tool:

      putchar('\007');

    2. Re:Debugging by kruntiform · · Score: 2, Insightful

      Print statements plus lots of assert statements works even better

    3. Re:Debugging by connsmythe96 · · Score: 3, Funny

      What does James Bond have to do with debugging??

      --
      if(!cool) exit(-1);
    4. Re:Debugging by pclminion · · Score: 3, Interesting
      All you need for debugging is print statements everywhere. Always works :)

      Actually it doesn't always work. On more than one occassion I've seen a bug stop happening when I put in a print statement. Take the print statement out, bug comes back.

      This always indicates some kind of memory error, usually an overflow of a local buffer, or a bug in your pointer arithmetic somewhere. By making the call to printf() you are modifying the contents of the stack (by pushing the function arguments) and this changes conditions in such a way that the bug no longer occurs.

      It's called a "Heisenbug" :-)

    5. Re:Debugging by pommiekiwifruit · · Score: 1

      Except when the print routine is serialised and you have a multi-threading bug that only appears under certain conditions, one of them being that all your print statements are disabled :-)

    6. Re:Debugging by realdpk · · Score: 1

      Even worse is when you do something like use the same function two times in a printf() line. Sometimes, for some reason, it will print the same results for both functions even if the two have different arguments.

      Someone told me it was due to the memory addresses and caching or something. I haven't been able to duplicate it except by accident. :)

    7. Re:Debugging by cK-Gunslinger · · Score: 2, Interesting

      Hehe, I used to belong to that camp, then I began programming on "real" systems. Needless to say, print statements become less than useful when debugging 40+ threads on 16 CPUs, each receiving 100+ messages per second.

      Then again, I never really did find *any* debugging method to keep up with this one application, other than artificially slowing time. :-)

    8. Re:Debugging by cK-Gunslinger · · Score: 2, Informative

      It's not always a memory error. On fast, multi-threaded apps, it is sometimes timing related. That little bit of time it takes to dump some text out to console is often just enough to mask any synchronization problems.

    9. Re:Debugging by mofochickamo · · Score: 2, Funny
      All you need for debugging is print statements everywhere. Always works :)

      Of course it always works. But since you put print statements everywhere your program probably doesn't do much besides print out the same thing every time you run it ;)

      Actually now that I think about it, your program doesn't even compile. You cannot call a print function without first declaring or defining it, but since you used print statements everywhere you obviously haven't defined it.

      No wait! Since you use print statements everywhere you will get a syntax error because your print statement is not inside of another function, but you have no functions because you use print statement everywhere!

      Ok, I'm done being a jackass for today.

      --
      Honk if you're horny.
    10. Re:Debugging by Anonymous Coward · · Score: 0

      Why did you feel the need to be a jackass at all? I usually try to avoid it. You'll make more friends that way. Try it sometime.

    11. Re:Debugging by Viking+Coder · · Score: 2, Funny

      Yeah, printf works real great for coding in OpenGL 2.0 Shading Language.
      </sarcasm>

      --
      Education is the silver bullet.
    12. Re:Debugging by Jeremi · · Score: 2, Insightful
      Actually it doesn't always work...


      This always indicates...


      In other words, adding printf()'s and observing the resulting behaviour change allowed you narrow down what was going on and eventually fix the bug. Or to put it another way, the printf() debugging worked. So your "doesn't always work" claim isn't supported by this example.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    13. Re:Debugging by Anonymous Coward · · Score: 0

      yeah, print statements work real well when you're doing visual c++. TRACE is nice, goes to the output window...

      even better, make a separate window that prints out only your debugging statements. that way you don't mess up your pretty output.

    14. Re:Debugging by Waffle+Iron · · Score: 1
      For high-speed debugging, you can also use the old standby:

      #include <dos.h>

      outp(0x61, inp(0x61) ^ 1);

    15. Re:Debugging by Jage · · Score: 1

      Well, how about logging and examining the logs afterwards? That's how I did in a similar situation.

    16. Re:Debugging by Anonymous Coward · · Score: 0

      No problem, you just print the debug information on the OpenGL textures.

    17. Re:Debugging by SmackCrackandPot · · Score: 1

      You send commands to the NMI register? I always found that the following provided much more detailed information. #include outp( 0x60, 0xED ); outp( 0x60, 0x07 ); sleep( 100 ); outp( 0x60, 0xED ); outp( 0x60, 0x00 );

    18. Re:Debugging by Jester99 · · Score: 1

      fprintf.

      Seriously.
      When I don't have a console to stdout to, I just use a file.

    19. Re: Debugging by gidds · · Score: 1

      You folks may laugh... but he's right! It's the single most versatile, most general, and most widely available method for debugging. I've used it everywhere from my palmtop's built-in language to mainframe COBOL programs, from little Perl scripts to multi-tier Java systems. For anything complex, I find debuggers give either too little information or too much; it's much easier to fine tune print statements to narrow down exactly there the problems are, or at least exactly the information you need to illuminate what's going on. Of course, there's quite a knack involved in knowing exactly what and where to print, but someone who can't debug with print statements isn't a Real Programmer. So there.

      --

      Ceterum censeo subscriptionem esse delendam.

    20. Re:Debugging by Viking+Coder · · Score: 1

      *BUZZ* Thanks for playing!

      The OpenGL 2.0 Shading Language instructions are executed on the video card's GPU. (That's why I mentioned it as a counter-example.)

      There's no files to fprintf to, no console to output to - you're kind of up a creek.

      --
      Education is the silver bullet.
    21. Re: Debugging by 2short · · Score: 1

      I'll go along with most widely available. printf is great when it's all you have. Heck, I use it myself (in alert() form) to debug javascript). But if you've got say, the debugger in Visual C++?
      It will give you all the information printf will, but you don't have to decide what information you want before you get to that point in the code. And it can't very well give you too much information, since it doesn't give you any you don't ask for. Want to see the complete call stack for multiple threads when a particular global variable changes value? good luck w/ printf.

      "someone who can't debug with print statements isn't a Real Programmer"
      Sure, fine. Someone who doesn't use the best tool available to them isn't a Real Programmer either.

    22. Re:Debugging by HuguesT · · Score: 1

      So, can't you use a few pixels on the video card as the output?

      I used to program drivers for embedded network cards. I sometime debugged sending morse code to the blinking collision detection LED.

    23. Re:Debugging by Viking+Coder · · Score: 1

      You could - but the real problem is that right now, the cards aren't capable of enough instructions that you can do that "little bit of logic" that would allow you to intelligently "use a few pixels."

      Also, the instructions you write don't have the random access to the pixels that you'd really need to do what you're suggesting. In essence, you can think of each pixel as being its own processor, but the program you can run on it is SEVERELY limited in capability.

      Most of the time, you're able to decompose the problem into layers, and inspect each layer's output - but it's still pretty tricky.

      It's kind of like being able to have only one printf("%f", data) in your entire program with which to debug. You can eventually figure out what's wrong, but it sure takes a while!

      Fortunately, the programs are not really complex enough to make debugging in this manner that involved - but it's still pretty rough. And as the capabilities of the card increase, you'll be able to run longer and more complex programs - but the debugging tools are just not going to get much better - you'll still only have the one pixel to write to! You can write several different values at once, but you can only visually inspect one, two, or maybe as many as four of them at a time. (R, G, B and you might be able to visually tell something about Z.)

      --
      Education is the silver bullet.
    24. Re:Debugging by ariels · · Score: 1


      This is barely standard (at the very least, it assumes an implementation running on an ASCII machine). Why not use the standard? putchar('\a'); will produce an `alert' character on stdout.

      Even that's not enough to ensure you'll get to hear the alert immediately. At the very least, fflush(stdout); immediately. Or write to stderr.
      </nit>

      --
      2 dashes and a space, or just 2 dashes?
  5. Sweet by Karamchand · · Score: 2, Funny

    That's sweet, four goals: 1.) 2.) 3.) 4.) 4.) ;-) Otherwise, good review! Thank you!

    1. Re:Sweet by Fammy2000 · · Score: 1

      This whole time we just misnumbered:

      1. Write a book
      2. Publish book
      3. Get a review on /.
      4. ???
      4. Profit!!

      --
      If I had something intelligent to say, I would have said it.
    2. Re:Sweet by adrienlamothe · · Score: 1

      Hmmm... whoever edited my review mangled that part of it. The one I submitted didn't have a fourth "4)". That's annoying.

    3. Re:Sweet by Karamchand · · Score: 1

      Now that's interesting. I'd prefer it if they (whoever they are) returned a submitted story with comments on what they didn't like about it instead of editing it (ok, except typing mistakes maybe). I just don't like the idea of really editing things but still telling people it is written by abcdef.
      Cheers..

    4. Re:Sweet by adrienlamothe · · Score: 1

      They didn't editing any of my writing, other than changing the periods to parenthesis, such as "1." to "1)", etc. When they did that, they inadvertently added the additional "4)". Thanks for your feedback.

  6. oxymoron by Anonymous Coward · · Score: 1, Funny

    Practical C++ Programming

    it goes together like linux and microsoft

    1. Re:oxymoron by Anonymous Coward · · Score: 0

      Don't you mean like Hi-C and turkey?

    2. Re:oxymoron by Anonymous Coward · · Score: 0

      Don't you mean like hot dogs and toilet paper squares?

  7. Re:C++ isn't practical anymore by Anonymous Coward · · Score: 0

    Well, off-hand, I'd say anybody that wants some performance out of their programs!

  8. Re:ObOldeQuote by grub · · Score: 2, Funny

    gah I mean "..as Lung Cancer is to Lung"
    I'm a retard.

    --
    Trolling is a art,
  9. C++ bad by Anonymous Coward · · Score: 1, Insightful

    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. Re:C++ bad by NudeZiggy · · Score: 1

      well you could say the same about manually switching relays in a computer instead of abstracting the operation to a high level language. pat yourself on the back for all of the clever computer languages you program with.

      bah.

    2. Re:C++ bad by stratjakt · · Score: 5, Insightful

      C++ encourages you to avoid solving the problem by trying to introduce abstractions

      No it doesnt, it allows you more abstractions that you an use as tools, if they're appropriate. When they're overused or used inappropriately, they detract.

      It's like my neighbour who recently bough one of those power spray painter things. He runs around power-painting everything from lawnchairs to his fence - with often terrible results. But he's a guy with a new tool and wants to use it as often as possible, even though it's really only suitable to use in certain niche applications.

      Or closer to home, observe the student who just learns recursive techniques. They want to write everything recursively - though it's rarely the best solution and just makes for obscure code. They ubiquitously teach it using factorial as an example, when a for loop is a much better tool.

      Such is the way with C++. Not every solution is conducive to an object oriented approach, but it's worth having the tools for the ones that do. The ability to mix and match in large projects is a boon.

      If you cant pick the right tools for the right job, then you're a poor craftsman.

      --
      I don't need no instructions to know how to rock!!!!
    3. Re:C++ bad by Anonymous Coward · · Score: 0

      Clearly you have never worked on a project that required much maintenance or porting.

      That being said, i prefer to use c# or java on big stuff, and c when it comes to the nitty gritty stuff.

    4. Re:C++ bad by pommiekiwifruit · · Score: 2, Funny

      You mean you can calculate factorials without using template meta-programming?

    5. Re:C++ bad by mofochickamo · · Score: 1
      C++ has probably set back the computing industry by 10 years.

      Probably set back the industry 10 years? That you believe it to be so doesn't make it probable. You give no evidence why this is true.

      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)

      There has been much ranting on this topic on ./ (and many other places). I think that most (not all) people believe you should use the right tool for the job. I, for instance, like to use C++ when working with bison because the polymorphism comes in handy.

      --
      Honk if you're horny.
    6. Re:C++ bad by stratjakt · · Score: 1

      You can use pointers and registers and inline asm. Thats how a real he-man calculates 5!.

      --
      I don't need no instructions to know how to rock!!!!
    7. Re:C++ bad by mofochickamo · · Score: 1
      ...i prefer to use c#...

      You were wise to post this anonymously on ./.

      --
      Honk if you're horny.
    8. Re:C++ bad by exp(pi*sqrt(163)) · · Score: 2, Interesting
      You know, sometimes that abstraction serves a purpose. Consider a library like FADBAD++ that allows you to differentiate C++ functions for use in problems like numerical optimization. I'd like to see you implement that code in C. The C++ solution is shorter, more elegant, easier to maintain and very easy to use. In fact, for numerical work in general, generic programming in C++ is an incredibly powerful tool allowing you to achieve the performance of FORTRAN with the conciseness and readability of normal mathematical notation. Blitz++ is a good example too.

      I find that the people who advocate C over C++ have really done nothing but use C++ as a glorified C. Even the people who claim that they are using C++ properly with high falutin' OO methodologies are still writing code that can be transformed into C with a minimum of effort. Code written generically with C++ templates cannot trivially (in a precisely definable sense) be transformed into C code and hence can be used to efficiently solve problems that are a nightmare in C.

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
    9. Re:C++ bad by pileated · · Score: 2, Interesting

      You know you really think that most people must have nothing to do. Whenever they get a new tool, whether circular saw, programming language or exotic spice, they just have to use it everywhere. I guess that's partially just human nature: it's fun to experiment with something new. But they must really not have any serious need for it or they'd just use it for what they needed.

      In my experience I'd say more than 50% of all tool users use them for fun/kicks, not because they have a pressing task to do with them.

      I know this is way off point. I guess I just don't have anything important to do and slashdot is a fun tool............

    10. Re:C++ bad by Anonymous Coward · · Score: 0

      Then you may be interested in lightweight C++ . A C++ to C converter which is more "K&R" as the author sais.

    11. Re:C++ bad by taradfong · · Score: 2, Insightful

      I agree that C++ nightmares come when people misuse its features. And vice versa; triumphs occur when people use the features well.

      But that's the thing - it's too easy to misuse C++'s features. YES, a well-trained, experienced C++ programmer can work wonders, BUT that's like 1% or less of the programming population!

      C++ made a lot of design tradeoffs (e.g. it does not automatically handle allocated space well without extreme programmer care) connected to computer technology EONs ago. It's a really weird, funky balance - it tries to be high level, but also tries not to do anything for you else risk wasting CPU cycles for some corner-case performance hungry situation.

      Like a lot of people, I find myself either using plain old C for things that need it (kernel drivers) and Python/Java for anything complicated.

      --
      Does it hurt to hear them lying? Was this the only world you had?
    12. Re:C++ bad by Grab · · Score: 4, Insightful

      Who told you that the abstraction was going to solve every problem for you? Did you think the C++ Pixies were going to arrive and write your code for you? ;-)

      What C++ (and other OO languages) give you is an abstraction which may make your solution easier to design/code. If this abstraction doesn't match the needs of your problem, use a different one. C++ and other OO languages are perfect for GUI-type stuff, but they suck big-time for writing embedded software. The best hammer is a damn poor screwdriver, and all that.

      If you insist on only using C for GUI applications, good luck - I did some substantial GUI work in X (X11R5) using C about 10 years ago, and trying to use C to emulate object-orientation is one of the abiding horrors in my memory. Equally we had a uni project to design a real-time position controller using C++, and I'm scarred by those memories too.

      What sets the computing industry back is some twonk assuming that a particular methodology (structured design, OO, etc) is a magic bullet. That sucks, bcos it isn't. What also sets the industry back is some other twonk acting Luddite and saying "the old way is the One True Way" (*cough*).

      Grab.

    13. Re:C++ bad by JanneM · · Score: 1

      I partially agree. C++ as a whole is a mess. However, if you treat it as "C++ Lite" or "C with objects" it becomes far more manageable. Yes, polymprphism, operator overloading and templates are powerful concepts. They also tend to bite you in tender areas, no matter how careful you are. Just treat it as C, but with a nifty object type and you will be fine.

      In fact, I'd wish the C standard would pick up the good pieces of C++ for the next iteration.

      --
      Trust the Computer. The Computer is your friend.
    14. Re:C++ bad by be-fan · · Score: 1

      Oh, please. Just take one look at the "generic list" code in the Linux kernel and tell me that it wouldn't have been better if they'd just used templates instead! Or take a look at the driver API and tell me if it wouldn't have been better if they'd just used an abstract base class. Take a look at any code that handles strings and tell me std::string isn't a much better solution. C++ isn't a great language for a lot of things (I too, just use Python when I don't need the speed) but it makes a damn-fine systems programming language.

      --
      A deep unwavering belief is a sure sign you're missing something...
    15. Re:C++ bad by saddino · · Score: 1

      The simple "X is bad" argument is dead before it's typed; as its been said ad infinitum: "use the right tool for the right job."

      Programming in C or scripting language is all fine and dandy, but if you're writing a commercial application with a full blown UI, you really can't beat utilizing a C++ UI framework, whether it's MFC for Windows or PowerPlant for the Macintosh. C++ has its place in the world, and so does C (and Java, and Python, etc.).

      C++ encourages you to avoid solving the problem by trying to introduce abstractions that also don't solve the problem.

      If this is what you really believe, then more I'm inclined to believe that it's only your C++ code that ends up "longer" and "half assed." ;-)

    16. Re:C++ bad by Anonymous Coward · · Score: 0

      hmm... i use assembly, c and c++ everyday at my job. i can do just as much as abstraction with c as i can with c++. not too long ago i employed some c oop techniques (vtable type stuff) for auto detecting/driving different types of printers on a device. the simple abstraction layer made it a lot easier on everyone. i wouldnt be so down on the abstraction stuff. its very useful at times.

      how can you deny things like c++ operator over loading? particularly when apllied to something as simple as the string class. it really makes the programming life a breeze. i just dread having to code certain things in c that are down right stupid simple in c++.

      c++ hasn't set back the indusrty. the set backs come from the under-educated programmers and the oop suckling jackasses that havent taken the time to learn how to use it.

    17. Re:C++ bad by Anonymous Coward · · Score: 0

      > If you cant pick the right tools for the right job, then you're a poor craftsman.

      Certainly, and C++ is almost never the best tool for the job. Many large software products would be much more reliable and maintainable if they had been written in a mixture of a high level scripting language and plain C in the performance critical parts.

      Wait till you've been working on larger projects with a moderate sized team of people in the industry for a few years. You'll change your tune.

    18. Re:C++ bad by PostConsumerRecycled · · Score: 1
      You know, I do the same thing with a new girlfriend. Alway's experimenting, using her everywhere (I can get away with), but no real need for her.

      Also, In my experience I'd say more than 50% of all tool users use them for fun/kicks, not because they have a pressing task to do with them.

      Thank god my girlfriend doesn't read /.

      yeah, yeah, what a slashdotter has a girlfriend, must be a liar blah, blah

      --

      There is no dark side of the moon really, matter of fact it's all dark
    19. Re:C++ bad by crucini · · Score: 1
      Who told you that the abstraction was going to solve every problem for you? Did you think the C++ Pixies were going to arrive and write your code for you? ;-)

      You make it sound silly, but I've heard roughly that sentiment from C++ advocates. I describe what I'm working on in C, and they say, "sounds like a job for C++." Why? "Because the problem space you describe has objects and inheritance."

      What they miss, which grandparent was trying to express, is that the "objects and inheritance" part of the problem is the easy part. There's still a ton of hard work at the heart of the problem. When I'm putting in that ton of work, it really doesn't matter how I handle method dispatch, for example.

      It's actually kind of insulting to the depth of the work to say it could be better written in C++. At least it shows that the advisor has no idea where the real meat of the problem lies.

      I'm not against C++, but at its current state of maturation it is more of a distraction than C is. C is a humble tool which gets out of the way and leaves the programmer free to build the extended paradigms and programming methods needed for a particular app.

      You're probably right about GUIs. I'm not sure you're right about embedded though - I know of one embedded C++ app, and the author certainly had the background to choose C if he had wanted to.
    20. Re:C++ bad by pommiekiwifruit · · Score: 1

      "High-level scripting language" == non-standardised BASIC variant with no decent tool support or static checking, that changes semantics with the phase of the moon.

    21. Re:C++ bad by j.leidner · · Score: 1

      If you cant pick the right tools for the right job, then you're a poor craftsman. But I've never ever encountered a problem that couldn't be solved with my hammer, really. :-)) "If C is your hammer, the whole world begins to look like a nail."

    22. Re:C++ bad by russellh · · Score: 1
      But that's the thing - it's too easy to misuse C++'s features. YES, a well-trained, experienced C++ programmer can work wonders, BUT that's like 1% or less of the programming population!

      sad to say, but I agree, and I'd add that this is true for OO in general (since we're talking about abstraction). Most people just aren't abstractionists.

      It's a really weird, funky balance - it tries to be high level, but also tries not to do anything for you else risk wasting CPU cycles for some corner-case performance hungry situation.

      The thing about C++ is that it really is "C with classes" and not anything bigger. C is a systems programming language, and C++ is a systems programming language with tons of extra compile-time stuff that maybe makes it not so well suited to being a systems programming language. It's critical for people to realize that objects in C++ are not analogous to objects in Smalltalk or even Java. In C++ the difference between a class and an object is quite different than in Smalltalk and Java, so the idea of a design at the class hierarchy level being portable among those languages makes very little literal sense. A single SmallTalk class may require one to five classes in C++ (in my experience, like, so you can become:, have similar polymorphic behavior, etc.)

      Hey, it's Friday night, 11 PM and I'm posting to Slashdot about C++ !

      --
      must... stay... awake...
    23. Re:C++ bad by 2short · · Score: 1

      Bull. You've been programming extensively for 9 years in bad C++. Any language sucks if misused. You should evaluate it based on writing good code.

      You can write almost the exact same code as you would in C, and call it C++. So it's not setting you back any. Some argue that C++ (and OOP in general) don't gain you anything. To put it bluntly, they are wrong. They generally then continue with some example that demostrates that they don't understand the point of OOP. This is partly caused by the fact that everyone you ask will give you a different definition of OOP. I woun't bother defining it, I'll just tell you what the point is:
      "Object Oriented Programming allows old code to call new code" (If anyone can tell me who I'm quoting, I'd apreciate it, I've forgotten)
      In traditional straight-procedural programming, code re-use consists largely of new code calling old code, which is a fine thing. But it's difficult to have old code call new code.

      When I started my current job, I had to write (in C++) some code to do various things with geographic areas. There were two ways geographic areas could be defined (radius around a point or list of zip codes). So I went for one of your useless abstractions and made a base class "GeographicArea" that exposed functions to get the info I would need (e.g. GetArea() or ContainsPoint()) and two derived classes for the radii and the zips. I then wrote various functions that used the base class (e.g. WriteDemographicReport()).

      All in all, that probably took me about the same amount of time as if I had skipped the abstraction. Actually I think it took me less, because I've found that well chosen abstractions encourage me to write clean code free of special cases, so most of the stuff I had to write I wrote once instead of twice. But for the sake of argument lets say it took me the same time.

      Here's where well written C++, and OOP in general, really shines:
      It's now 5 years later. There are now about a dozen derived classes of GeographicArea representing different ways areas on the ground can be defined. I've not even looked at WriteDemoGraphicReport() in the intervening years, yet it works for all the new derived classes. That old code calls GetArea() and gets routed to the new code without me having to think about it.

      That's what OOP is about: code re-use at a level that is not possible (without stupefying hoop-jumping) in a non-oop language.

      If you want to write a progam to solve one problem, and never expand it or modify it after next week, forget OOP. But note that if your manager tells you "We just need this done by next week, we'll never use it again", He's almost certainly wrong.

      In my experience there is no such thing as "quick and dirty". There is "quick because it's clean". There is "clean but takes a while, because that's the way it is". And there is "Dirty because I tried to do it quick, and hence it's going to take even longer". The last one has this tendency to hang around being sucky forever until someone throws the whole thing out and does it the clean way. In many cases, it would be very hard to do things the clean way without C++.

      Practical C++ programming is understanding that most of the C++ you write will be plain old C. And it is understanding when the extra features of C++ are apropriate and how to use them well, because doing the right thing in that small fraction of the code is what is going to let you, the C++ programmer, kick the C programmers metaphorical asses a couple years down the line.

    24. Re:C++ bad by 2short · · Score: 1

      "YES, a well-trained, experienced C++ programmer can work wonders, BUT that's like 1% or less of the programming population!"

      And I'd argue 1% of the programming population gets 99% of the programming work done. Where I work, a number of mostly-comfortable-with-HTML folks use a dirt-simple scripting language which for anything significant calls code written by a couple of well-trained, experienced (are those different?) C++ programmers. As a team, we do indeed work wonders.

      "C++ made a lot of design tradeoffs (e.g. it does not automatically handle allocated space well without extreme programmer care) connected to computer technology EONs ago"

      If C++ has a weakness, I'd say it's that it didn't make ANY design tradeoffs. If there are five ways to do a thing, you can do it 5 ways in C++ (or maybe 6).
      I would consider handling allocated space automatically, which is to say, inflexibly, the design tradeoff.
      How exactly is this (or any C++ feature) realted to computer technology at any particular point, much less "EONs ago"? I don't understand what you're refering to there.
      In any case, memory de-allocation is the thing everyone points too as the thing sure to bite you in C++ (particularly if they're a Java fan). In my experience, it never has. Not once. I can probaly count on one hand the times I've used "new" or "malloc", and I was careful those times. When I started with C++, my boss/mentor pointed out a class he had written: "SmartPointer". Calls new in its constructor, reference counts, calls delete in the last destructor, acts like a pointer otherwise. About half a page of template code. Why it's not in the STL instead of the half-assed auto_pointer I don't know. (OK, I do know: SmartPointer is marginally less efficient than auto_pointer since it has to do an extra allocation; auto_pointer is just as efficient as new/delete but IMHO is pointless because you still have to think; it's in those rabid-for-efficiency cases I've just gone ahead and used new/dellete)

      C++ can be written to be as fast (or faster than) plain old C, so I don't know why you'd need plain C.

      Java beats C++ on platform independence without recompile (which I don't have a need to care about, YMMV) and otherwise blows goats. OK, that's a bit harsh, sorry. But it is typically slower, and it "protects" you from doing things in ways it doesn't want you to, even if it's right for the situation. C++ "protects" me from nothing. That's OK, I can handle it. Sure, I know programmers who can't, but generally they can't handle the problem they're trying to solve in any language, so at least C++ protects me from having to work with them (for very long at least).

    25. Re:C++ bad by 2short · · Score: 1

      "Wait till you've been working on larger projects with a moderate sized team of people in the industry for a few years"

      Been there, doing that. I'm with you on the high level scripting language; that shouold be most of your development, reusing modular peices of efficient code wirtten in? You lost me with the "plain C". Well designed and written C++ is more reusable and maintainable than well designed and written C by a long shot. If it's quite well written, it's just as fast, and in a few cases, faster. Reliability is a matter of code quality and testing; I don't think language enters into it.

    26. Re:C++ bad by taradfong · · Score: 1

      And I'd argue 1% of the programming population gets 99% of the programming work done.

      Ok, great, but if you're running a s/w engineering team, you end up spending a lot of time and heartache corralling the other 99%, or even say 20% if you screened most of the 99% out. It (even now) is impossible to only hire people from the 99% group. Yes, I admire and respect the skill that Ferrari mechanics have, and am sure they can keep a Ferrari running great, but I'd much run Toyotas and have some decent, more ordinary mechanics.

      Where I work, a number of mostly-comfortable-with-HTML folks use a dirt-simple scripting language which for anything significant calls code written by a couple of well-trained, experienced (are those different?) C++ programmers. As a team, we do indeed work wonders

      Exactly. You have isolated the 'dangerous scary stuff' to the surgeons, and left the grunt work to the lower skill workers. You have, in a sense written your own mini programming language interpreter. The only difference between your interpreter and Java/Python/... is that the latter are general purpose, and your is custom tailored.

      Your smart pointer is precisely what I was talking about with C++ tradeoffs. Having self-deleting objects built cleanly into the language would have been a big win, but was not included for performance reasons (I recall reading this in Stroustrup's book, need to look up the reference). If it's part of the language, you could (as Java does) provide an interface to let debuggers track it. And it would indeed be part of STL, albeit with, as I said, some performance impact that some small fraction of users would ever care about.

      Please understand me, I respect the C++ tool, and know it is indeed mighty in the right hands. *BUT* I do think it is a big mistake to consider it the de-facto end-all OO language, and the only 'real' productivity tool for 'real' programmers. CPUs are simply too fast, RAM is too cheap, and other languages are just too much more productive.

      --
      Does it hurt to hear them lying? Was this the only world you had?
    27. Re:C++ bad by 2short · · Score: 1


      Please understand that I was responding to the assertion that C++ is "bad". C++ is pretty near to the high end of the difficulty/power curve. It's not right for everything. The dirt-simple scripting language I spoke of grew out of our early days when everything was in C++, so you wound up needing C++ do, for example, web-authoring. Bad.

      "Exactly. You have isolated the 'dangerous scary stuff' to the surgeons, and left the grunt work to the lower skill workers"

      Well put. Exactly. In my experience, a few very high-end and a handful of fairly low-end developers get much more done than a whole bunch of mid-range developers.

      "You have, in a sense written your own mini programming language interpreter. The only difference between your interpreter and Java/Python/... is that the latter are general purpose, and your is custom tailored."

      More than in a sense. That's exactly what we've done. But our language is much further toward the bottom of the dificulty/power curve than just about anything, certainly Java.

      I guess I just don't have much use for the middle of that difficulty/power curve. In my experience, if the problem you're trying to solve is too dificult for low end, then a programmer who can understand the problem and how to solve it can understand C++.

      I don't agree that smart pointer represents a tradeoff. Those who want it can have it with an hours work, those who don't don't have to use it. Both types of coder are supported. (Most people will be both types at different times) Java would force everyone to use it, in order to protect those who need it but can't figure out that they need it. My smart pointer template is part of the headers I include as a matter of course, so for me, it is part of the language just as much as the STL templates. The debugger also makes no distinction as far as I can tell. The thing I think really rocks about C++ is that well written templates let you build whatever you want cleanly into the language. In Java, garbage collection is the baseline, so the small fraction of users who care about the performance penalty are just SOL.

      "Please understand me, I respect the C++ tool, and know it is indeed mighty in the right hands. *BUT* I do think it is a big mistake to consider it the de-facto end-all OO language, and the only 'real' productivity tool for 'real' programmers"

      I don't consider it the end-all, or only worthwhile language. I do consider it the current high-point for power and flexibility. Which comes with the price of having to know what to do with that power and flexibility.

      "CPUs are simply too fast, RAM is too cheap"
      For a very large number of applications, those statements are just false. Computer power is one of those things where the demand expands to fill the supply. And not just because of inneficient code. When CPUs get faster, you can do things you wouldn't have considered before. The software I write is available in both web-based and desktop flavors. There are numerous things you can do with the desktop version that you can't on the web, and the only reason is that on the desktop, it's your CPU. If you want to pin it at 100% for five minutes, go ahead. On the web, it's a server used by lots of other people. That server is a lot nicer than your desktop box (and certainly puts the lie to the hardware-is-cheap theory), but I can't let you pin its CPU for more than a second or two. As CPU speed increases, the things you can do on that server will be loosened up. But the desktop will stay ahead as we add features previosly rejected because nobody wants to pin their CPU for a month.
      In that server environment, maximally efficient code is essential.

      Java tries to hit a point somwhere in the middle of the power/diffiulty curve. As, I've said, I don't have much use for that point in any case, but in my opinion, Java misses it by trading away a lot of power and flexibility, and still winding up being fairly difficult.

      Obviously, your mileage may vary.

  10. Obvious, ignore by Anonymous Coward · · Score: 5, Funny

    1) Write practical C++ programming book 2) Get it published 3) Have it reviewed on Slashdot 4) ??? 4) Profit!!!

  11. Teaching the user C++... by devphil · · Score: 5, Informative


    ...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)
    1. Re:Teaching the user C++... by stratjakt · · Score: 1

      Koenig & Moo sounds like a great sitcom, or video game.

      --
      I don't need no instructions to know how to rock!!!!
    2. Re:Teaching the user C++... by Anonymous Coward · · Score: 1, Insightful

      Yes, there is value in this, but most of the book is C++ as if it were C plus some new libraries. It works very hard to delay teaching C++

      I taught a beginning C++ class that used this book. It has some nice "these are variables, this is memory, see how they interact" sections for the first time programmer. Which should aid the difficult audience of hose with zero programing experience. As a book an C++, I think it does a poor job. Understand as I write this that I learned C from Kernighan and Richie plus one other ? Efficient C Programing, Weiss ? as a second wording of some things, and then learned C++ from Stroustrup, and Lippman.

      Practical C++ makes every effort possible to delay even mentioning pointers, classes, and the rest of the ++ part of C++ as long as possible. Some gradual build up is good. This book takes it to a determental extreme. I think Thinking in C++ by Bruce Eckel's would be a better first book. For the experienced developer, Stroustrup every day.

    3. Re:Teaching the user C++... by Lord+Omlette · · Score: 1

      Just need to second devphil's opinion. Accelerated C++ is a very good book, I regularly lend it to my friends so they can pick up C++.

      --
      [o]_O
    4. Re:Teaching the user C++... by jejones · · Score: 1

      Final note: [Accelerated C++] 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.

      How delightful! The length constraint means, from what I've seen at bookstores, that no book describing C++ itself can be part of the series. IMHO this says something about the language.

    5. Re:Teaching the user C++... by Anonymous Coward · · Score: 0
      the book is one of the fantastic "C++ In-Depth" series, of which Stroustrup is the series editor. All are very high quality


      I have to agree with this. I bought "Modern C++ Design" by Alexandrescu and it just continually kicks my ass with the amazing things you can bend C++ into doing.
    6. Re:Teaching the user C++... by Anonymous Coward · · Score: 0

      Stroustroup does the same thing with his book "The C++ Programming Language".

      Its the most horrible book I've ever read. The horrible structure of the book reflects the horrible structure of C++ as you mention it.

      For me one should:
      1. Learn BASIC or assembly first
      2. Learn C then and discover how really cool structured programming is
      3. Learn C++ and discover how cool OOP can be.

      Standard library and templates have nothing to do with OOP.

    7. Re:Teaching the user C++... by elflord · · Score: 2, Insightful
      How delightful! The length constraint means, from what I've seen at bookstores, that no book describing C++ itself can be part of the series.

      This is inaccurate. It's more correct to say that a complete reference for C++ cannot be part of the series. Which implies that the series are supposed to be terse tutorial books, not references.

      IMHO this says something about the language.

      It says that the language has a lot of features and a large library. It also says that textbook authors often ramble a lot.

    8. Re:Teaching the user C++... by feloneous+cat · · Score: 1

      Add another PLUS and you not only won't have to know about pointers, but how computers work either!

      --
      IANAL, but I've seen actors play them on TV
    9. Re:Teaching the user C++... by Anonymous Coward · · Score: 0

      I'm I the only one who read Thinking in C++ and thought it was an anti-C book. And then read Thinking in Java and thought it was an anti-C++ book?

      BTW Thinking in C++ and Thinking in Java are both available for free download on the internet. Just google it. (Bruce Eckel put them there. You can also buy published copies.)

    10. Re:Teaching the user C++... by j.leidner · · Score: 1
      I agree, Koenig and Moo do a great job.

      One point that is worth noting that it is very hard to teach programming and a language one the same book! Perhaps the only successful attempt is Abelson/Sussman's Structure and Interpretation of Computer Programs, but that might be partly due to the orthogonality of Scheme...

      "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.

      Yes, that's okay with me--but sadly a dinosaur of a language like C++ can't be fully described in 300 pages at all, it seems (see Bjarne's book). Other languages like C, Java or Scheme can be desribed in much less space and fully understood. I believe a developer should have full command of the syntax of the language, but not necessarily of all the libraries. For instance, Java comes with piles of API functions, but they can be picked up as the need arises while the core language is small and clean (if slow--but that's a problem of the bytecode philosophy, not the language, -- see towerj/gcj).

      Furthermore, most "expert" C++ developers don't have a full command of the core language, but use only subsets they are confident in and are thus potentially unable to maintain other developers' code.

  12. I don't usually bitch about slashdot "reviews" but by captain_craptacular · · Score: 5, Funny

    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
  13. Secure programming by Herrieman · · Score: 3, Insightful

    Any new book - and certainly a second edition- on programming (whatever the language) should have a full chapter on security.

    --
    http://blog.astyran.sg
    1. Re:Secure programming by mofochickamo · · Score: 2, Insightful

      I disagree. While security is extremely important, it does not belong in a book that is meant to introduce the reader to a language. It would be a great waste of paper and money if every language book talked about security. If you want to learn security then buy a book on security. The author merely knowning the language doesn't mean that they understand security issues enough to inform readers.

      --
      Honk if you're horny.
    2. Re:Secure programming by WTFmonkey · · Score: 1

      It depends. Every (beginner's) book on C/C++ needs to cover what a buffer overflow is, what functions have traditionally suffered from them, and some better options. The also need to cover the importance of checking user input to make sure it conforms to whatever you expect. But you're right, it doesn't need to as in-depth as a book completely dedicated to writing secure code.

    3. Re:Secure programming by Grab · · Score: 1

      Why? If your program needs some security measures, that's the time to learn them. Not when you're still just getting the hang of printing "Hello world" to a file.

      Grab.

    4. Re:Secure programming by HuguesT · · Score: 1

      What the parent might mean (I'm not sure) is that there are functions and idioms in C/C++ that shouldn't be used because they are unsafe from the security point of view.

      Things like sprintf (use snprintf), gets(), using arrays instead of vectors, etc.

      If every software developer knew them C/C++ might not be the cause of so many buffer overrun-related security issues.

  14. ghramor roolez by neutrino_man · · Score: 2, Funny
    Ok, maybe I'm being a bit harsh...but reviews really should be edited a bit more before posting.

    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.

  15. free on safari.oreilly.com by asv108 · · Score: 3, Informative

    Why buy the book when you read it on safari, along with thousands of other books with a free 14 day trial..

    1. Re:free on safari.oreilly.com by ihummel · · Score: 4, Funny

      Safari is great, especially for O'Reilly books. But some of us prefer to have the feel of dead trees in our hands when we're learning how to program.

    2. Re:free on safari.oreilly.com by phurley · · Score: 4, Funny

      "Learning to program," oh is that we are calling taking a dump these days?

      --
      Home Automation & Linux -- now I know I'm a geek
    3. Re:free on safari.oreilly.com by the+right+sock · · Score: 1

      Not me, I deploy the subs on a shock & awe campaign....

    4. Re:free on safari.oreilly.com by Anonymous Coward · · Score: 0

      Not me. I drop the kids off at the pool.

  16. C++ bad-Villians. by Anonymous Coward · · Score: 1, Funny

    "C++ has probably set back the computing industry by 10 years."

    Damn! I thought it was Microsoft. Guess I lost that bet.

    1. Re:C++ bad-Villians. by kisrael · · Score: 1

      "C++ has probably set back the computing industry by 10 years."

      Damn! I thought it was Microsoft. Guess I lost that bet.


      Both!

      It's time to party like it's 1983!

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  17. 1st Edition Lacked by 4of12 · · Score: 4, Informative

    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."
    1. Re:1st Edition Lacked by Anonymous Coward · · Score: 1

      Steve O?

      I thought he was busy stapling it butt cheeks together and getting arrested...

      Heh, Jackass....

    2. Re:1st Edition Lacked by macrom · · Score: 1

      The Meyers and Josuttis books are of little use to a programmer new to C++ or even new to programming in general. They are books designed to extend your basic knowledge of C++ into something more advanced.

      I am about to start teaching a C++ class to several co-workers. The 2 of us "professors" will use Accelerated C++ and the Dietels' book. I would only recommend your selections to programmers familiar enough with C++ to be dangerous, but need to gain a deeper understanding of the language.

    3. Re:1st Edition Lacked by CrazyTalk · · Score: 0

      I would add the O'Reilly "C++ The Core Language" to the list - very readable and concise (I hate those 1000+ page books of mostly filler). I always go back to it for a quick review when I've been away from the language for awhile.

    4. Re:1st Edition Lacked by Anonymous Coward · · Score: 0

      The Effective C++ books by Meyers are fine books indeed, but they are not learn C++ books. You need to have a good grasp of C++ before you read them, they simply explore some of the more advanced areas and potential pitfalls that a moderately experienced C++ user might face.

    5. Re:1st Edition Lacked by egoots · · Score: 1

      Once you get a baseline of understanding, I highly recommend Herb Sutter's "Exceptional C++" and "More exceptional C++" books.

  18. The first edition ... by Chromodromic · · Score: 5, Informative

    ... 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
  19. Changes from the first edition ... by Frater+219 · · Score: 2, Funny
    4) 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.

    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!

  20. Re:I don't usually bitch about slashdot "reviews" by Anonymous Coward · · Score: 0

    Thank you for my first laugh of the day. I especially liked the "shitload of highlighters."

  21. How comprehensive? by mgs1000 · · Score: 2, Funny
    You forgot to talk about the most important chapter, with the information every C++ programmer needs to know:

    Chapter VII: How to sign up for unemployment benefits.

  22. Re:I don't usually bitch about slashdot "reviews" by Anonymous Coward · · Score: 0

    I think he meant to say "empathize"; this review really sucked.

    The reviewer casually states that "the terms instantiation, polymorphism and encapsulation are not used in the book". A book about C++ that does not contain these terms is a book about a C programmer hacking away at concepts not understood. Either the reviewer did not think this was important because he did not feel it was a critical concept in C++, or he did not completely read the book. Either way he is incompetent.

  23. Re:I don't usually bitch about slashdot "reviews" by Anonymous Coward · · Score: 0

    I think the word he wanted to use is "empathize"

  24. Don't forget by MSG · · Score: 2, Funny

    Goal 4) teaching proper iteration.

    1. Re:Don't forget by Anonymous+Brave+Guy · · Score: 1

      It wasn't iteration, it was tail recursion. :-)

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  25. why bother? by Rumagent · · Score: 2, Funny

    When we can steal it all from SCO...

  26. OO Features of C++ by mofochickamo · · Score: 2, Informative
    I would like to have seen a more detailed and complete explanation of the object-oriented aspects of C++ (including more diagrams).

    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.
    1. Re:OO Features of C++ by iantri · · Score: 1
      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.

      Whatever you're smoking, can I get some?

      (IANAP: This makes absolutely no sense to me.)

  27. I need an OS to program for by WebMasterJoe · · Score: 3, Interesting

    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.
    1. Re:I need an OS to program for by Anonymous Coward · · Score: 0

      Well, to write a book on modern-day applications would be to limit the reading audience to an operating-specific sect. Modern Windows GUI programs use .Net (yum) and MFC (yuk). By using either of those, you're limiting yourself to the Windows OSes. And the same goes for Linux or Mac, you can find Gtk or another technology but more often than not, it will only work on a particular OS. This is one reason why you don't see a lot of books on modern apps; writing one limits the audience, and hence the sales.

      There are some, of course. If you're looking for a book on building modern Windows applications, O'Reilly has an interesting book on using the .Net Windows Forms http://www.oreilly.com/catalog/netwinformian/

    2. Re:I need an OS to program for by mark_lybarger · · Score: 1

      linked lists and binary trees are worthless pieces of crap. actually they're very usefull, just that people don't really code them that much. with c++, there's the STL and all its vectors, lists etc. in java, there's the collections and associates. it's good to know which one to use and where to use it. the details of how to hold those pointers in an internal array and how do i delete an item from a linked list out of the middle of the list is just pointless for anyone other than a library maintainer.

      there's plenty of books on writing gui applications. kde bible, Visual C++ in 21 days. Visual basic books up the yazoo, even a few java gui books. what lots of these books lack is guideance in general in creating a gui application. what works best and where. what makes a gui "user friendly" and how do i make one.

    3. Re:I need an OS to program for by Anonymous Coward · · Score: 0

      Mastering C++ takes time, practice and patience. Jumping headfirst into GUI development without first taking the time to understand C++ / data structures / general concepts of computer science will not result in extraordinary success. Most likely, you will be overwhelmed by the complexity of GUI programming and give up.

      If you want to get into GUI programming quickly, Visual Basic, C# or Java would most likely be your best bet.

    4. Re:I need an OS to program for by illsorted · · Score: 2, Insightful

      Have you checked out Advanced Linux Programming? That combined with a good book on C++ would probably give you what you're looking for.

    5. Re:I need an OS to program for by WebMasterJoe · · Score: 1
      Mastering C++ takes time, practice and patience. Jumping headfirst into GUI development without first taking the time to understand C++ / data structures / general concepts of computer science will not result in extraordinary success. Most likely, you will be overwhelmed by the complexity of GUI programming and give up.
      Please, look at my original post. I'm not trying to fast-track my way into writing the next MS Office replacement. I already learned data structures. I already learned the basics of C++. I know the "general concepts of computer science," too. And for the record, I know the basics of programming in C, C++, Java, VB, Perl, COBOL, Assembler, Prolog, PHP, SQL, and I wrote a few video games for my TI-82 when I was in high school. I started programming in BASIC when I was six. C-64, Apple IIe, and TRS-80, before moving on to Amiga, MS-DOS, MacOS, Windows, AIX, BeOS, Linux, Solaris, QNX, and, unfortunately now, SCO Unix.

      I wouldn't be listing all this, but clearly you thought my post was akin to "hi guys i wanna write a game like halflife or doom any1 have any advice?" Of course, it's hard to take your response seriously when you post anonymously, anyway. And thanks to the other responses, where it is obvious that these people were reasonable people who read my original post and weren't just looking for a chance to tell me that I couldn't possibly understand all those big scary concepts like you do (oh, you're so smart), and I might as well just stick to VB.
      --
      I really hate signatures, but go to my website.
    6. Re:I need an OS to program for by Jmstuckman · · Score: 2, Interesting

      I had the same problem as you did with Windows GUI programming. The first thing I tried was the GPL'd "FLTK" library -- it acts as a (somewhat platform-independent) buffer between you and the raw Windows GUI code. The real solution for me was learning Java -- the classes for what you want to do (GUI programming, internet, etc) are built into the standard class library, and every Java book will tell you how to do this stuff. (I didn't even need that -- the docs on Sun's website are very good.)

  28. Modern C++ Book? by ignoramus · · Score: 5, Insightful

    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:

    • Everything you can find that has to do with automated memory management (smart pointers and such)
    • The STL. The STL. I know it's a rite of passage, but I'm tired of seeing every newbie struggling with his own linked list implementation
    • Reuse. The Boost library can teach you a lot about this and demonstrate that focusing on your problem is more fun than writing boring code that's been done a million times before
    • Design patterns. At least an introduction, dammit.
    • Generic programming, in general ;)

    Just my $0.02 for potential authors out there.

    1. Re:Modern C++ Book? by X · · Score: 1

      There are a bunch of books that address these areas. Some quick ones off the top of my head:

      Modern C++ Design
      Exceptional C++
      The Standard Template Library
      IOStreams and Locales
      Effective C++

      I could go on. Sadly though, not nearly as many C++ programmers read this kind of stuff as should.

      --
      sigs are a waste of space
  29. Offtopic by Anonymous Coward · · Score: 0

    Is there any tools out there that shows how your variable are getting stored?

    i.e. If you had a const variable, char s[20], char *t. It would show how these would 'look' in memory and what gets changed when you say s[2]='z';

    It would mainly be a learning tool but if it was done well enough i guess it could also help some folks debug.

    1. Re:Offtopic by datan · · Score: 2, Informative

      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.

    2. Re:Offtopic by Anonymous Coward · · Score: 0

      Not a big fan of Viusal C++, but I will check it out. Thanks for replying to an AC. :-)

  30. Factor patent abuse into the cost of Amazon books by abe+ferlman · · Score: 0, Offtopic

    Reduce their margins and they'll eventually fold or be bought out by someone less prone to abuse the ip system.

    Don't give Amazon any of your money until they clean up their act. You can afford the difference, you can't afford to overturn bad patents later.

    --
    microsoftword.mp3 - it doesn't care that they're not words...
  31. Paging system broken? by Anonymous Coward · · Score: 0

    Hey, what's up with the paging system? It only shows 50 (no metter what my settings say) and when I click from (1) to (2) there's often a ton of overlap, even when there are 5 or 6 pages. 'sup widdat?

    1. Re:Paging system broken? by DrSkwid · · Score: 0, Offtopic

      when a thread overlaps a page it reprints that thread from the parent onwards

      If you really give a shit you could always RTFS

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    2. Re:Paging system broken? by Anonymous Coward · · Score: 0

      Or, I could just ask and let someone answer without having to RTFS. I don't have enough time to look at my own source, let alone try to wrap my head around a completely foreign perl script.

      Thanks for the answer, though.

    3. Re:Paging system broken? by Anomalous+Cowturd · · Score: 1

      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

  32. zuh? by rootofevil · · Score: 1

    >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
    1. Re:zuh? by Anonymous Coward · · Score: 0

      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.)


      Americans spell it empathize -- dictionary.com will show you a definition for that. m-w.com will show you definitions for both variants.

    2. Re:zuh? by grahamlee · · Score: 1

      I usually attempt to steal definitions from dictionary.com, but if this definion thing floats your boat, bully for you.

      Also, I only use dictionary.reference.com when I don't have access to dictionary.oed.com :-)

  33. Sorry but... by mikeophile · · Score: 1

    Counting four twice still makes it five.

    1. Re:Sorry but... by Anonymous Coward · · Score: 0

      No, there are FOUR lights!
      </startrek>

  34. C Zealot by Anonymous Coward · · Score: 0

    Someone should read the moderator guidelines and mod the parent down as flamebait -- geez.

    Just because some people are poorly educated, doesn't mean that they should be lauded for their incorrect views, just because there aren't enough people who know they are wrong....

  35. Reference Card by nycsubway · · Score: 3, Informative

    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.

    1. Re:Reference Card by CoolCat · · Score: 1

      Where were you with this link back in the days when I was learing c++? ...

  36. So It Goes by Lucas+Membrane · · Score: 2, Insightful

    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.

  37. Everybody Knows... by Anonymous Coward · · Score: 0

    1. Write incoherrent crappy code.
    2. Comment and format it heavily.
    3. Win "Programmer of the Month" Award.

  38. Re:Factor patent abuse into the cost of Amazon boo by Anonymous Coward · · Score: 0
    Yeah, right.

    I keep buying at Amazon just to piss off people like you.

  39. C/C++ book anti-recommendation by mzs · · Score: 1
    Never buy a book by Herbert Schildt. They are typically full of errors and programming pitfalls that make experienced coders and language lawyers cringe.

    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.

  40. Great advice. by Kirby · · Score: 3, Insightful

    >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
    1. Re:Great advice. by e-Motion · · Score: 4, Insightful

      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...


      Unfortunately, C++ is complex, and undefined behavior will upset most attempts at experimentation. For example, suppose a beginning C++ programmer wants to change a string's contents so it contains the text "Count is $count" (Perl-ish code). Most of the time they try stuff like:

      int count = ...;
      string s = ...;
      sprintf( &s[0], "Count is %d", count );
      sprintf( (char*)s.c_str(), "Count is %d", count );

      Does that work? Well, maybe, but the code's not guaranteed to work, and it's dangerous. But the problems with the code will not be recognized by the beginner, and therefore experimentation can lead him to assume something is correct even when it is not. The generally accepted answer of

      ostringstream oss;
      oss << "Count is " << count;
      string s = oss.str();

      is not likely to be discovered through experimentation.

      In general, I agree that experimentation is good. C++ just isn't a safe environment and makes trial-and-error programming difficult.

  41. What's Cheaper & Where (why just B&N and A by TastyWords · · Score: 3, Informative

    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

  42. Re:C++ isn't practical anymore by Anonymous Coward · · Score: 0

    And in the case of C#, don't want to get locked in the Microsoft world.

  43. they why bother? by taradfong · · Score: 3, Insightful

    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?
    1. Re:they why bother? by devphil · · Score: 2, Insightful
      if you're going the 'don't need to understand 'C', pointer-free,

      Bzzzt. Go back and read it again.

      The idea is that you don't have to learn C before learning C++. That you don't have to learn pointers before learning dynamic expansion of storage. You've conveniently forgotten the last bits.

      Nobody ever said anything about not learning these things at all, not learning the entire language. That'd be stupid.

      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.

      Fortunately, you're in the incorrect minority. Most people who feel like that had a bad experience with the STL, back before it was standardized, before the language itself was changed to make things easier. Since then they've found that it's much better than they first thought.

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    2. Re:they why bother? by pclminion · · Score: 1
      Most people who feel like that had a bad experience with the STL, back before it was standardized, before the language itself was changed to make things easier.

      hash_map is still not an official standard. Until it is, STL will remain a joke.

    3. Re:they why bother? by Anonymous Coward · · Score: 0

      hash_map is still not an official standard. Until it is, STL will remain a joke.

      So...Knuth's Art of Computer Programming is a joke because it's not complete yet? (although I hear volume 4a is due out by next year -- yay!)

      and Richard Stevens' Unix Network Programming is a joke because he died before he could finish the 3rd volume?

      Gee...what an idiot.
      Why don't you go to boost.org and get a hash_map there that will likely be a part of the next revision of the standard.
      And, yes, hash_map is already scheduled for inclusion in the c++0x standard.
      By the way, the STL is designed to be extendable -- if it ain't in the stl, you can write your own. One of C++'s strengths is in the area of library design.

    4. Re:they why bother? by code_martial · · Score: 1
      hashmap is available from SGI and GNU also ships it in its TL. Which means that though it isn't standard yet, it's fairly easily available.

      I would hazard a guess from the language of your post that you really don't consider usage of hashed lookups that hard. I'll give you the reasons why (red-black tree) map could be better than hashmap in some cases:
      • Though it's really cool to be able to search in constant time, hash functions are fairly more complex than the simple comparison functions that tree based implementations use. So, for small sets of data, RB tree based implementations may outperform hash based implementations.
      • Tree based implementations have a guaranteed worst case complexity of O(log(n)) whereas the worst case case complexity of a hashmap would be O(n). If your design critically depends on the performance of lookup, once in a while you may have to deal with really unexpected performance.
      • There's no defined order of iteration over the keys of a hash table.
      • Perfect hash functions (that don't result in collision) are difficult to invent, computationally intensive and require that the number of buckets available be definitely not less than the number of elements to be stored. Now think what you'll have to do if your keys are arbitrarily long strings.
  44. Re:I don't usually bitch about slashdot "reviews" by Bob(TM) · · Score: 2, Insightful

    He probably meant to type 'empathize', though I agree with your criticism.

    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 ... OK ... so, which was it? Does it do a good job or does it fall short?

    --

    The little guy just ain't getting it, is he?
  45. Re:Factor patent abuse into the cost of Amazon boo by Anonymous Coward · · Score: 0

    And I keep buying an B&N just to piss off people like YOU!

  46. Another One? by Wiseazz · · Score: 3, Interesting

    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.
    1. Re:Another One? by Anonymous Coward · · Score: 1, Interesting

      I can tell you why. Book publishers - the people publishers, not the business publishers, have to make money. I did some work for one of the largest (at that time). They were allowed to print books for that year and "make the numbers". The president of the division promised his corporate bosses a 20% increase of the year before but made his individual publishers promise a 30% increase. That way, if they fell short of the 30%, they'd hope to have made the 20% and he'd look good.

      Now, let's assign a name to a phrase many are familiar with (here's a way to sound smart in the future): The Pareto Principle. The Pareto Principle is the infamous "80/20 rule". In the publishing world (and practically any other business), 80% of the revenue/profits come from the best-selling 20%. The remaining 80% of the goods produce the remaining 20% of the revenue. The trick is to find the right 20% and make them "right", then find enough other "reasonable" things to sandbag the slack.

      On top of all of this, many (if not nearly all) of the people who are inside the actual publishing business do not know the technical world - they don't know a bit from a byte unless they're familiar with it from being around the books all of the time. This is not a slam on them - they're editors, not programmers.

      Another interesting tidbit about book selections: You will rarely find one book about a topic. If you only find one, it's because it's either: so good every publisher knows they can't touch it so it's not worth the time & effort to try & do so; or, it's so bad it doesn't sell and it's thought the market is so soft it's not worth the resources. If two books appear about a topic and they sell, look out! As soon as you have two, you'll have three, four, etc. It's presumed if the market can support more than one, it can always support one more than what's already there.

      Finally, there are books which focus on being "day & date" with a product - their book will be out the day the software product is out - the book may not be good, but it's available such that anyone who buys the product can buy the book. Generally, these books suck, but by the time the decent books come along and displace the sucky books, the publisher of the worthless books have already moved on their schedule to the next day & date books.

      Oh, two other issues affecting book qualities: to get a book out on time, there are frequently extra authors, who may (or may not) be mentioned in print. This is to help get the book writing (and into the editors' hands) as quickly as possible. The same goes for editing: If you have a twenty-chapter book, hand two chapters to each of ten editors and tell them to turn it in tomorrow. Tada! It's edited. Another tidbit: editorial staffs of the quicker-paced book publishing firms (usually the day&date types or date-specific books) have an exceptionally high burnout rate so there's constantly a need to train new editors to get them up to speed.

    2. Re:Another One? by Anonymous Coward · · Score: 0

      It could be worse.

      It could have been this book.

      *shudder*

      damn hacks.

  47. Spoiler by bdigit · · Score: 1

    Great now I dont have to buy it now that I know how it ends! Thanks Timothy!! *note this is supposed to be funny

  48. Re:I don't usually bitch about slashdot "reviews" by Hard_Code · · Score: 1

    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?
  49. Steve Oulline by devphaeton · · Score: 2, Interesting

    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(); // try();
    1. Re:Steve Oulline by devphaeton · · Score: 1

      I guess i should've looked twice at the name..

      Steve Oualline

      Damn typos!! I blame the reviewer!

      --


      do() || do_not(); // try();
    2. Re:Steve Oulline by Jeremi · · Score: 1
      "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++"


      As a C++ programmer, this doesn't make sense to me. C++ supports both prefix and postfix operators. Any idea what the author was talking about?

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    3. Re:Steve Oulline by Anonymous Coward · · Score: 1, Interesting

      Postfix ++ isn't really easier, but it is less efficient. It's supposed to return a copy of the previous value, which is hard for the compiler to optimize away. Prefix ++ can simply return a const ref to the object.

    4. Re:Steve Oulline by bovinewasteproduct · · Score: 1

      As a C++ programmer, this doesn't make sense to me. C++ supports both prefix and postfix operators. Any idea what the author was talking about?

      Just the fact that the prefix operators don't require a temp variable; so if you just need the side effect, use prefix.

      BTW, you don't have to do this, but it's just about idomatic for C++.

      BWP

  50. Compared to first edition? by friendofafriend · · Score: 1
    Anybody have any idea how this shapes up to the first edition?

    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?

  51. Referral-free link by Anonymous Coward · · Score: 0

    And here is a link with no referral parameter in it.

    If you're going to be making money off us, at least have the courtesy of letting us know.

  52. Multi-threaded timing by Latent+Heat · · Score: 1
    The standard way to debug anything is to trace execution and to reveal the program state at points along that trace. A debugger with watches, breakpoints, and variable evaluation is perhaps a runtime counterpart to the edit-compile-execute cycles of printf() statements, so apart from the quickness of the debugger, I don't see what is so different with printf(). The debugger is so supposed to be more inobtrusive (printf() masking a bug by shifting stuff around in time or in memory space), but I am hardpressed that a debugger makes such bugs (your thread time-synch problem, stack overflow, variable overwrite) that much easier. You are going to have trouble with a debugger or with printf() in those cases.

    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.

    1. Re:Multi-threaded timing by Twylite · · Score: 1

      Visual C++ (and I believe Borland's C++ Builder post v4) support debugging across libraries and processes. Just start your EXE and make sure all the DLLs have debug information, and you can happily put breakpoints into them, step into them, etc. Also works for out-of-process components, although the best there is to run the component in a separate IDE/debugger session.

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    2. Re:Multi-threaded timing by kruntiform · · Score: 1

      You can just call win32 function OutputDebugString (or the TRACE macro, but that may just be MFC) and the debug messages will show up in Visual Studio's debug window. DebugView from Sysinternals will also show debug messages.

    3. Re:Multi-threaded timing by Inthewire · · Score: 1

      I've had some success by setting breakpoints in the code, hitting CTRL + F5 to get the dll running, then loading the object.
      It seems to me that if you don't have the .dll registered (maybe even if you do, I can't remember) that the calling program executes the one you have running in the IDE and you can then treat it the same way you would an .exe that is in step-mode.

      Hope that helps.

      --


      Writers imply. Readers infer.
    4. Re:Multi-threaded timing by 2short · · Score: 2, Insightful

      "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?"

      Uh, use Visual C++? All my apps are split into DLLs. When I'm stepping through something in the debugger, I neither notice nor generally care that I've crossed a DLL boundary. (Except when I'm tracking a memory leak, in which case I notice on purpose...) Most of the time I'm setting a breakpoint deep in the guts of some dll and letting the rest just run until it gets there. Seriously, what's suposed to be the problem with debugging into dlls?

      Not sure what you mean by running a DLL "stand-alone". Most dlls don't stand alone. the debugger will tell you everyting passed in to a dll function, at which point it shouldn't matter what called it; ocasionally I write a stupid exe to call one function I think is a problem, but just to speed the debug cycle.

  53. Simple by Anonymous Coward · · Score: 0

    Slashcode sucks. It was written by retards.

  54. The Third Edition by tds67 · · Score: 2, Funny
    The book actually has four goals: 1) Teach the reader C++. 2) Instill good programming style and practice (indeed, the book's subtitle is 'Programming Style Guidelines.') 3) Teach the programmer basic software development concepts. 4) Introduce the reader to debuggers and the make utility.

    ...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.

  55. Re:Factor patent abuse into the cost of Amazon boo by abe+ferlman · · Score: 1

    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...
  56. Re:C++ bad, Here, Here! by __aanonl8035 · · Score: 1

    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.

  57. Speaking of the book's rating on amazon by snooo53 · · Score: 2, Informative
    Anyone else notice that the customer reviews are 2 out of 5 stars? Not terribly impressive. I tend to look very closely at the customer reviews for before buying something, and I'd immediatly flag anything that had this few reviewers and such a low rating, be it a book, movie or hardware.

    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.
    1. Re:Speaking of the book's rating on amazon by revividus · · Score: 3, Interesting
      Deitel and Deitel is an acquired taste, I think. I have used one of their books (the Java one) and it was all right(read: it was better than my actual textbook), so I guess I could agree with you.

      On the other hand, if I hadn't read one, just because it's a standard textbook, I would probably avoid it. I have never yet had an assigned textbook that was worth even a quarter what I paid for it. Both my Java textbooks gathered dust while I studied for classes (no pun intended) out of an OReilly book and the aforementioned Deitel and Deitel book.

      In summary; I agree that the Deitel's title may be a good recommendation (depending on your learning style) but not because it's a common textbook -- more like in spite of the fact that it's a textbook.

      And as far as `Practical C++ programming' goes, I've read parts of it already, and it's been on my `to purchase soon' list before I even read this reveiw. Steve Oualline is a good writer and explains C/C++ clearly and with some humor.

      Just my 0010 cents...

  58. "Occasional misleading statements" by knuth · · Score: 1

    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.

  59. Full of bad code by WebMasterJoe · · Score: 2, Funny
    The reviewer says the examples have lots of errors, and I couldn't agree more. Here's just one example:

    for (bp = mapstart(mp); bp->m_size; bp++) {
    if (bp->m_size >= size) {
    a = bp->m_addr;
    bp->m_addr += size;
    if ((bp->m_size -= size) == 0) {
    do {
    bp++;
    (bp-1)->m_addr = bp->m_addr;
    } while ((((bp-1)->m_size) = (bp->m_size)));
    mapsize(mp)++;
    }

    ASSERT(bp->m_size

    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.
    1. Re:Full of bad code by the_germ · · Score: 1

      Wow, wasn't the subtitle something like 'Programming Style Guidelines'? This must be some bad example to show how not to do it.
      Something like 'if ((bp->m_size -= size) == 0)' is really bad style!

      I haven't read the book, but if this is the authors understanding of 'good style' then it's definitely not worth reading.

      -----------------

  60. obligatory... by Anonymous Coward · · Score: 0

    In Soviet Russia, Practical C++ program you!

    Cheers!

  61. Good point. by pclminion · · Score: 1
    But it didn't work the way you expected it to :-) And sometimes (e.g., late at night, early in morning) that makes it harder to infer the real cause.

    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.

  62. THAT'S A DIFFERENT BOOK MORON by Anonymous Coward · · Score: 0

    see the subject... 'nuff said

  63. Same old... by silent_poop · · Score: 1

    How is this different then any other C++ book out there?

    --

    --
    silence is poetry.
  64. no real errors in the book by calethix · · Score: 2, Funny

    "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.

    1. Re:no real errors in the book by gt25500 · · Score: 1

      That's awesome to run a class and give bad code out, using "find the bugs" as a cover up for you zero knowledge of the language. That's what hapened in MY class at least...

      Now to write a buggy program and have my users fix it themselves... Boy that makes me think of some game developers now-a-days....

      --
      _________ Help me get a PSP!
    2. Re:no real errors in the book by adrienlamothe · · Score: 1

      There are two types of source code errors in the book: 1. Intentional errors that the author explains. 2. Unintentional errors that are not explained. The second type of error can be very frustrating for novice users; this is the type of error I find unacceptable.

  65. Re:I don't usually bitch about slashdot "reviews" by CrazyTalk · · Score: 0

    I empathize with his editor.

  66. can't do basic math, eh? by Anonymous Coward · · Score: 0

    since when is $29.76 cheaper than $27.97...dufus

  67. STOLEN SCO CODE by Anonymous Coward · · Score: 0

    the following code is property of sco. congratulations, you just bought yourself a lawsuit.

  68. Re:I don't usually bitch about slashdot "reviews" by Anonymous Coward · · Score: 1, Informative
  69. Re:I don't usually bitch about slashdot "reviews" by Evil+Grinn · · Score: 1

    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?

  70. Parent is anything BUT insightful by Anonymous Coward · · Score: 0

    "I already knew C so I can't be bothered to learn C++ because its so different! Wahhh"

  71. Re:Factor patent abuse into the cost of Amazon boo by Anonymous Coward · · Score: 0
    Why are people so hostile to political awareness? I don't understand it.

    Because if one doesn't feel anything towards the cause, then the noise that the activist makes is just that: noise. And noise tends to piss me off.

  72. Review critique, book critique by stew1 · · Score: 2, Informative

    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

    1. Re:Review critique, book critique by Anonymous Coward · · Score: 0

      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).

      Clean your glasses dude... then you will see things get a litle brigther, and seconds later you will able to distinguish different colors. Thats the point where you will see the green/grey box containing the info you are whining about... Well most of it anyway..

      DOH!

  73. Re:Factor patent abuse into the cost of Amazon boo by abe+ferlman · · Score: 1

    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...
  74. Politician's Review by Eberlin · · Score: 1

    "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?

  75. Text of the article in case it gets /.ed by Anonymous Coward · · Score: 0

    Practical C++ Programming, Second Edition
    author Steve Oulline
    pages 549
    publisher O'Reilly & Associates
    rating 7
    reviewer Adrien Lamothe
    ISBN 0596004192
    summary Guide to learning C++ and programming style.

    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.
    You will have to read most of the book in order to learn C++, although there are a number of chapters you can avoid if your goal is to learn only the language's mechanics.
    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

    1. Re:Text of the article in case it gets /.ed by rbohac · · Score: 1

      Right... In case slashdot gets slashdotted?

  76. Are reviews worth it? by john_smith_45678 · · Score: 1

    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.

    1. Re:Are reviews worth it? by isoga · · Score: 1

      Good point...this amounts to reviewers being paid for the review...Something that has never been mentioned before

    2. Re:Are reviews worth it? by adrienlamothe · · Score: 1

      Can you explain how to make money from an "affiliate link?" I haven't made any money from this review, but I'm certainly open to suggestions ;)

    3. Re:Are reviews worth it? by john_smith_45678 · · Score: 1

      This:

      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.

      That's not the reviewer's affiliate link? If not, I guess it's slashdot's? I can't imagine somebody putting together a review if there's not something in it for them (it's their book, their site, their affiliate link, etc.) ;).

    4. Re:Are reviews worth it? by adrienlamothe · · Score: 1

      O'Reilly gave me the book to review, because I thought it looked interesting. I haven't received any other compensation, other than the free book.

  77. Re:Factor patent abuse into the cost of Amazon boo by Anonymous Coward · · Score: 0

    and the more profit Amazon makes the more I (and folks like me) will complain.

    Then you shouldn't have anything to complain about: Amazon.com doesn't make a PROFIT!!

  78. Good grief! by Anonymous Coward · · Score: 0
    4) Introduce the reader to debuggers ...
    This is apparently after 1) Teach the programmer C++, 2) Instill good programming style and practice, and 3) Teach the programmer basic software development concepts.

    The case rests.

  79. Programming with computers? Bah! by MonkeyCookie · · Score: 2, Funny

    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.

  80. You're right about one thing by ttfkam · · Score: 1

    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.
  81. Re:C++ isn't practical anymore by Anonymous Coward · · Score: 0

    Or multiple inheritance. Or a language thats fully ANSI standardised with a multitude of compilers. Or even a language that doesn't change every three years, come to that.

  82. How to write web application in C/C++? by mr_majestyk · · Score: 0

    Can anyone recommend a toolkit that will let me write a web application in C or C++? I'm talking about an API that will automate generation of interactive web pages with drop-boxes etc. that can be used by a database application.

    Everyone seems to be using PERL or Java to do this now, but I don't know those languages. I do know C/C++ pretty well, though.

    Is there anything for Linux or Windows that will let me prototype C/C++ web applications quickly?

    PS: I am looking for answers other than "Just learn PERL or Java"

    1. Re:How to write web application in C/C++? by Anonymous Coward · · Score: 0
      Just learn PERL or Java.

      HTH

    2. Re:How to write web application in C/C++? by Anonymous Coward · · Score: 0

      In theory you could write ASP.NET code in 'managed c++'.

  83. Re:C++ isn't practical anymore by Anonymous Coward · · Score: 0
    Acutally, Perl has MI, but you have to look to Eiffel for MI done right.

    It's nice that there's a ISO (also ANSI) C++ standard. It's also nice that there are lots of compilers. It's just a shame that the compilers don't implement the standard. I think there's exactly one fully conforming compiler available today, and it's completely proprietary (and very expensive as well).

  84. User input?? by exp(pi*sqrt(163)) · · Score: 1

    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.
    1. Re:User input?? by WTFmonkey · · Score: 1
      Oh c'mon. You don't actually mean that, do you? Shit, do you drive your car thinking, I'll never actually have to use that windshield wiper, why bother kearning how to turn it on? When (if you ever have) you shoot a gun, you need to know the safety precautions you need to take in EVERY SITUATION, not just on the firing range-- shit backfires.

      What does user input have to do with C++?
      The same it has to do with any computer system. Limited-scope people like you arethe reason buffer overflows exist in the first place. Everything you mentioned ( 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, sound familiar?) can also be done in BASIC or Fortran.

      The truth is, if you had been taught how program correctly in the first place, this wouldn't be an issue. Please, go read a book. Thanks.

  85. My take. by Anonymous Coward · · Score: 0

    The first edition was singularly the most useless book I have ever paid money for.

  86. Re:What's Cheaper & Where (why just B&N an by rbullo · · Score: 1
    (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 next time you want to use parentheses, don't.
    --
    OH NOES!!! IT APPEARS YUO DO NOT HAVE ENOUGH MONEY TO PAY FOR DIS HERE PIZZA! WAHT EVER ARE YOU GOING TO DO!?!?
  87. Beginners start with C before or going to C++? by nighty5 · · Score: 1

    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?

    1. Re:Beginners start with C before or going to C++? by Anonymous+Brave+Guy · · Score: 1

      General concensus is that you don't need to (and shouldn't) learn C first if C++ is your ultimate goal. By all means learn C if you want to use C, but if you want to use C++ then just go straight there.

      For somewhat more detailed arguments, have a read of Bjarne Stroustrup's FAQ...

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    2. Re:Beginners start with C before or going to C++? by nighty5 · · Score: 1

      Thanks Brave Guy.

      The website looks good!

  88. C was the sweet spot by crucini · · Score: 1

    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.

    1. Re:C was the sweet spot by Paleomacus · · Score: 1

      A lot of us already consider it bizarre and pointless .

    2. Re:C was the sweet spot by 2short · · Score: 1


      Gotta disagree. C++ is the current high water mark. If you told me more about why you don't think so I could tell you more about why I disagree. But I suspect why you disagree with me is that you haven't seen/used well done C++ much. I'll freely grant that badly written code in C++ is worse than badly written code in many other languages. But I won't stand for badly written code in any language, so the point is moot. Comparing only well written code, C++ delivers the goods over C. Not surprising, since it was desigend solely to address real-world problems real programers were having writing in C.

      Perl? Hey, it kicks ass for a few things, but that's easy. In the C vs. C++ we're talking general-pupose programming languages with no built-in performance penalty, so Perl isn't even in the running (or trying to be, it's busy over there in the do-stupefyingly-complicated-operations-on-text-fil es-with-stupidly-terse-syntax competition).

  89. Misinformation card [Was: Re:Reference Card] by jdennett · · Score: 2, Informative

    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.

    1. Re:Misinformation card [Was: Re:Reference Card] by jdennett · · Score: 1

      and didn't make it though for some reason... I'm "sure" I said plain text. Let's try them with HTML formatting this time.

    2. Re:Misinformation card [Was: Re:Reference Card] by nycsubway · · Score: 1

      I must say, the card was not designed to be a reference for expert C++ programmers. It was written as an aide for someone learning C++. College students, and programmers who are learning C++ for the first time are the people who will get the most use out of this card.

      My guess is that if someone can identify that an example is less than optimal, than they dont need this card.

      I've managed to cram a lot of information onto this card, more than is taught in some college programming courses. If I were to add more information, the card might become... two sheets. Which would defeat the purpose of a single sheet reference card.

      Also, I do welcome any input about the card and any way that I can improve it. Thank you for your comments, they will be helpful in improving the card.

    3. Re:Misinformation card [Was: Re:Reference Card] by jdennett · · Score: 1

      No need to add more information; if you contact me privately (jdennett at acm.org will do) I'll happily review this for you and update it to conform to the C++ Standard where it doesn't already, and maybe offer a few other tips.

      If you'd like a chance to make work for me, feel free to read the comp.std.c++ FAQ at http://www.jamesd.demon.co.uk/csc/faq.html and let me know what deficiencies you find there.

  90. asm by pommiekiwifruit · · Score: 1
    Very well, strip off the comments and here you go.

    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

  91. Re:C++ isn't practical anymore by Anonymous Coward · · Score: 0

    Gcc, and Microsoft's version 7 compilers both implement most of the standard, as do quite a few others. More importantly, the developers of most of the major compilers out there now are committed to producing conforming compilers. This was not always the case. I assume that the proprietary compiler you're referring to is Comeu, which implements pretty much the entire standard, including export. Export and some issues related to templates are really the only major areas where most of the current compilers are lacking.

  92. you know.... by Anonymous Coward · · Score: 0

    In learning any language....#4 is essential. Too many of these computer books go really deep into the trivial at the expense of the big picture, while others stay up in the clouds, finding profundity in every nuance of a language and explaining the language in as abstract a way as is possible. Both routes don't do a thing for a person who is just starting out. The way to learn is to try an example, experiment with it, figure out what the book left out, and procede from there.

    I'm not sure about C++ though. It's a mess. And if it is supposed to be a better way to do what you can do in C, why is BjS serving as its chief apologist all the time instead of its chief proponent?

  93. Criticising "Accelerated C++" by Anonymous+Brave+Guy · · Score: 1
    Nobody ever said anything about not learning these things at all, not learning the entire language. That'd be stupid.

    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.
    1. Re:Criticising "Accelerated C++" by devphil · · Score: 1
      The coverage of exceptions -- an equally if not more important topic than templates -- is almost non-existant. That was a great disappointment, [...]

      I disagree that exceptions are more important than templates. Equally important, okay. *grin* (I would point out that exceptions have been done in other languages, while C++'s templates offer things which no other languages' type-parametric features do.) But that's neither here nor there.

      I do agree with you about the lack of exception coverage; that would have been nice to see. (But remember the 300-page limit. Something would have had to get dropped in order to fit exceptions in.) I don't know which chapter I would have dropped if I were them... any suggestions?

      I think the book is much better for those who've programmed in other languages and then come to C++ than for beginners.

      Absolutely. They don't even try to explain concepts like "variables" and other high-school-algebra or cs101-ish topics. They assume you know that programs have to be written in a "programming language," that we can't simply write in English instructions, etc. Some kind of programming background is assumed. (Again, 300 pages.)

      Finally, it's written by the in-crowd. Many of the reviews were also written by the in-crowd.

      Odd, that's precisely why I bought the book. "Written by experts who have been heavily involved since the beginning... okay, that getsa few more points in my book. *reads reviews* All the really really intelligent non-fluffy C++ gurus also recommend it... even more points... okay, I'll try it." And I read every word, even though I've years of experience with C++. And I was amazed.

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  94. question by Suppafly · · Score: 1

    how useful is this book if you don't already know the c language?

  95. This book is STILL crap. by Anonymous Coward · · Score: 0

    I bought the first edition. After a weekend, it was in the rubbish heap. Seldom had I seen so many errors in so few pages. "Did he actually run this code?" I asked myself (and the publisher, to no avail). A brief inspection reveals the second edition to be no better. Why did they even bother?

  96. Best advice! by arhemian · · Score: 1

    If you want to learn from one of the best books
    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 ...), and look that it
    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 ...

  97. Re:I don't usually bitch about slashdot "reviews" by adrienlamothe · · Score: 1

    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!

  98. I didn't add that extra "4)", can you remove it? by adrienlamothe · · Score: 1

    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.

  99. Re:I don't usually bitch about slashdot "reviews" by adrienlamothe · · Score: 1

    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.

  100. Re:I don't usually bitch about slashdot "reviews" by adrienlamothe · · Score: 1

    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?

  101. Re:I don't usually bitch about slashdot "reviews" by Bob(TM) · · Score: 1

    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?
  102. Re:I don't usually bitch about slashdot "reviews" by Bob(TM) · · Score: 1

    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?