12-10-2012, 03:16 PM
C++ Programming HOW−TO
C++ Programming.pdf (Size: 233.04 KB / Downloads: 19)
Introduction
The purpose of this document is to provide you with a comprehensive list of URL pointers and programming
tips on C++. Also, this document provides a C++ library having Java−like String class, string tokenizer,
memory functions and many other functions, which can be used in general C++ applications. Also various
examples are given here which demonstrate the usage of this library.
This document is not a textbook on C++, and there are already several excellent "on−line Text books" on
internet. If you are new to C++ and you never programmed in C++, then it is strongly suggested that you first
read the online C++ Textbooks given in the chapter C++ Online Textbooks and then follow the subsequent
chapters. It is suggested that you purchase a textbook on C++ for reference from online bookstores like
amazon or barnes.
C++ v/s Java
C++ is one of the most powerful language and will be used for a long time in the future inspite of emergence
of Java. C++ runs extremely fast and is in fact 10 to 20 times FASTER than Java. Java runs very slow
because it is a byte−code−interpreted language running on top of "virtual machine". Java runs faster with JIT
(Just−In−Time) compiler, but it is still slower than C++. And optimized C++ program is about 3 to 4 times
faster than Java (with JIT compiler). Then, why do people use Java? Because it is pure object oriented and is
easier to program in Java, as Java automates memory management, and programmers do not directly deal
with memory allocations. This document attempts to automate the memory management in C++ to make it
much more easy to use. The library given here will make C++ look like Java and will enable "C++" to
compete with Java language.
Because of manual memory allocations, debugging the C++ programs consumes a major portion of time.
This document will give you some better ideas and tips to reduce the debugging time.
Which one Ada95, "C", "C++" or Java ?
Language choice is very difficult. There are too many parameters − people, people skills, cost, tools, politics
(even national politics) and influence of businessmen/commercial companies. The best language based on
technical merits does not get selected simply due to political decisions!
Java is much closer to Ada95 than C++. Java is derived from Ada95. Ada95 gets the maximum points as per
David Wheeler's Ada comparison chart. Ada got 93%, Java 72%, C++ 68% and C got 53%. C++ and Java are
closer in points(only 4% difference), hence Java is not a very big revolution as compared to C++. On other
hand, Ada is a very big revolution and improvement over C++. The scores are like 4 students taking exams
and student with highest score is Ada (93%). Who knows? Perhaps in future Ada95 will replace Java!!
Development costs of Ada is half of C++ as per Stephen F. Zeigler.