computer programming. computer programming quick review…

20
COMPUTER PROGRAMMING

Upload: terence-lee

Post on 29-Dec-2015

222 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: COMPUTER PROGRAMMING. Computer programming Quick review…

COMPUTER PROGRAMMING

Page 2: COMPUTER PROGRAMMING. Computer programming Quick review…

Computer programming• Quick review…..

Page 3: COMPUTER PROGRAMMING. Computer programming Quick review…

Types of programming languagesMachine language

• Only language computer directly understands• “Natural language” of computer• Defined by hardware design

– Machine-dependent• Generally consist of strings of numbers

– Ultimately 0s and 1s• Instruct computers to perform elementary operations

– One at a time• Cumbersome for humans• Example:

– +1300042774+1400593419+1200274027

Page 4: COMPUTER PROGRAMMING. Computer programming Quick review…

Types of programming languagesAssembly language

• English-like abbreviations representing elementary computer operations

• Clearer to humans• Incomprehensible to computers

– Translator programs (assemblers)• Convert to machine language

• Example: – LOAD BASEPAYADD OVERPAYSTORE GROSSPAY

Page 5: COMPUTER PROGRAMMING. Computer programming Quick review…

Types of programming languagesHigh-level languages

• Similar to everyday English, use common mathematical notations• Single statements accomplish substantial tasks

– Assembly language requires many instructions to accomplish simple tasks

• Translator programs (compilers)– Convert to machine language

• Interpreter programs– Directly execute high-level language programs

• Example:– grossPay = basePay + overTimePay

Page 6: COMPUTER PROGRAMMING. Computer programming Quick review…

What are Interpreters, compilers and assemblers?

• Interpreter:

it converts each high level instruction into a series of machine instructions and then immediately run (or execute) those instructions.• Compilers:

convert a finished program (or section of a program) into object code. This is often done in steps.• Assemblers:

program which convert the symbolic instructions ( which is written in an assembly language) into object or machine code.

Page 7: COMPUTER PROGRAMMING. Computer programming Quick review…

size of programs

• Programs are generally divided into three basic sizes: trivial, small, and large.

• Trivial programs are programs that a skilled programmer can write in less than two days of coding.

• Small programs are programs that one skilled programmer can write in less than one year of full time work.

Page 8: COMPUTER PROGRAMMING. Computer programming Quick review…

Con. Size of programs• Large programs are programs that require more than two

to five man-years of labour, normally written by programming teams (which can exceed 1,000 skilled workers).

Page 9: COMPUTER PROGRAMMING. Computer programming Quick review…

Nice stories• Larry Ellison wrote the first version of Oracle database by

himself in about six months. That is a genius exception. Data bases typically take large teams (sometimes hundreds of programmers) at least a year.

• Another story • Bill Gates, copying and pasting from the source code of

three working open source versions, took more than six months to create a bug-filled BASIC compiler and then hired a team of six skilled programmers who spent more than six more months to get rid of enough bugs to make the compiler somewhat usable (a total of more than three man-years).

Page 10: COMPUTER PROGRAMMING. Computer programming Quick review…

• That is an exception. A BASIC compiler typically takes a skilled programmer a few hours to create. Note that Bill Gates takes credit for quickly having created a BASIC compiler, but according to other sources he was sued for having illegally used open source code for commercial purposes, forcing him to spend a great deal of time attempting to do a project that many programmers of the day could successfully finish in hours.

Page 11: COMPUTER PROGRAMMING. Computer programming Quick review…

History of programming languages• There have been thousands of programming languages,

many of which have been lost to history.• FORTRAN (FORmula TRANslation)• was created in 1954 by John Backus and other

researchers at International Business Machines (now IBM).

• Released in 1957. • FORTRAN is the oldest programming language still in

common use. • FORTRAN was the first high-level language, using the

first compiler ever developed.

Page 12: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History

• Prior to Fortran, programmers were required to program using machine / assembly languages.

• Significant features of the language are listed below:”

1. Simple to learn.

2. Machine Independent ( easy transportation).

3. Efficient execution.

4. Ability to control storage allocation (considered today as a dangerous practice)

Page 13: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History• LISP

• LISP (LISt Processing)• was created n 1958.• released in 1960 by John McCarthy of MIT.• the second oldest programming language still in common

use.• was intended for writing artificial intelligence programs.

Page 14: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History• COBOL

• COBOL (COmmon Business Oriented Language)• was created in May 1959 by the Short Range Committee

of the U.S. Department of Defense (DoD).• Numbers of versions.• The last one in 2002.• 1997 and 2002 were Object Oriented versions.

Page 15: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History• BASIC

• BASIC (Beginner’s All-purpose Symbolic Instruction Code)

• was designed as a teaching language in1963 by John George and Thomas Eugene Kurtz of Dartmouth College.

• BASIC was intended to make it easy to learn programming.

• The first BASIC program was run at 4 a.m. May 1, 1964.

Page 16: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History

Pascal

• Pascal (named for French religious fanatic and mathematician Blaise Pascal)

• was created in 1970 by Niklaus Wirth.• Work started in 1968. • Pascla intended as a teaching language to replace

BASIC.

Page 17: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History• C

• C was developed from 1969-1972 by Dennis Ritchie.• Was developed for use in systems programming for UNIX.

• SQL• SQL (Standard Query Language)• was designed by Donald D. Chamberlin and Raymond F.• Designed by IBM in 1974.

Page 18: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History• Ada

• Ada was first released in 1983 (ADA 83),• other releases in 1995 (ADA 95) and 2005 (ADA 2005).• Ada was created by the U.S. Department of Defence

(DoD).• originally intended for embedded systems and later

intended for all military computing purposes.• C++

• c++ was developed in 1983 by Bjarne Stroustrup at Bell Telephone Laboratories.

• to extend C for object oriented programming.

Page 19: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History• Java

• Java (named for coffee).• was created by James Gosling and others at Sun

Microsystems for embedded systems.• released for applets in 1995.• Original work started in 1991 as an interactive language

under the name Oak.• Rewritten for the internet in 1994.

Page 20: COMPUTER PROGRAMMING. Computer programming Quick review…

Cont. History• JavaScript

• JavaScript (originally called LiveScript).• was created by Brendan Elch at Netscape in 1995.• A scripting language for web pages.

• PHP• PHP (PHP Hypertext Processor)• was created by Rasmus Lerdorf in 1995.

• C#• C# was created by Anders Hajlsberg.• The main language of Microsoft’s .NET.