C++ For Java Programmers
The reader envisioned as this book was being developed is a programmer with a year or more experience with Java, who has a good understanding of the language and Java libraries, and who wishes to learn more about the programming language C++. Programs in Java and C++ share a superficial resemblance to each other, but beneath the surface there lie a myriad of practical and philosophical differences. The unwary programmer not cognizant of these differences will encounter a host of problems in moving from one language to another.This book is not intended to be a complete and thorough introduction to the C++ language. The length of the book alone should be enough to indicate this fact, since most recent introductions to the C++ language run to a thousand pages or more. Instead, this book tries or organize the differences between C++ and Java into a coherent framework that facilitates the transition from one language to the other. Where the reader desires more information on a specific topic, one of the recent descriptions or tutorials on the C++ language should be consulted. Excellent coverage can be found in the book by Stroustrup Stroustrup 97 or Lippman Lippman 98.  Further ReadingThere are literally hundreds of books on Java and/or C++.  I have, of course, seen only a small fraction of these. The following list is therefore quite idiosyncratic, reflecting more than a fair amount of whimsy and chance. These are books that I have read and appreciated.A good introduction to the C++ language, including the recent changes to the language, can be found in Stroustrup 97) or Lippman (C++ Primer Lippman 98). Slightly less thorough but in some ways more readable descriptions are presented by Eckel (Using C++  Eckel 89), and by Horstmann (Mastering Object-Oriented Design in C++ Horstmann 95).Two other books authored or co-authored by Bjarne Stroustrup, the designer of C++, present much of the philosophy that lay behind the design of the language (The Annotated C++ Reference Manual Ellis 90, and The Design and Evolution of C++ Stroustrup 94). A collection of papers by others involved in the evolution of the C++ language is provided by Waldo (The Evolution of C++ Waldo 93). Another book by Lippman (Inside the C++ Object Model Lippman 96) describes the internal C++ view of the world.The Standard Template Library, a major recent addition to the C++ language, is explained in an earlier book of my own Budd 98a, as well as in books by Musser Musser 96 and by Glass Glass 96.There are various books that describe good C++ programming style. Perhaps the best of these are the text by Cargill Cargill 92, and the pair of books by Meyers Meyers 98, Meyers 96.A wealth of information in the question and answer style of a FAQ is available in the books that collect FAQ information on C Summit 96 and C++ Cline 95. (There is a Java FAQ book Kanerva 97, that also has some discussion of C++).There are several books that are almost the opposite of this book, that is, explanations of Java for programmers familiar with C++. One of the best of these is the book by Chew Chew 98. The more recent book by Wigglesworth and Lumby Wigglesworth 99 covers more of the recent changes to Java. The book by Daconta and others Daconta 98 is more complete, in that it covers both Java and JavaScript. Pappas Pappas 96 presents material specific to the Borland C++ system. Boone Boone 96 tends to dwell more on the programming environment and design differences, and less on the differences in the languages.In an earlier book I have tried to explain object-oriented programming in a language independent fashion, including examples from both Java and C++ Budd 97.A book by Coplien Coplien 92 presents an interesting discussion of many of the more exotic features of C++, for the adventurous reader who wishes to explore further than most programmers ever wish to go.  Marginal NotesThere are four types of marginal notes used in this book to highlight material of particular important.A Definition introduces a term that may be unfamiliar to the programmer if their only background is in the language Java.A Rule provides advice that the reader is strongly encouraged to follow. Like all rules, there may be some times when the advice must be rejected, but rules generally reflect years of painful learning concerning the consequences of not performing some action.A Warning highlights a potential danger that the programmer should be aware of. Often these reflect subtle issues easily overlooked, or places where Java and C++ constructs have similar appearances but different meanings.A Note simply provides an additional or important bit of information that might easily be overlooked.  AcknowledgementsSeveral people provided useful advice and suggestions both in the conception of this book and comments on the many early drafts of the manuscript. These include Yechiel Kimchi from The Technion, Israel, Joe Bergin, from Pace University, and students Nandhini Ganapathi Raman, Thomas Godin, David Hackenyos, and Hari Narayanan, from Oregon State University.   0201612461P04062001