Magazines  


(From IEEE Software)
Bookshelf

A Simple Explanation of C++ for Beginners

C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart
Brian Overland
Prentice Hall
2004
ISBN 0-321-24695-0
528 pp., US$24.99.

If you ever wanted to learn C++ but have little or no knowledge of computer programming, C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart is the book for you. Brian Overland covers C++ in simple terms that everyone can understand and he doesn’t use big words unless he’s fully explained them first. He makes programming simple by using small, understandable examples and pictures. He analyzes each line of code and depicts it using boxes, arrows, and pictures so that you don’t have to think through problems abstractly. Sometimes, he also uses visualizations—not to make the book comic-like, but to get his points across.

Overland starts by going over C++ basics, such as declaring variables and outputting the message “Hello World” on the screen, and moves on to decision making and logic handling of the language with for loops and while loops. The examples build on previous ones, but they don’t get longer. They’re short and to the point, making them easier to digest. This approach is the same for all topics; they get more advanced, but not cumbersome or harder to understand. Overland covers functions and function declaration in detail. His prime factorization example gets the point across easily, and anyone with one year of high school math can understand it.

Pointers are probably the most powerful feature of C++ and one of the most complex topics for newcomers to grasp. Overland takes examples from previous chapters and shows why pointers and references can be helpful, which reels in the topic. He also discusses pointer manipulation and the power of pointer arithmetic. By the chapter’s end, you’ll be able to understand the following line of code:

*p++ = *q++;

Interviewers almost always ask me to explain this line of code step by step. For good reason, many people get it wrong! This book, to my amazement, explains this little code clearly enough for anyone to understand.

As you’ve probably realized, Overland doesn’t cover object orientation theory and concepts until more than halfway through the book. At the book’s beginning, he makes the point that he’ll explain object orientation through examples and by doing rather than providing chapter after boring chapter of explanation. I agree with this approach, especially for newbies. That’s not to say that the code and examples Overland provides throughout the book aren’t good object-oriented code, because they are. He gives you the chance to learn object orientation by practice and example rather than providing lists of what not to do. This way, you start on the right track instead of having to backtrack through information he gave before. So, without your knowledge, Overland has introduced you to object orientation from the book’s first chapter. When he starts to really talk about OO, all you need to do is “put the name with the face.”

Having said that, he covers strings in detail; his comparisons between character arrays and string objects will help you fully grasp the concept of an object. He gives the same examples for the string class that he gave for arrays, so you can see the advantage of “going OO.” Overland then talks about files and I/O in terms of object orientation, which makes the learning experience much simpler than using the good old C function calls. He shows you the right way to program as if it were the only way, a methodology I agree with.

Inheritance and polymorphism are some of the more advanced topics Overland covers. Generally, these topics are complex, and here is no different. He sticks to using simple words and examples throughout these chapters, which makes learning much simpler and maybe even fun, but these topics still need extra attention. One nice thing about these chapters is that he gives concrete, real-life, simple examples that are easy to relate to, such as subclasses for real numbers and fractions that inherit the integer parent class behavior.

Overall, I’d recommend this book to anyone interested in learning C++. It’s a complex and advanced language that’s been around for a long time, and having a good foundation to build upon as you advance in your career is the key. C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart by Brian Overland can provide just such a foundation.

Art Sedighi is a solutions architect at Platform Computing and a freelance writer. Contact him at sediga@alum.rpi.edu; www.ArtSedighi.com.


         

About Us

Mission, Vision & Goals
History
Awards Program
Volunteer Leadership
Staff Leadership

Contact Us

Member Resources

Volunteer Center

For More Information