CSE130 LECTURE NOTES
April 1, 2002
WELCOME
This is CSE 130. Please see today's introductory
handout. Points to note:
-
Section on Fridays.
-
Two excellent TAs: Greg Hamerly and Joe Drish.
-
Good textbook.
-
Do come to lectures, but not if you won't pay attention.
-
When I ask a question in class, please do raise your hand to answer it.
-
Some team programming projects, each with a short written report.
-
Teams of exactly three.
-
Absolute academic honesty is required.
-
Easy to ask questions with the class
bulletin board.
-
Account slips to be distributed on Wednesday.
Class will start at 6:50pm sharp and end at 8:10pm sharp. The first
assignment will be individual, and will be handed out on Wednesday.
OVERVIEW OF THE COURSE
A programming language is a notation for writing software. Good programming
languages have many properties:
-
Readability for humans
-
Portability across multiple OSs and multiple CPU architectures.
-
Abstraction, i.e. letting the implementation decide details instead of
the programmer.
-
Performance.
-
Programmer productivity, especially facilitating code reuse.
-
More...
A common theme is that the design of the PL should help the programmer
avoid mistakes. To err is human!
All the properties above are design objectives. Sometimes the
objectives can conflict, for example portability and performance.
But often multiple objectives point in the same direction.
Why study programming languages?
-
To understand the most widely used languages (e.g. C++, Java, Visual Basic)
better.
-
To choose the best language for new applications.
-
Perhaps as a foundation for research on improved languages.
Because PLs are interesting!
HISTORY OF PROGRAMMING LANGUAGES
Most of the ideas of modern PLs appear in four or five classic languages:
-
Fortran (1956/8): Jump-based control structures (looping, conditionals),
subroutines, arrays, formatted I/O.
-
Cobol: Task-specific types for business applications, e.g. decimal arithmetic
and strings. English-like notation.
-
Algol (1960+): Lexical scoping, composite types (records), automated type-checking,
high-level control structures, recursion.
-
Lisp (1959): Functions yielding functions as return values, same notation
for code and data, dynamic typing, recursion in lieu of iteration.
-
Simula (1967): Information hiding, object-oriented programming.
I said "four or five classic languages" because Cobol has not had much
impact on later languages, although it remains important.
Fortran's most important innovation was the very idea of a high-level
PL, i.e. that a compiler could generate machine code from a program written
in a machine-independent notation. But CSE 130 is not about compilers.
Some famous later languages were innovative, like Smalltalk, but it
is arguable that all the major ideas in use today come from the languages
listed above.
CSE 130 TOPICS
We will study modern languages that are in widespread use:
-
C: Close to standard sequential hardware.
-
Pascal: Designed to minimize programmer errors, and for structured flow
of control.
-
ML: Very high-level, first-class functions, no destructive assignment,
no explicit pointers, automated type inference.
-
Java: For safe, portable, multi-threaded computing; object-oriented.
-
Ada: For embedded, fault-tolerant computing; full type-checking.
-
PHP: For rapid prototyping of web-oriented applications; dynamic typing.
-
Prolog: For high-level, declarative programming; built-in search algorithm.
We won't study C++ directly, because it is not as well-designed as the
languages above. It is an interesting sociological question why C++
is so widely used today. Possible answers include that C++ is widely
available, close to traditional CPU architecture, and familiar to most
programmers since it is based on C.
CSE 130 will be organized by concept, not by language. All
the languages mentioned above have many more similarities than differences.
We will concentrate on the core concepts that all widely used modern languages
are based on.
Copyright (c) by Charles Elkan, 2002.