DOC PREVIEW
Purdue ECE 462 - Brief History of C++ and Java

This preview shows page 1-2-3-4-29-30-31-32-59-60-61-62 out of 62 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 62 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Brief History of C++ and JavaC++ HistorySimulaProgramming Language DesignC with ClassesFeatures in C with ClassesDesign Decisions in C with ClassesGarbage Collection in C++1982 C++1986 C++ 2.0Brief History of Java 1995-SuccessJava: Sun vs. MicrosoftLessons LearnedJava Remote Method InvocationRethink Function CallHow to Implement the Callee?Remote Method InvocationRMI ArchitectureCompute Engine ExampleName MappingRay TracingAdvantagesBooksReverse Ray TracingRefraction and Ray TracingECE 462Object-Oriented Programmingusing C++ and JavaBrief History of C++ and Java YHL History 1Brief History of C++ and Java Yung-Hsiang [email protected]++ History• why to study history? – Knowing the past often helps us plan for the future.– The design decisions of one programming language help us design better languages.•Since C++ (1982), many new programming languages YHL History 2•Since C++ (1982), many new programming languages have been developed:– 1991 Python– 1995 Java 1– 1995 PHP– 1997 OO COBOL– ...History of C++: 1979-1991by Bjarne Stroustrup• background– 1977 Apple 1 & 2 (1MHz processor, 4-48KB memory, $1300-$2600)– 1979 Intel 8088–1980 Seagate (then called Shugart) YHL History 3–1980 Seagate (then called Shugart) 5.25-in 5MB disk– 1981 IBM PC (4.77MHz, 16-640KB memory) – 1983 TCP/IP• Computers were slow and expensive.YHL History 4C++• design goals:– Simula's facilities for program organization– C's efficiency and flexibility– for system programming•1979-1983 C with ClassesYHL History 5•1979-1983 C with Classes• 1982-1985 C++• 1985-1988 C++ 2.0• 1988- standardization (ISO / ANSI)• ISO = International Organization for Standardization• ANSI = American National Standards InstituteSimula• simulator for a distributed system• class hierarchy • capturing type errors by compiler– type: int, string, Student, Computer ...–type error, for example, a Student object + 3, a Computer object YHL History 6–type error, for example, a Student object + 3, a Computer object + "hello" ...• problem of Simula: link time too long– run-time type checking – variable initialization– garbage collection, even for a program without garbage⇒ performance too lowProgramming Language Design• Never attack a problem with wrong tools.• support for program organization: class, hierarchy, concurrency, static type checking• good tools to compile files separately, to link files written in different languages, and to produce fast programsYHL History 7in different languages, and to produce fast programs• portable across different machines• His background in OS and communication affects many design decisions, such as model of protection and exception handling • A good language requires a good implementation. Performance matters.C with Classes• new language developed to analyze UNIX kernel: analyze network traffic and modularize kernel⇒ develop an extension of C by adding tools⇒ Some programming languages are developed for specific purposes and then are generalized.•no primitives to express concurrency, use libraries instead (different YHL History 8•no primitives to express concurrency, use libraries instead (different from Java with built-in thread supports)– built-in support: consistent with language, but may cause unnecessary overhead to the users that do not need this feature– libraries: more flexibility but increase the overhead in system administration to ensure version compatibility• C with Classes to be used anywhere C is used ⇒ efficiencyrequirements eliminate built-in runtime safety checkingFeatures in C with Classes• "philosophy": language designers should not force programmers to use a particular style; instead, designers should provide styles, practices, and tools to help programmers avoid well known traps ⇒C allows low-level operations and type conversions, so does C with Classes•features (1980): class, derived class, public / private access, YHL History 9•features (1980): class, derived class, public / private access, constructor / destructor, call and return, friend class, type checking and conversion of function arguments• features (1981): inline, default arguments, overloading of assignment operator• C with Classes was implemented as pre-processor of C ⇒ portable across machines ⇒ common approach for language design todayC with Classespre-processorCC compilerexecutableDesign Decisions in C with Classes• A class is a type.• Local variables are allocated at stack, not heap ⇒ no need to call garbage collection• Default access control is private.• Static type checking for function arguments and return values.•Class declarations and function definitions can be in different files YHL History 10•Class declarations and function definitions can be in different files (different from Java). Hence, class declaration can be the "interface" (Java distinguishes interface from class)• "new" calls constructor (not all valid C programs are valid C++ programs)• Use-defined types (classes) are treated in the same way as the built-in types.• Function inlining is used to reduce the overhead of calls ⇒discourage programmers from declaring data members as public.// classX.hclass X {public:void foo(int, float);};// classX.cpp#include "classX.h”void X::foo(int a, float b) {...}YHL History 11// both a class declaration and // interface// define the implementation of a // member functionGarbage Collection in C++• considered until 1985• inappropriate for a language (C) already had run-time memory management• GC would degrade performance unacceptablyYHL History 12• Stroustrup stressed that there was no "grand plan" to develop C++. Hence, the usefulness of the language resided on the ability to attract users in Bell Lab by solving their problems, efficiently.1982 C++• C with Classes was a "medium success"• major features:– virtual function– function and operator overloading–referenceYHL History 13–reference– constant• virtual function– to adapt to similar but different (common base class) types– a large if-then-else or switch-case block is undesirable– dilemma: allow adaptability by users without allowing the change of base classes (possibly from the library)void shape::draw(){switch (type) {case circle:// draw a circlebreak;case square:// draw a squareclass Shape{virtual void draw() = 0;}class Circle: public Shape {void draw() ...// draw a circlenot


View Full Document

Purdue ECE 462 - Brief History of C++ and Java

Download Brief History of C++ and Java
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Brief History of C++ and Java and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Brief History of C++ and Java 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?