Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Introduction to Programming

This document provides an introduction to programming languages, covering their definitions, history, classifications, and evaluation criteria. It discusses programming paradigms, generations of languages, and the importance of syntax, semantics, and pragmatics in understanding programming. Additionally, it outlines key evaluation criteria for programming languages from both user and technical perspectives.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Introduction to Programming

This document provides an introduction to programming languages, covering their definitions, history, classifications, and evaluation criteria. It discusses programming paradigms, generations of languages, and the importance of syntax, semantics, and pragmatics in understanding programming. Additionally, it outlines key evaluation criteria for programming languages from both user and technical perspectives.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Introduction to Programming

Objectives
At the end of this chapter, you should be able to:
1. Define a programming language
2. Trace the history of programming languages
3. Classify programming languages according to
programming paradigm, application,
generation
4. List criteria for evaluating programming
languages
5. Define syntax, semantics and pragmatics
What is a programming language?
1. A programming language is a system for describing
computation.
2. A system of signs used by a person to communicate a
task/algorithm to a computer, causing the task to be
performed.
3. More of a set of commands that is formulated by the
user (programmer) and executed by the computer.

**a one way communication from the user to the


computer and not vice versa.
History
1. FORTRAN 11. Algol-68
2. Algol-60 12. Pascal
3. LISP 13. C
4. COBOL 14. Prolog
5. APL 15. Smalltalk
6. BASIC 16. Modula-2
7. Algol-W 17. ADA
8. Jovial 18. C++
9. PL/I 19. Java
10. SIMULA-67
Programming Language Paradigm
• a model or pattern for something that may be
copied
• a theory or a group of ideas about how
something should be done, made, or thought
about
• a standard, perspective, or set of ideas.
A paradigm is a way of looking at something.
Programming Language Paradigm
Wegner (1989) classified languages into two
language paradigms, namely: imperative
languages and declarative languages.
Programming Language Paradigm
IMPERATIVE LANGUAGES
• Block-structured languages
• Object-based languages
• Distributed programming paradigms
DECLARATIVE LANGUAGES
• Logic programming
• Functional languages
• Database languages
Applications of Programming Languages
• Scientific computation
• Data processing
• Artificial intelligence
• Text processing
• System programming
• General purpose
Generations of Programming Languages
• First Generation- includes all the low-level
languages like machine and assembly
language

• Second Generation- composed mainly of


languages designed during the early 1960’s. It
includes ALGOL-60, BASIC, COBOL, and
FORTRAN
Generations of Programming Languages
• Third Generation- high level language that came out and perfected in the
late 1960’s up to the present. Such languages are considered high-
level because they are closer to human languages and further from
machine languages.

There is the procedural (imperative paradigm) languages like PL/I, Pascal,


Modula-2, C, Ada.

Then, the functional languages like the Lisp, APL, and ML. There are also
the logic languages like Prolog.

And finally, the object-oriented languages like C++, Objective-C, Smalltalk,


Object Pascal, Eiffel, Ada-95, and Java.
Generations of Programming Languages
• Fourth Generation languages are those domain specific languages.
A domain specific language (DSL) is a programming language that is
developed to meet a specific need.
Example for visual programming environments are Visual Basic, Delphi,
Visual Age, Visual C++.

We also have languages for database systems like Natural, SQL, Access,
FoxPro, dBase, AdaBase.

Expert system shells like OPS5, EMYCIN, CLIPS, EXSYS are also fourth
generation.

Even spreadsheet languages Excel, QuattroPro, Lotus 1-2-3 are part of


fourth generation.
Evaluation Criteria of Programming
Languages
From the user point of view, one might use the following
general criteria:
1. Readability – Is it easy to read and understand a
program or portion of a program written in the
language?
2. Writability – Is it easy to write programs in the
language?
3. Reliability – Does the program help prevent errors?
4. Cost – How expensive is it to develop, use, and
maintain programs written in the language?
Evaluation Criteria of Programming
Languages
For a more extensive evaluation of the language, one might
consider the following criteria:
1. Simplicity – Is there only one (or few) way of expressing a
concept?
2. Othogonality – Are the facilities highly independent, ex. If
there is a feature for sequence control, then no additional
facility for sequence control should be present in the
language?
3. Adequacy – Is it possible to express the solutions to all
problems to be solved in it?
4. Syntax – Is the syntax clear and understandable?
Evaluation Criteria of Programming
Languages
5. Abstraction - Is there a way to take virtually any
internally consistent theme of a program,
describe it, name it, and use only the name
subsequently?
6. Assertions – Does the language have a facility to
state propositions that should hold regardless of
the details of implementation?
7. Hierarchical decomposition – Is there a facility to
express a top-down analysis of programming
task?
Evaluation Criteria of Programming
Languages
8. Modular decomposition – Is there a facility to express
program units that may be semi-independently
written or executed?
9. Sequencing – Is there a facility to control the sequence
of events during computation, fully or partially?
10. Data manipulation – Is there a facility to carry out
primitive operations on the data?
11. Redundancy – Is there a facility to guide programming
by detecting and diagnosing inconsistencies of the
programmer?
Levels of Programming Language
• Machine language – This is the lowest level since it is
machine specific and is not designed for a specific
structure of a problem. This is equivalent to the
instructions for operating the home appliances like
microwave oven, TV, and the likes.

But unlike the instruction sets of these appliances,


machine languages for computers are usually written
as codes composed of 0’s and 1’s. One specific
pattern of 0’s and 1’s means one instruction.
Levels of Programming Language
• Assembly language – introduced because of the
difficulty on the part of the programmers to
decipher machine languages. This is structurally
similar to machine languages except that the 1’s
and 0’s are replaced by pneumonic names for the
operator part of the instruction, and numeric and
alphabetic symbols are used for the operands.

Assembly languages are still considered low-level.


Levels of Programming Language
• High-level language – Higher than machine
and assembly languages. Higher in the sense
that high-level languages have program
structure divorced from the structure of the
machine that execute them.

Most high-level languages are designed to


facilitate the writing of solutions to problems
they are designed to solve.
Syntax, Semantics and Pragmatics
• Syntax - the grammar, structure, or order of
the elements in a language statement. In
computer science, the syntax of
a programming language is the set of rules
that define the combinations of symbols that
are considered to be correctly structured
programs in that language.
Syntax, Semantics and Pragmatics
• Semantics - describes the processes a
computer follows when executing a program
in that specific language. This can be shown by
describing the relationship between the input
and output of a program, or an explanation of
how the program will execute on a
certain platform, hence creating a model of
computation.
Syntax, Semantics and Pragmatics
• Pragmatics – refers to the history and some
implementation methodology specific to the
language.

- the third general area of language


description, referring to practical aspects of
how constructs and features of a language
may be used to achieve various objectives.
Questions
1. In your own words, define a programming
language.
2. Give the basic difference between a
declarative and an imperative language.
3. In your own words, differentiate syntax,
semantics and pragmatics.

You might also like