Lecture 1
Lecture 1
Preliminaries
COM 202 Programming Languages (3+0) – 6 - 6
• Quizzes / Homeworks : 20 %
• Midterm : 30 %
• Final : 50 %
Reference Books
– Robert W. Sebesta, “Concepts of Programming Languages”, Pearson, 11th Edition (also 10th is OK)
Tentative Course Outline
A language is a vocabulary and set of grammatical rules for communication between people.
A programming language is a vocabulary and set of grammatical rules for instructing a computer
to perform specific tasks.
• Systems programming
– Low-level control, high performance, and efficient memory management.
– Need efficiency because of continuous use
– C, C++, Swift
• Readability: the ease with which programs can be read and understood
• Writability: the ease with which a language can be used to create programs
• Reliability: conformance to specifications (i.e., performs to its specifications)
• Cost: the ultimate total cost
• Overall simplicity
– A manageable set of features and constructs
– Minimal feature multiplicity
– Minimal operator overloading (a single operator symbol has more than one meaning
such as +)
• Orthogonality
- If data types and operations in a programming language can work independently of each
other, then that language is more orthogonal.
• Data types
– Adequate predefined data types
• Syntax considerations
– Identifier forms: flexible composition A flag may be defined as integer
– Special words and methods of forming
compound statements
– Form and meaning: self-descriptive
constructs, meaningful keywords
• Expressivity
– A set of relatively convenient ways of specifying operations
• Type checking
– Testing for type errors
• Exception handling
– Intercept run-time errors and take
corrective measures
Reliable: it performs to its specifications under all conditions a and b both point to the same list
in memory. When b[0] = 99 is
executed, the list that
• Aliasing both a and b reference is modified,
and this change is reflected in both
– Presence of two or more distinct variables because they refer to the
referencing methods for the same same list.
memory location
• Readability and writability
4. Cost of executing programs: If a language requires many run-time type checking, the
programs written in that language will execute slowly.
- Trade-off between compilation cost and execution cost.
6. Cost of reliability: important for critical systems such as a power plant or X-ray machine.
• Imperative
– Central features are variables, assignment statements, and iteration
– Include languages that support object-oriented programming
– Include scripting languages
– Include the visual languages
– Examples: C, Java, Perl, JavaScript, Visual BASIC .NET, C++
• Functional
– Main means of making computations is by applying functions to given parameters
– Examples: LISP, Scheme, ML, F#
• Logic
– Rule-based (rules are specified in no particular order)
– Example: Prolog
• Markup/programming hybrid
– Markup languages extended to support some programming
– Examples: JSTL(JSP Standard Tag Library) , XSLT (Extensible Stylesheet Language
Transformations)