Chapter 1 Flashcards

(39 cards)

1
Q
  1. 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?
A
  • Increased Capacity to express Ideas
  • Improved background for choosing appropriate languages
  • Increased ability to learn new languages
  • Better understanding of the significance of Implementation
  • Better use of languages that are already Known
  • Overall advancement of computing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. How can knowledge of programming language characteristics benefit the whole
    computing community?
A

If those who choose languages are better informed, better languages would eventually squeeze out poorer ones.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. What programming language has dominated scientific computing over the past 50
    years?
A

FORTRAN (short for FORmula TRANslation).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. What programming language has dominated business applications over the past 50
    years?
A

COBOL (short for COmmon Business Oriented Language).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. What programming language has dominated artificial intelligence over the past 50
    years?
A

LISP (short for LISt Processor).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. In what language is most of UNIX written?
A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. What are the disadvantages of having too many features in a language?
A

It reduces readability because features like feature multiplicity and operator overloading create different “subsets” of the language, making code hard for others to understand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. How can user-defined operator overloading harm the readability of a program?
A

Operator overloading harms readability because it allows standard symbols to perform unexpected operations, confusing the reader.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. What is one example of a lack of orthogonality in the design of C?
A

You can return a structure (record) from a function, but you cannot return an array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. What language used orthogonality as a primary design criterion?
A

ALGOL 68

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. What primitive control statement is used to build more complicated control statements
    in languages that lack them?
A

The goto statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. What construct of a programming language provides process abstraction?
A

Subprograms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. What does it mean for a program to be reliable?
A

A program is reliable if it performs to its specifications and handles errors gracefully under all conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. Why is type checking the parameters of a subprogram important?
A

Type checking the parameters is important because it ensures reliability by detecting errors where a function receives incompatible data. (e.g., receiving an integer bit-string when it expects a float)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. What is aliasing?
A

Having two or more distinct names that can be used to access the same memory cell.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. What is exception handling?
A

The ability of a program to intercept run-time errors, take corrective measures, and then continue execution.

17
Q
  1. Why is readability important to writability?
A

Because writing a program involves frequently re-reading the parts you have already written. If you can’t read it easily, you can’t write/modify it efficiently.

18
Q
  1. How is the cost of compilers for a given language related to the design of that language?
A

If the language design is very complex (like early Ada), the compilers are expensive to build and run. If the design is simple, compilers are cheaper.

19
Q
  1. What have been the strongest influences on programming language design over the past 50 years?
A

Computer architecture (Von Neumann) and programming design methodologies.

20
Q
  1. What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture?
A

Imperative languages.

21
Q
  1. What two programming language deficiencies were discovered as a result of the research in software development in the 1970s?
A

Incompleteness of type checking and inadequacy of control statements.

22
Q
  1. What are the three fundamental features of an object-oriented programming language?
A

Data abstraction, inheritance, and dynamic (run-time) method binding.

23
Q
  1. What language was the first to support the three fundamental features of object-oriented programming?
24
Q
  1. What is an example of two language design criteria that are in direct conflict with each other?
A

Reliability vs. Cost of Execution (e.g., Java’s array index checking makes it safer but slower).

Also, Writability vs. Readability (e.g., APL is very concise/writable but hard to read).

25
25. What are the three general methods of implementing a programming language?
Compilation, pure interpretation, and hybrid implementation systems.
26
26. Which produces faster program execution, a compiler or a pure interpreter?
A compiler
27
27. What role does the symbol table play in a compiler?
It serves as a database for the compilation process, storing type and attribute information for every user-defined name.
28
28. What does a linker do?
It collects system programs and libraries and links them to the user program, creating an executable image (load module)
29
29. Why is the von Neumann bottleneck important?
It is the primary limiting factor in the speed of computers.
30
30. What are the advantages in implementing a language with a pure interpreter?
Pure interpretation allows for easy implementation of source-level debugging operations (error messages can refer to specific lines in the source code).
31
What is expressivity
Expressivity is how concisely a language can specify computations to reduce code bulk.
32
What is writability
A measure of how easily a language can be used to create programs.
33
What is type checking
Type checking is simply testing for type errors in a given program, either by the compiler or during program execution.
34
What are the two types of abstraction
1. Process abstraction 2. Data abstraction
35
What are the two syntax consideration in syntax design?
1. Special words (for example, while, class, and for) 2. Form and Meaning (designing statements so their form can indicate its purpose)
36
What affects Readability?
1. Overall simplicity - Feature multiplicity - Operator overloading 2. Orthogonality 3. Data types 4. Syntax design
37
What affects Writability?
1. Simplicity and orthogonality 2. Support for abstraction 3. Expressivity
38
What affects Reliability?
1. Type checking 2. Exception Handling 3. Aliasing 4. Readability and Writability
39
List the programming domains
1. Scientific applications 2. Business applications 3. Artificial intelligence 4. Systems programming 5. Web Software