Professional Documents
Culture Documents
Week 1
Week 1
Introduction
One important practical objective for this course is to help you learn how to learn
programming languages. Inevitably, if you are to have a career in software engineering
work, you will have to learn new programming languages at various times.
One way to develop your ability to learn languages is simply to learn several of them.
Learning the first one is hard, the next one often not so hard and so on. After you've
learned several, you will feel that learning new ones is a snap: you just learn to cope with
some new syntax and you're set.
Another practical objective of this course is to help you learn how to be a better
programmer in whatever language you use. Often you will not be in a position to specify a
language of your choice. Nevertheless, with a broad background in the paradigms and
issues of programming languages you will be in a much better position to consider solutions
to programming problems in any particular language that you must use. For example, you
may find that a solution could easily be expressed using the facilities of some language
other than that specified. You may then be able to develop creative ways to use that
solution to guide you in working with the specified language.
With a broad knowledge of programming language concepts and issues, you should also be
in a good position to perform a critical evaluation of the strengths and weaknesses of
whatever language you are using. Using the strengths, you may find novel creative ways to
solve problems. Focussing on the weaknesses, you will be able to identify obstacles or
pitfalls in developing a solution and take appropriate measures to avoid them altogether or
reduce their impact.
Definition
Week 1
MODULE 1
Structure of Programming Languages & Compiler Design: Course Introduction
In the 1980s, object-oriented programming (OOP) evolved out of the need to better
develop complex programs in a systematic, organized approach. The OOP approach allows
programmers to create modules that can be used over and over again in a variety of
programs. These modules contain code called classes, which group related data and actions.
Properly designed classes encapsulate data to hide the implementation details, are versatile
enough to be extended through inheritance, and give the programmer options through
polymorphism. Object-oriented languages include Java, C++ and Visual Basic.
Programming Domains
Defines a specific kind of use for a programming language.
• Scientific applications
– In the early 40s computers were invented for scientific applications.
– The applications require large number of floating point computations.
– Fortran was the first language developed scientific applications.
– ALGOL 60 was intended for the same use.
• Business applications
– The first successful language for business was COBOL.
– Produce reports, use decimal arithmetic numbers and characters.
– The arrival of PCs started new ways for businesses to use computers.
– Spreadsheets and database systems were developed for business.
• Artificial intelligence
– Symbolic rather than numeric computations are manipulated.
Week 1
MODULE 1
Structure of Programming Languages & Compiler Design: Course Introduction
– Symbolic computation is more suitably done with linked lists than arrays.
– LISP was the first widely used AI programming language.
• Systems programming
– The O/S and all of the programming supports tools are collectively known as
its system software.
– Need efficiency because of continuous use.
• Scripting languages
– Put a list of commands, called a script, in a file to be executed.
– PHP is a scripting language used on Web server systems. Its code is
embedded in HTML documents. The code is interpreted on the server before
the document is sent to a requesting browser.
• In some cases, a language became widely used, at least in part, b/c those in
positions to choose languages were not sufficiently familiar with P/L concepts.
• Many believe that ALGOL 60 was a better language than Fortran; however,
Fortran was most widely used. It is attributed to the fact that the
programmers and managers didn’t understand the conceptual design of
ALGOL 60.
• Do you think IBM has something to do with it?
Week 1
MODULE 1
Structure of Programming Languages & Compiler Design: Course Introduction
1. Readability – The ease with which programs can be read and understood is called
readability. The following describe characteristics that contribute to the readability of
a PL.
a. Simplicity – The language that has large number of basic components is
more difficult to learn than one with small number of basic components.
b. Orthogonal – It means that a relatively small number of primitive
constructs can be combined in a number of ways to build the program.
c. Control Statements – A program that can be read from top to bottom is
much easier to understand than a program that requires the reader to
jump from one statement to some other non adjacent statement.
d. Data Types and Structures – The presence of adequate facilities for
defining data types and data structures in a language is another
significant aid to readability
e. Syntax Considerations – Syntax is the form of elements of language.
2. Writability – The measure of how easily a language can be used to create programs
for a chosen problem domain.
3. Reliability – A program is said to be reliable if it performs to its specifications under
all conditions. Along with all the features that affect readability and writability there
are several other features that affect reliability.
a. Type Checking – It is the testing for type errors in a given program either
by compiler or during program execution.
Ex:
1. Countless Loops
2. Formal and actual parameters being of different types
3. Array out of bounds
Programming Environments
Week 1
MODULE 1
Structure of Programming Languages & Compiler Design: Course Introduction
UNIX is an older programming environment, first distributed in the middle 1970s, built
around a portable time sharing operating system. UNIX is now often used through a
graphical interface that runs on top of UNIX. One example of such a graphical interface is
the Common Desktop Environment (CDE).
The latest is the Microsoft Visual C++; this is a large and elaborate collection of software
development tools. All used through a windowed interface.
Assignment:
Search for different programming language. List as many as possible
Explain each definition and identify their specialities
Quiz:
Week 1