c++ the reason why it is still in use. table of contents disadvantages disadvantages advantages...

10
C++ C++ The reason why it is The reason why it is still in use still in use

Upload: camron-jones

Post on 20-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

C++C++

The reason why it is still in The reason why it is still in useuse

Page 2: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

Table of ContentsTable of Contents

DisadvantagesDisadvantages AdvantagesAdvantages Compare with object-oriented Compare with object-oriented

programming languageprogramming language Program exampleProgram example ConclusionConclusion

Page 3: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

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

Page 4: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

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

Page 5: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

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

Page 6: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

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)

Page 7: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

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;

}}

Page 8: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

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");

} }} }

Page 9: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

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");

} } } }

Page 10: C++ The reason why it is still in use. Table of Contents Disadvantages Disadvantages Advantages Advantages Compare with object-oriented programming language

ConclusionConclusion

Each programming languages has its Each programming languages has its advantageadvantage

Useful for critical, high performance Useful for critical, high performance applicationsapplications