This document provides an overview of programming languages and programming methodologies. It discusses what programming languages and computer programs are, provides a brief history of programming languages, and outlines attributes of good languages. It then covers different programming methodologies including unstructured programming, procedural programming, and object-oriented programming. Object-oriented programming is described as keeping large software projects manageable by decomposing problems into understandable modules that can be developed incrementally and combined through interfaces. The main features of object-oriented languages that support this approach are also listed.
2. The Study of Programming Languages
The purpose of language is simply that it
must convey meaning (Confucius)
Whatever can be said, can be said clearly
(Wittgenstein,1963)
A programming language is a notation for
writing programs (Sethi,89)
– program is a specification of a computation.2
3. What is a programming language?
A language that is intended for the
expression of computer programs and
that is capable of expressing any computer
program
3
Computer program is a specification of a computation.
4. What is Programming Language
4
ComputerProgram
Programming
Language
Output
use
giveswriteUser
executes
Problem
takes
5. A short history of programming
Languages
Early languages:
– Numerically based languages. (FORTRAN:55,ALGOL:58)
– Business languages. (COBOL:60)
– Artificial intelligence languages. (LISP,Prolog)
– Systems languages. (C:70)
1950 : LISP, FORTRAN, COBOL, ALGOL60, BASIC
1970 : Ada, C, Pascal, Prolog
1980 : C++
1990 : Delphi, Perl
1996 : Java by James Gosling (at SUN Micro Systems)5
6. Attributes of a good language
Clarity and simplicity
– Readability
Naturalness for the application
Ease of program verification
– Proof of correctness, test
– Simplicity of semantic and syntax
Portability of programs
Cost of use
– Program execution
– Program translation
– Program creation, testing, and use
– Program maintenance6
7. Programming Methodology
Kind of approach to solve different problems
How should programs be designed?
How should programs be structured?
8. Programming Methodologies Influences
1950s and early 1960s: Simple applications; worry
about machine efficiency
Late 1960s: People efficiency became important;
readability, better control structures
– structured programming
– top-down design
Late 1970s: Process-oriented (Goal or.) to data-oriented
(DB or.)
– data abstraction
Middle 1980s: Object-oriented programming
– Data abstraction + inheritance + polymorphism
10. Unstructured Programming
Direct code (step)
Ex: Assembly Language
Adv.
speed (written in assembly)
Disadv.
No re-usability
Statements written many times
As code increases, complexity increases
– Hard to manage large programs
– Hard to debug
11. Procedural oriented Programming
Top-down approach
Procedure (Function) are building block
De-allocation problem (memory leak: memory allocated
but not used)
Un- initialized Variables (rand value assigned)
Ex: Calculator → scientific
→ non-scientific → float
→ int → add.
→ subs.
→ mult.
→ div.
Ex: C - language
Small
functions
12. Procedural oriented Programming
Adv:
– Re-usability
– Easy to debug
Disadv:
– Concentrate on what we want to do, not on who will use it
– Data does not have a owner (sharing)
– All functions are global
– No data security
Ex: let there are three functions a(),b() and c(). Data d is used by
a() and b() but how to restrict from c() [data will be either global
or local]
– No data integrity [Stack:{push,pop},Queue:{enque, deque}]
How to distinguish which fun associated with which data
structure
13. Object-Oriented Programming
Keep large software projects manageable by
human programmers
Bottom-up approach (user oriented)
Objects are building block
14. An Example
Everything in OOP is grouped as self sustainable
"objects".
let’s take your “hand” as an example.
– Your body has two objects of type hand, named left hand and
right hand. Their main functions are controlled/ managed by a
set of electrical signals sent through your shoulders
– So the shoulder is an interface which your body uses to interact
with your hands.
– The hand is being re-used to create the left hand and the right
hand by slightly changing the properties of it.
14
15. Another Example
Ex: college (Student, Faculty, Admin)
Student (take course, write exam, view indv. result)
Faculty (set paper, prepare result, view results)
Admin (student admission, staff/faculty selection)
15