PL Review Questions Flashcards
(130 cards)
Why is it useful for a programmer to have some background in language design, even though he or she may never actually design a programming language?
Because it will increase the ability to express ideas and choose the most suitable language to create some program. Also, it will make it easier to learn another programming language because we already know key concepts.
What programming language has dominated scientific computing over the past 60 years?
FORTRAN (short for FORmula TRANslation).
What programming language has dominated business applications over the past 60 years?
COBOL (short for COmmon Business Oriented Language).
What programming language has dominated artificial intelligence over the past 60 years?
LISP (short for LISt Processor).
In what language is most of UNIX written?
C
What language used orthogonality as a primary design criterion?
ALGOL 68
What construct of a programming language provides process abstraction?
Subprograms
What does it mean for a program to be reliable?
A program is said to be reliable if it performs to its specifications under all conditions.
How can knowledge of programming language characteristics benefit the whole computing community?
By knowing the characteristics of programming languages, it would make the learning of a new language easier and get more people involved in programming. Easier learning process and involving more people would result in many new programming languages which are easier to understand and run things better.
What is the disadvantage of having too many features in a language?
Some of the features may be out of scope for the language, as this will increase memory requirements, and thin out performance efforts.
How can user-defined operator overloading harm the readability of a program?
User-defined operators can harm the readability of a program because the built in operator has the precision and the compiler knows all the precision between the operators, and it works on that precision. User can also create its own operator but the compiler does not know how to make precision of this operator. This will be the cause of the overloading harm.
What is one example of a lack of orthogonality in the design of C?
The use of the asterisk (*) symbol in C for both multiplication and dereferencing pointers is a clear example of a lack of orthogonality. This overlapping functionality leads to potential confusion and can result in programming errors.
What primitive control statement is used to build more complicated control statements in languages that lack them?
The selection statement plus GOTO is used to build more complicated control statements such as FOR loop.
Why is type checking the parameters of a subprogram important?
Type checking is an important factor in language reliability because it tests for type errors in a given program, either by the compiler or during the execution of a program.
What is aliasing?
Aliasing is two or more distinct names that can be used to access the same memory cell.
What is exception handling?
Exception handling is the ability of a program to intercept run-time errors and other unusual conditions detectable by the program and take corrective measures then continue which is an obvious aid to reliability.
Why is readability important to writability?
Readability is important to writability because if a programming language is difficult to read and understand then it can be difficult for a programmer to create new code that might need to interact or use other code.
How is the cost of compilers for a given language related to the design of that language?
The cost of compilers for a given language is related to the design of it because a language that requires many run-time type checks will prohibit fast code execution, regardless of the quality of the compiler.
What have been the strongest influences on programming language design over the past 50 years?
The basic architecture of computers (von Neumann).
What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture?
Imperative languages
What two programming language deficiencies were discovered as a result of the research in software development in the 1970s?
Incompleteness of type checking and inadequacy of control statements
What are the three fundamental features of an object-oriented programming language?
Data abstraction, inheritance and (run-time) method.
or
Encapsulation, Inheritance and Polymorphism
What language was the first to support the three fundamental features of object-oriented programming?
Smalltalk
What is an example of two language design criteria that are in direct conflict with each other?
Reliability and cost of execution