Slashdot Mirror


Who's Afraid Of C++?

The reason computers -- never mind programming -- are so obscure to most people is a learning curve which appears dangerously steep stands between the ordinary user (who knows how to use a mouse, and which button turns on the monitor) and writing even "Hello, World." Prolific reviewer chromatic reviews here Who's Afraid of C++?, a book intended to flatten that curve.

Who's Afraid of C++? author Steve Heller pages 486 publisher AP Professional rating 8 reviewer chromatic ISBN 0-12-339-97-4 summary In his unique approach, Steve Heller presents programming concepts and information as a conversation between teacher and student.

The Scoop Breaking with traditional lecture-on-paper format, Heller demystifies computers, programming, and C++ for absolute beginners. That's right -- he recruited a full-fledged novice user, capable of little more than e-mail and word processing, and turned her into a decent programmer while reviewing this book. (She became Mrs. Heller shortly after that.) Any computer owner with time, the ability to follow directions, and the willingness to learn could also become a programmer.

The resulting text is more of a collaboration, or a commentary. Steve, the author, presents his information and then Susan, the novice, interrupts to ask questions. The big gamble is that her questions are the same that the average reader would ask. It largely pays off, only occasionally belaboring a point. (To be fair, it could also be called 'reinforcing a point.')

What's to Like? Heller's writing is informal, but precise. Some might find it chatty, but beginners will find it more comforting than raw technical prose. His flow of topics makes sense (and does not copy the "Chapter two is everything to know about types, and chapter three is all about flow control" scheme other introductory teaching books steal from K&R). Little prior knowledge is necessary. Before actually programming, the book explores raw hardware, answering such questions as "What happens when you execute a program?", "What's a register and why is cache important?", and "How does source code turn into a running program?"

Chapters tend to explain only one issue in detail -- how to use functions, for example, or the basics of a class. Heller states his objectives up front, and sticks closely to them. Each chapter has two sets of exercises, one in the middle and the other at the end. Answers follow, along with more dialogue. It's not enough simply having one correct bit of code, without someone to explain why it is correct, and why some common answers aren't complete. This decision pays off.

Though discussing weighty technical matters, there's a sense of general friendliness. With well-chosen metaphors (datatypes are kinda like odometers), occasionally goofy examples (a pumpkin-weighing-contest control program), and plenty of conversations when things get heavy, C++ isn't so scary after all. Credit Susan for much of this. If you find yourself thinking along the same lines as you study, you'll make it.

What's to Consider? The book covers about half of a reasonably paced introductory Computer Science course. It also predates the ANSI standard and the STL, though a fair treatment of the latter would easily double the size. Readers who finish the book and the exercises will be fully capable of producing their own useful programs, but will need additional information on common libraries, algorithms, and more object-oriented programming. They'll also have avoided some of the traps awaiting the unwary novice, as Heller practices a fairly tight methodology.

More technical readers already familiar with programming and at least one C-based language might find the pace slow and the extra explanations unnecessary. Heller's target audience is definitely the neophyte, not the experienced developer. The latter might question the subject matter covered. Why build a vector class instead of using C-style arrays? Why not C-style strings? I suspect the author is more concerned with helping his students avoid the kind of pitfalls C++ was designed to work around. It may not be the traditional approach, but it's valid and it will produce decent programmers, who can learn C++ on its own merits.

The Summary Steve Heller's pulled off quite a feat -- producing a book that assumes very little, yet produces people who understand programming. There's not as much information presented as in a "Learn the Language in X days/weeks/hours" book, but it's more accessible and better geared to a true beginner. For a gentle and effective introduction to programming and C++, give this book a try.

The CD-ROM contains complete source code of all program listings, as well as the excellent DJGPP compiler (yes, it's for DOS).

Read this book online at www.steveheller.com or purchase it at Fatbrain.

Table of Contents
  1. Prologue
  2. Hardware Fundamentals
  3. Basics of Programming
  4. More Basics
  5. Functional Literacy
  6. Taking Inventory
  7. Stringing Along
  8. Down the Garden Path
  1. Tying Up Loose Ends

22 of 413 comments (clear)

  1. Is that line trademarked? by (void*) · · Score: 5
    I can see it now: a whole line of educational guides ala IDG's "Dummies guide" series:
    • Who's afraid of Unix?
    • Who's afraid of Relativity?
    • Who's afraid of Motorcycle Maintanence?
    • Who's afraid of Sex?
    Yes, let the money roll!
  2. It is irrational fears week! by BilldaCat · · Score: 3
    --
    BilldaCat
  3. You've opened a Pandora's Box by TheNecromancer · · Score: 4
    I hope you people realize that this topic is just going to start a verbal war between the C++ purists, the Perl purists, the Java purists, the Pascal purists, ad infinitum.

    IMHO, it doesn't matter what language you program in(I progam in several, including C++), the important point is that you understand the basic tenets of programming, and can use these concepts to program in any language! If this book can help people learn that, more power to them!

    --
    Attention all planets of the Solar Federation! We have assumed control! - Neil Peart
    1. Re:You've opened a Pandora's Box by JoeWalsh · · Score: 3

      IMHO, it doesn't matter what language you program in(I progam in several, including C++), the important point is that you understand the basic tenets of programming, and can use these concepts to program in any language!

      I agree with you. I want to point out another problem, though. In addition to the problem of thinking like a programmer, I find that it's harder to get people interested in modern languages because it's generally much more difficult to do fun graphical things with them.

      Take the first language I learned, for example: Atari BASIC. I learned it using the slim little book with the silver cover that came with the Atari 400 my parents bought me. After reading that little book (I don't have it with me, but it was about 100 pages long, with large type and many illustrations), I was able to use BASIC to draw on the screen. I could use FOR...NEXT loops to cycle colors among many lines to get a neat effect. I could actually move a dot around on the screen using my joystick.

      That felt powerful. To make a program that responds graphically to my input was just mind-blowing at the time. I quickly wrote a little game, and - WOW - I felt like I could do anything if I just put in the time.

      Compare that with today's computer books. Friendly or no, the books teach you how to write little boring text-based programs, for the most part. Maybe they teach you how to use a RAD tool to make a WIMP interface, but still the program itself is just a "get some text input from the keyboard, process it, and output some text" program. That is boring!

      It'd be nice to write some graphics routines for C that are as easy to use as the old Atari BASIC graphics commands (SETCOLOR; COLOR; PLOT X,Y; DRAWTO A,B) and input commands (if not joystick, at least some info on using a keyboard to do game input).

      Take those commands and some basic housekeeping code, then distribute them with a book on learning C. The book could still focus on the processing and structure stuff, but if something was thrown in there that would give the person some ability to make something fun and exciting after learning just a little bit.

      That's a tremendous incentive for neophyte programmers, in my opinion. It not only gives them some warm fuzzies when they see it, it's also a lot more exciting to show someone else than any of the text based stuff.

  4. Learn C++ in Five Minutes! by bgs006 · · Score: 5
    Hey excited Netizens! Wanna learn a difficult programming language in just five minutes?! Wanna earn gobs of money from desperate start-ups who will throw any sort of bribe at you to work in their tiny, cramped, dungeon-like cubicle!? Well stop wishing and start learning with my new seminar!

    I know what you're thinking: there's no way I can learn C++ in five (count 'em) five minutes. Well stop being such a doubting loser. Here's what you do:

    Step One: On the qualifications section of your resume, write, "I know C++." Feel free to put other things, such as "I speak thirteen different languages," "I've slept with Pamela Lee Anderson", and of course, "I am omnipotent."

    Step Two: Get Hired!

    Step Three: When your manager approaches you to actually work on a C++ project, immediately run to your nearest Asian immigrant and pay him 50 cents an hour to do the project for you! Don't feel bad, your manager did the same thing to get in his position!

    Step Four: Watch as the money, women and strange magic powers are bestowed upon you.

    It's just that simple!

    -Bgs006
    LostBrain

    1. Re:Learn C++ in Five Minutes! by Signal+11 · · Score: 3
      Step Five: Get introduced to RealWorld(tm).

      Step Six: Asian dude goes to work for SGI, pulls six figures. Your project is delayed. Senior Engineer asked you about progress, realizes you're full of it, informs senior management, shafting follows.

      Step Seven: Get desperate, spam hundreds of newsgroups with "make money fast!" schemes to help you get out of debt.

      Step Eight: After changing several ISPs and diffusing three different mailbombs, reality dawns on you - there is no fast way to do anything.

      Step Nine: go back to school, get a degree, do things the way everyone else does.

      Step Ten: get a job, life, girlfriend, family, wife, kids..

      Step Eleven: Retire, spend 3 years in retirement, die.

  5. What's a "steep learning curve" by ChrisWong · · Score: 4

    That phrase always bugs me. The obvious first take would be to graph the independent variable (time) on the X axis, and learning on the Y. But then that would give any "hard" subject a shallow learning curve. Someone once tried to explain it to me by using a Z axis, muddling everything up even more. Is there an official interpretation, or did an economist invent this graph?

    1. Re:What's a "steep learning curve" by jemfinch · · Score: 3

      The X axis is the usefulness of what you can do in the language; the Y axis is is the amount of knowledge of the language you have learned thus far.

      A subject with a steep learning curve, therefore, is a subject where much learning is involved to do relatively simple tasks.

      Jeremy

  6. Re:C++ as a teaching language/programming obscure? by keffy · · Score: 3
    Personally, I think C++ is a bad teaching language because computers don't think in objects. They think in memory locations and in blocks of code
    Computers "think" in both. They also think in registers and opcodes. They also think in electrons.

    All of these are abstractions at some level of what's really going on. There's no inherent reason why your favourite level of abstraction (memory locations and code blocks) is any better a place to start learning than the object level -- and a few reasons why it's worse. The way people think is closer to the object level (though still quite far).

    And discrete math?! Honestly, I think you could make a better case for cooking classes. The practical experience of trying to follow well-written and poorly-written recipes will help a novice programmer out a heck of a lot more than a detailed understanding of set theory ever could.

  7. I've read it. In fact I started out with it. by Narcopolo · · Score: 3

    And I have to say it's very good. I think that C++ is actually an excellent language to begin with, as people tend to think in objects. The book is very good at showing instant results, in fact it starts out with strings. This lets people see immediately practical uses for what they are doing, and feel some accomplishment.
    Most of the C books I've read don't even try to get to strings until halfway through, and make it a rather complicated introduction by making you understand data types and arrays first. Mr. Heller's point is that, with C++ at least, you don't really have to know what's going on with strings to use them, and that it's easier to understand the fine details of things once you've become familiar with them through usage. He does that a lot in the book.

    My C teachers and classes have always seemed extremely dry after being introduced to C++ by Steve Heller. If anyone is curious about learning to program, I wouldn't hesitate to recommend this book as a starting point. There's also a follow-up book, "Who's Afraid of More C++", also working with Susan.

    Mr. Heller also seems rather accessible be e-mail, but please don't hold him to that because I said so.

    -N.

    --
    I used to be a cynic, then I got disillusioned with it.
  8. C++ is a horrible introductory language by schala · · Score: 5

    It's so horrible, in fact, that I can't even think of a worse one. You've got all the worst features of bad languages rolled into one -- a massive amount of confusing syntax, (extremely!) complicated semantics, almost always utterly unhelpful error behavior, and an extremely high barrier to entry even to get programs to compile, much less run, to say nothing of them actually working correctly.

    While it is certainly an extremely powerful tool, it is also a gigantic hodgepodge of different programming paradigms. You can be object-oriented, you can be procedural, you can have it look like assembly code; this is flexibility, but only with a corresponding reduction in accessibility.

    Now, I don't really know if there is a perfect language for introductions to programming. The much-maligned Pascal is a good language for learning structured programming, which makes it a good step towards C and then C++. Functional programming is easier to pick up but requires a certain amount of intellect to grasp the ideas of abstraction that it relies upon. (I happen to think that since understanding abstraction is critical to being a good programmer, everyone should do some functional programming.) For that I would choose Scheme in one of its reduced flavors. Scheme also has the advantage of having simple syntax, though it seems a bit unnatural to non-engineering types. For object-oriented instruction, I think Java is a good choice, for a bunch of reasons, which I won't enumerate since they will be obvious and I'm tired of typing.

    It makes me cringe when I see a new "Learn C++ in 24 hours" title on the bookshelf, because I know those texts will screw people up. Learning to program is a challenge enough without having to learn C++ at the same time.

    -m

  9. Optimization by Dungeon+Dweller · · Score: 3

    Higher level languages produce slower programs. While I like Python and do all of my web scripting in Perl, if one truly wants to get the most out of their programs, they will optimize in assembly. Faster processors are not a good excuse to blow simple, good computer science out the window.

    --
    Eh...
  10. Complete Idiot's Guide to Multiprocessing called.. by TeknoHog · · Score: 3
    ..Who's Afraid of the Big BeoWulf?

    ;-)

    --
    Escher was the first MC and Giger invented the HR department.
  11. C++ is NOT the best langage to learn on by Dacta · · Score: 4

    Why on earth would anyone try and teach a newcommer to programming something like C++? It's my view that any langage based on the C syntax is not suitable for beginners.

    Pascal, Python, maybe Java are all great languages for a beginning programmer.

    I'm sure that it is possible to teach some people C++ as their first language. I'd argue that they could have learnt something like Pascal in less time, and have a better understanding of it. C/C++ syntax is too weird for a beginner, and you need to understand too much about memory & pointer to do anything useful. I mean... no native string type in C? How stupid is that when you think about it?

    1. Re:C++ is NOT the best langage to learn on by kali · · Score: 3
      Why on earth would anyone try and teach a newcommer to programming something like C++? It's my view that any langage based on the C syntax is not suitable for beginners.

      Why, exactly? The C syntax is used by C, C++, Java, and Perl, which are arguably the most common languages in use today. Why would you teach beginners something that they would never use, rather then something they would use everyday as programmers? What syntax do you find easier to understand?

      Pascal, Python, maybe Java are all great languages for a beginning programmer.

      Umm... Java is pure C/C++ syntax.

      C/C++ syntax is too weird for a beginner, and you need to understand too much about memory & pointer to do anything useful.

      This is simply not true. I worked as a TA for an intro programming class taught in C++, and they never even mentioned pointers. The only discussion of memory was when I would explain to the students why their programs crashed when they went beyond the bounds of an array. Otherwise, they were perfectly functional without any such knowledge.

      Of course, to be competent in C++ requires a thorough understanding of memory issues, but we're talking about beginners here.

      I mean... no native string type in C? How stupid is that when you think about it?

      You're absolutely correct, it is stupid. However, since the topic here is C++, and C++ does have a native string type, what the hell is your point?

    2. Re:C++ is NOT the best langage to learn on by JoeWalsh · · Score: 3

      It's my view that any language based on the C syntax is not suitable for beginners.

      I've tried to teach many people to program. The first time I was called upon for this was when I was 13 and one of my mom's friends had purchased a Commodore VIC-20 thinking she and her husband could automate their business with it. My mom sent me over to this woman's house to teach her how to program BASIC so she could automate the accounting system. Yeah, that was just tons of fun. Fortunately, she gave up after a few sessions. And I got some nice home-made cookies out of it, so it wasn't a total loss for me!

      Anyway, I've been informally teaching people to program, with varying degrees of success, ever since. In all this time, perhaps the most important thing I've learned is that the biggest hurdle potential programmers face is learning to think programmatically. Or, as someone else said, to think like the computer.

      It doesn't matter whether I was teaching someone to program in BASIC, Pascal, C, or Java, the stumbling block was the same. I'm not a professional instructor, so I wasn't able to get some people over that hump. But those who did get over it found that, within a short while, they didn't need me to teach them anymore. They could pick up the rest on their own. (Of course, those who didn't get over the hump didn't need me anymore either, so either way I was out of a job!)

      I believe C++ would be just as appropriate for this as anything else, but as with BASIC and a host of other languages, people who only know C++ tend to have a harder time understanding how the computer works. C++ adds a layer of abstraction that, while useful to the experienced programmer, doesn't help neophytes to learn other, non-object-oriented languages.

      Still, I'll probably add the book in question to my collection of "how to program" books. I'm always interested in seeing how people try to teach one another (unless it's a "learn X in Y hours/days/weeks" book or any title that insults the purchaser's intelligence ("...for Dummies," "Complete Idiot's guide to...", etc.) - I avoid all of those titles like the worthless detritus that they are).

    3. Re:C++ is NOT the best langage to learn on by Kinthelt · · Score: 3
      It's my view that any langage based on the C syntax is not suitable for beginners.

      It's not exactly the syntax of C that is difficult for beginners, moreso it is the low-levelishness of C that makes it hard to learn. Beginning programmers need to learn how to formulate a plan and write it out (make algorithms), they do not need to worry about shooting themselves in the <insert body part here>.

      Pascal, Python, maybe Java are all great languages for a beginning programmer.

      Pascal was supposed to be a teaching language and does the job very well, I agree. Never used Python, but I've also never heard anything bad about it. Java is very nice with its inability to do serious harm, its garbage collector is helpful too.

      I'm sure that it is possible to teach some people C++ as their first language.

      Believe it or not, it's possible to teach C++ like Pascal. You just need to avoid everything that resembles C. Introduce the for, if, while, String class, cin, cout and basic math functions, and you're in business.

      --

      "Evil will always triumph over good, because good is dumb." - Dark Helmet (Spaceballs)

  12. A less horrible introductory language.. by TeknoHog · · Score: 5
    At the risk of starting a flame war, here goes: Python.

    The syntax is very intuitive: blocks are denoted by indentation, nothing has to be declared. It is very easy to just start hacking on an idea without knowing much Python, learning from the docs while proceeding.

    Although not a 'real' compiled language, I'd recommend it as the introduction to ideas of programming. After that, learning other languages is more or less a matter of syntax only. Plus, it great for all kinds of scripting.. :-)

    --
    Escher was the first MC and Giger invented the HR department.
  13. How to Get Girls by IHateEverybody · · Score: 4


    Heller demystifies computers, programming, and C++ for absolute beginners. That's right -- he
    recruited a full-fledged novice user, capable of little more than e-mail and word processing, and turned her into a decent programmer while reviewing this book. (She became Mrs. Heller shortly after that.)

    So that's what I've been doing wrong! No more singles bars for me, from now on I'm teaching programming to cute female newbies until I find Ms. Right.

    --
    Does this .sig make my butt look big?
  14. Async event handling by dingbat_hp · · Score: 3

    I'm curious as to what sort of apps you write, if you haven't yet found C to be painful ?

    In recent years, most of us are writing desktop apps for windowing systems. These need to respond to mouseclicks, messages from other windows, system or network events, all sorts of things. Now this is still hard in an OO environment, but it's an absolute nightmare in C ! Anyone remember first edition Petzold, and the horrors of the Windows message loop ? Nasty, nasty days, and we had the program bugs and hangs to prove it.

    Writing good GUI event handlers is still hard, but with an OO environment it only needs to be done once, by the environment author, then just subclassed by the application author.

    Those of us not writing GUI apps are probably mainly writing back-end objects. I dont know where you'd begin, trying to serve one of potentially 50 different method calls, all from C.

  15. Some real fun... by PureFiction · · Score: 3

    Throw in C++, advanced data structures and templates (what, you mean the STL hash map is a blazing beast of speed??)

    Then ass a little CORBA. With POA's and dynamic factories...

    Then add pluggable protocols for an ATM layer and QoS.

    Tasty.. wrap your brain around that one..

    LOL

  16. Don't get this book. by Restil · · Score: 3

    I had the author of this book as an instructor in one of my C/C++ classes in college. He got canned after only one semester.

    The very first words out of his mouth on the first day of class was "C is dead, so there's no point in learning it." His book included a copy of gcc, but for some reason I can't recall, nobody could get it working and he had to hand out another version on floppies. We had to use HIS book as the textbook, but the student bookstore wouldn't stock it and Barnes&Nobel didn't order enough books, so some of us had to wait several weeks to get it.

    He didn't pace himself properly and ran out of material at about halfway through the semester, so he spits out an addendum, which we also have to buy, so he can keep talking. Half the book is filled with conversations of this Susan person and none of it adds anything to the content of the book.

    You'll love this one. The day we had our first test, which had errors on it, but thats a different story, he was SO paranoid that someone would try to smuggle out a copy of the test (why I can't completely figure out), that he insisted on searching everyone's backpacks as they left to make sure nobody stole a copy. The fact that we turned in our copy when we left didn't make any difference. He could also have done what other paranoid instructors do that don't want their students cheating (or stealing tests) and just leave our bags at the front of the room. OH but that might make sense or something.

    That was the last day I went to that class. I just dropped it after that because I was so sick of it/him. Apparently the real kicker happened at the end of the semester. When it came time to fill out evaluation forms, he naturally got a REALLY bad review, and some stupid idiot in the administration decided to tell him that before he gave out the final exams. So he goes into class telling everyone that he heard about the review and decided to give everyone a REALLY hard final exam as revenge. Most students ended up failing the class or getting low passing grades as a result. The school ended up giving everyone who wanted an option to do a small project to correct the grade in the class.

    Don't buy this book. Don't send this guy any money. I don't know if he's changed any over the years, but this book is a piece of trash and it will NOT be money well spent.

    -Restil

    --
    Play with my webcams and lights here