C++ Training Datascope Lawrence D’Antonio

Post on 14-Jan-2016

65 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

C++ Training Datascope Lawrence D’Antonio. Lecture 2 History of OOP and C++. OOPL. Simula Smalltalk C++ Java Python C# Eiffel Ruby. More OOPL. Dylan Modula 3 Self Sather Forté Objective C Object Pascal Visual Basic Perl. More OOPL. PHP REBOL CLOS Delphi COBOL Prolog - PowerPoint PPT Presentation

Transcript

C++ TrainingC++ TrainingDatascopeDatascope

Lawrence D’AntonioLawrence D’Antonio

Lecture 2Lecture 2

History of OOP and C++History of OOP and C++

OOPLOOPL

SimulaSimula SmalltalkSmalltalk C++C++ JavaJava PythonPython C#C# EiffelEiffel RubyRuby

More OOPLMore OOPL

DylanDylan Modula 3Modula 3 SelfSelf SatherSather FortéForté Objective CObjective C Object PascalObject Pascal Visual BasicVisual Basic PerlPerl

More OOPLMore OOPL

PHPPHP REBOLREBOL CLOSCLOS DelphiDelphi COBOLCOBOL PrologProlog AdaAda DD

History of SimulaHistory of Simula

Developed by Kristen Nygaard and Ole-Developed by Kristen Nygaard and Ole-Johan Dahl.Johan Dahl.

Carried out at the Norwegian Computing Carried out at the Norwegian Computing Center.Center.

Designed as a system description Designed as a system description language, built on ALGOL 60, to language, built on ALGOL 60, to implement simulations.implement simulations.

Development was begun in 1961, leading Development was begun in 1961, leading to the definition of Simula 1 in 1963-4.to the definition of Simula 1 in 1963-4.

History of Simula – Part 2

Process concept: Active customers moving through a passive network. System = Set of interacting processes

In 1965, Tony Hoare introduced the concept of a record class for handling records.

Nygaard and Dahl introduce the concept of processes with layers in Simula 67.

Simula 67 features

Introduced classes, subclasses, virtual methods

Garbage collection

Simula exampleClass Rectangle (Width, Height); Real Width, Height;

! Class with two parameters; Begin

Real Area, Perimeter; ! Attributes;

Procedure Update; ! Methods (Can be Virtual); Begin Area := Width * Height;

Perimeter := 2*(Width + Height) End of Update;

Boolean Procedure IsSquare; IsSquare := Width=Height;

Update; ! Life of rectangle started at creation; OutText("Rectangle created: "); OutFix(Width,2,6);OutFix(Height,2,6); OutImage End of Rectangle; End of Rectangle

History of SmalltalkHistory of Smalltalk

Developed at Xerox PARC in 1971-2.Developed at Xerox PARC in 1971-2. Developed by Developed by Alan Kay et alet al to be a to be a

compact powerful OOPL, analogous to compact powerful OOPL, analogous to LISP.LISP.

Designed in parallel to the Dynabook Designed in parallel to the Dynabook project.project.

Public release in 1980 (Smalltalk-80).Public release in 1980 (Smalltalk-80).

Smalltalk featuresSmalltalk features

Pure object-orientedPure object-oriented Dynamically and strongly typedDynamically and strongly typed Reflective language (self-modifying)Reflective language (self-modifying) Garbage collectionGarbage collection Everything is an object. Classes are Everything is an object. Classes are

instances of metaclasses.instances of metaclasses.

Smalltalk exampleSmalltalk example

| x y className methodName |

className := 'Foo'.

methodName := 'hello'.

x := (Compiler evaluate: className).

(x isKindOf: Class) ifTrue: [

y := x new.

(y respondsTo: methodName asSymbol) ifTrue: [

y perform: methodName asSymbol

]

]

History of AdaHistory of Ada

In 1975, DoD put out a request for a In 1975, DoD put out a request for a language meeting certain goals (language meeting certain goals (Steelman requirements). No existing language met requirements). No existing language met these goals, so a new language was these goals, so a new language was created.created.

Jean Ichbiah created the language Ada – Jean Ichbiah created the language Ada – 83 to meet these goals.83 to meet these goals.

Ada – 95 was the next installment of the Ada – 95 was the next installment of the language, designed by S. Tucker Taft.language, designed by S. Tucker Taft.

Ada FeaturesAda Features

Exception handlingException handling ModularityModularity Statically and strongly typed.Statically and strongly typed. GenericsGenerics Dynamic bindingDynamic binding InheritanceInheritance Garbage collectionGarbage collection

Ada ExampleAda Example

with dates; use dates; -- definition of type datewith dates; use dates; -- definition of type date

package persons is package persons is

type person is tagged type person is tagged

record record

name :string(1..10);name :string(1..10);dob :date; dob :date;

salary :float := 0.0; salary :float := 0.0;

end record; end record;

procedure employ(someone:in out person); procedure employ(someone:in out person);

procedure dismiss(someone:in out person); procedure procedure dismiss(someone:in out person); procedure pay_raise(someone:in out person);pay_raise(someone:in out person);

end persons; end persons;

Ada Example, Part 2Ada Example, Part 2

with persons; use persons; with persons; use persons;

package managers is package managers is

type manager is new person with type manager is new person with

record master_key_code :string(1..10); record master_key_code :string(1..10);

end record; end record;

procedure allocate_master_key( someone:in out procedure allocate_master_key( someone:in out manager; code :in string); manager; code :in string);

procedure pay_raise(someone:in out person); procedure pay_raise(someone:in out person);

end managers; end managers;

Python History

Developed in late 1980’s by Guido van Rossum. Open source.

Published in 1991. Version 1.0 released in 1994. Versions 1.6 and 2.0 released in 2000. GNU GPL compatible since 2001 Python 3.0 (Python 3000) released in

alpha version in 2007.

Python Features

Simple, easy to learn language Dynamically and strongly typed Metaclasses Exception handling Garbage collection

Python Exampleclass Stack: def __init__(self): # Initialize the stack

self.stack = [ ] def push(self,object):

self.stack.append(object) def pop(self):

return self.stack.pop() def length(self):

return len(self.stack)

#Examples = Stack() # Create a stack s.push("Dave") # Push some things onto it s.push(42) s.push([3,4,5]) x = s.pop() # x gets [3,4,5] y = s.pop() # y gets 42 del s # Destroy s

C++ History

Bjarne Stroustrup began working on the idea of an efficient OOPL in 1979 at AT&T Labs.

Started developing C with Classes, that combined features of Simula and C.

1980 version had classes, inheritance, public/private, ctors and dtors, friends, type checking, inline, overloading assignment operator

C++ History – Part 2

Finished the first C++ compiler, Cfront, in 1983. Cfront was written in C++, but converted code into C.

In 1983, Rick Mascitti suggested the name C++ for the language.

Added features: virtual functions, overloading, references, const, operator new

C++ History – Part 3

In 1985, published first edition of The C++ Programming Language and version 1.0 of C++ released.

In 1989, version 2.0 released. Added features: multiple inheritance, abstract classes, const member functions, protected members.

In 1990, The Annotated C++ Reference Manual was published.

C++ History – Part 4

Templates proposed in 1988. Exception handling designed, with Andrew

Koenig, in 1989. I/O library designed by Jerry Schwarz and

Koenig for version 2.0. X3J16 standardization committee formed

in December 1989.

Standard Template Library History

In 1987 Alex Stepanov and David Musser, at GE R&D, developed a generic list processing library for Ada.

Stepanov presented his idea of a generic library for C++ at the November 1993 meeting of X3J16.

The library design was developed (with Meng Lee) and approved at the March 1994 meeting.

C++ History – Part 5

C++ standard was approved on November 14, 1997.

Corrected version of the standard was approved in 2003.

C++ - the Future

Library Technical Report 1 (TR1) released in 2005. Suggestions such as smart pointers, metaprogramming, improved functors, improved numerical functions, regular expressions, fixed size array class, hash tables. Expected to be adopted for next version of standard.

top related