Final review
Chapter 1
High level and low level languages
Compiler versus interpreter
We can look at interpreter as a high level machine. Machine is brought up to the level of the program
Compiler the program is brought down to the level of the machine
Java: Uses both the techniques. Program is brought down to a low level (byte codes) that is common to all the operating systems by Java compiler. Machines are brought up to the same level using Java interpreter.
Is Java approach efficient? No.
We use Java because we have different types of machines with different machine languages. A variety of OSs dont help either.
Java helps us work through the mess.
This wasnt a problem before because we didnt have global client server computing.
Local client/server computing makes sure that client and servers are compatible through appropriate purchasing decision. Not possible on the internet.
Different programming paradigms and examples
Chapter 2.
Different types of notations for specifying an expression
Lexical syntax
Context free grammars: EBNF, Syntax diagrams
Chapter 3
Structured programming
Different types of iterative structures, and conditional structures
We only need an if structure and a goto statement to do everything we need to do.
Descriptive questions
Some of the implementation details: why is switch statement better than if in some cases.
Preconditions, postconditions and proof rules
What are examples of limited gotos, how these limited gots preserve structured programming, how they make the programs even more readable.
A readable program is the one that has as few conditional structures as possible.
Data structures
Basic types
Arrays versus records
variant records/union
enumerated variables
sets
pointers
You are not expected to write code. But I may give you code to help you make answers more precise.
Strong typing versus weak typing: Look at forking.cpp
Procedures and Functions
Different types of parameter passing
value, reference, constant, constant reference, by name, value result
passing functions in contrast to templates and polymorphism
Lexical and dynamic scoping page 161-163.
Activation records in general
Activation records in C
Stack versus heap allocations
Object Oriented Programming
C++ and java
More time spent on C++
We first looked at C++ as better C (imperative programming).
How classes provide better data abstraction through encapsulation
Other OOP principles include inheritance and polymorphism
Polymorphism: Definition in the book is broader. It includes operator/function overloading, templates as well as virtual functions
Exception handling: try, throw and catch
How inheritance and polymorphism can be used to make exception handling better
Why dont we call them errors instead of exceptions? How do they relate to concurrent programming.
Possible question will have a C++ program and you will be asked to write down the output of the program. As well as testing the understanding of the program
Descriptive questions
Java: Mostly descriptive questions
Classes versus interfaces, how they can have independent hierarchies
Many of the C++ concepts are stripped down
Logic Programming
Difference between propositional logic and predicate logic
Translating english language to logical sentences
Informally explain the inference procedure for a give prolog program
Functional programming
Lambda notations: represent a function using lambda notations. Not the lambda notations from Lisp. Advantages and disadvantages
A program similar to the last assignment
Descriptive questions on how list is implemented in Lisp, where did we get the car and cdr terminology, garbage collection: what, why and how.