Comparision of C++ and Java
Advantages Of C++
Each computer language has a niche which it is known for. C++ boasts object oriented programming which is very segmented, easy to work with, and doesn't require very many lines of code to perform simple tasks. Although C++ is backwards-compatible with its predecessor, the C language, C is not object oriented while C++ is.
C++ is perhaps one of the easiest computer languages to learn as much of the syntax is very straight-forward. In fact, it is often taught in many college classrooms as a first language for Computer Science majors.
The language is not to be underestimated, however, as it is still extremely flexible and functional in the workforce.Although C++ is a high-level language, it is very powerful in that it allows the programmer benefits otherwise only available in the assembly (low-level) language.
For example, programmers have much control over memory management, as can be demonstrated with arrays and linked lists.Yet another benefit of C++ is its ability to handle OOP, or object oriented programming.
By using functions and what are known as classes, certain parts of the code may be re-used multiple times throughout the program. For example, suppose a function was written to add two numbers being passed into it, and to print out the result.
This function can be re-used multiple times by passing in two different numbers, each time.Perhaps one of the most important advantages to C++, however, is its ability to work in cross-platform environments. This is because of an ANSI standard.
In other words, C++ code can be used to develop programs for vast operating systems including MS-DOS, Windows, Macintosh, UNIX and Linux, to name just a few. Unfortunately, GUI (graphical user interface) development in C++ among operating systems varies greatly.
Microsoft Visual C++, for example, allows for graphics in Windows. QT, meanwhile, can be used on UNIX-based machines.
Advantages Of Java
Java is a fairly new language which has been developed to improvise on C++. Unlike C++, it is completely object oriented.
The use of classes in development is not optional.Java also boasts easier to implement pointers than C++. Linked lists are extremely easy to develop.
In addition, many methods (functions) for almost everything you could imagine are pre-defined.One of the biggest advantages of Java over C++ is that GUI development is cross-platform. T
he exact same code can be run on virtually any operating system. For this reason, Java is a viable solution for many web-based applications.
Wednesday, July 4, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment