C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages...
-
Upload
camron-jones -
Category
Documents
-
view
218 -
download
0
Transcript of C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages...
C++C++
The reason why it is still in The reason why it is still in useuse
Table of ContentsTable of Contents
DisadvantagesDisadvantages AdvantagesAdvantages Compare with object-oriented Compare with object-oriented
programming languageprogramming language Program exampleProgram example ConclusionConclusion
DisadvantagesDisadvantages Complex structure, time consumingComplex structure, time consuming Difficult implementation of web architecturesDifficult implementation of web architectures Softening of object-oriented ideasSoftening of object-oriented ideas
Multiple inheritance, global variables, precompiling Multiple inheritance, global variables, precompiling Many possibilities for “dirty programming”Many possibilities for “dirty programming”
Jumps, addressing, overloading of operands, no Jumps, addressing, overloading of operands, no automatic initializing of variablesautomatic initializing of variables
Garbage Collection is not handled automaticallyGarbage Collection is not handled automatically Error return code no enforced ErrorError return code no enforced Error
AdvantagesAdvantages
Hybrid of procedure and object-Hybrid of procedure and object-oriented ideasoriented ideas
Short syntax (brevity), portableShort syntax (brevity), portable Modular programming, speedModular programming, speed ANSI/ISO standardANSI/ISO standard Easy implementing of existing Easy implementing of existing
bytecodebytecode
Compare with other Compare with other languageslanguages
Ideas of object-orientationIdeas of object-orientation Inheritance, Polymorphism, Inheritance, Polymorphism,
Encapsulation, Classes, Dynamic Encapsulation, Classes, Dynamic BindingBinding Smalltalk completeSmalltalk complete C++, multiple inheritance, friends (no C++, multiple inheritance, friends (no
complete encapsulation)complete encapsulation) Java, declaration of staticJava, declaration of static C#, same as JavaC#, same as Java
Compare with other Compare with other languageslanguages
Standard class librariesStandard class libraries SmalltalkSmalltalk C++, only few classes are defined in C++, only few classes are defined in
the standard librarythe standard library Java, large varietyJava, large variety
JDKJDK C#, Standard library (supports: C#, C, C#, Standard library (supports: C#, C,
C++, Jscript, Visual Basic)C++, Jscript, Visual Basic) .NET Framework Class Library (FCL) .NET Framework Class Library (FCL)
4 x ”Hello World”4 x ”Hello World”
SmalltalkSmalltalkTranscript show: 'Hello, World!'; cr Transcript show: 'Hello, World!'; cr
C++C++ #include <iostream> #include <iostream>
int main() { int main() {
std::cout << "Hello World" std::cout << "Hello World" << std::endl; << std::endl;
return 0;return 0;
}}
4 x ”Hello World”4 x ”Hello World”
C#C#using System; using System;
class Hello { class Hello {
public static void Main() public static void Main() { {
Console.WriteLine("Hello Console.WriteLine("Hello World"); World");
} }} }
4 x ”Hello World”4 x ”Hello World”
JavaJavapublic class Hello { public class Hello {
public static void main(String [] args) public static void main(String [] args) { System.out.println("Hello World"); { System.out.println("Hello World");
} } } }
ConclusionConclusion
Each programming languages has its Each programming languages has its advantageadvantage
Useful for critical, high performance Useful for critical, high performance applicationsapplications