Chapt 1 - Preliminaries Flashcards

Why we study programming languages

1
Q

Capacity of ____ thought is influenced by our language skills.

A

Abstract

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Language is used to shape our thoughts in a ____ way.

A

Structured

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

One important language macro function is our ____ process.

A

Thought

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Different types of problems are better solved by the programming language which has ___ designed fo that specific task.

A

Constructs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Even though most programmers will never design their own language, there are 6 general benefits to learning the core idea behind language design.

A

1) Increased capacity to express ideas
2) Improved background for choosing appropriate languages
3) Increased ability to learn new languages
4) Better understanding of significance of implementation
5) Better use of languages that are already known.
6) Overall advancement of computing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Knowledge of the programming language characteristics can aid the whole computing community

A

In general, if those who choose the languages were well informed, better languages might squueze out poorer ones.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What programming language dominated scientific computing over 60 years?

A

Fortran

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What generally, are the language characteristic requirements for scientific applications?

A

Simple data structures but required large numbers of floating-point computations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What programming language dominated business computing over the 60 years.

A

COBOL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What, generally, are the language characteristic requirements for business applications?

A

Facilities for producing elaborate reports, precise ways of describing and storing decimal numbers and character data, and the ability to specify decimal arithmetic operations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What were the most common data structures required in scientific applications?

A

Matrices & arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What were the most common control structures required in scientific applications?

A

Counting loops and selections

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What was the first widely used progrmming language developed for AI applications?

A

Lisp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 3 language evaluation criteria?

A

Readability, Writability, Reliability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the 9 characteristics that affect language evaluation criteria?

A

Simplicity, Orthogonality, Data types, Syntax design, Support for abstraction, Expressivity, Type checking, Exception handling, Restricted aliasing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the 4 characteristics that impact readability?

A

Simplicity, Orthogonality, Data types, Syntax Design

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are the 6 characteristics that affect writability?

A

Simplicity, Orthogonality, Data types, Syntax Design, Support of abstraction, Expressivity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

One of the most importan criteria for judging a programming language is the ease with which programs can be read and understood is known as ___.

A

Readability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

___ must be considered in the context of the problem domain. For example, if a program that describes a computations is written in a language not designed for such use the program may be unnatural and convuluted.

A

Readability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

___ ___ of a programming language strongly affects its readability. A language with a large number of basic constructs is more difficult to learn than one with a smaller number.

A

Overall Simplicity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

___ ___ , a complicating characteristic of a programming languages, having more than one way to accomplish a particular operation.

A

Feature Multiplicity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

___ ___ is a potential problem in which a single operator symbol has more than one meaning.q

A

Operator overloading

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

___ in a programming language means that a relatively small set of primitive constructs can be combined in a relatively small number of ways to build the control and data structures of the language without EXCEPTION.

A

Orthogonality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are examples of lack of orthogonality in C?

A

1) Records (structs) can be returned from functions; arrays cannot
2) A member of a structure can be any data type EXCEPT void or a structure of the same type.
3) An array element can be any data type EXCEPT void or a function.

25
Q

What language used orthogonality as a primary design criterion?

A

According to book Algol 68; according to wikipiedia Lisp

26
Q

Using Assembly as the example language, if/else & switch/case do not exist, per se, as they do in C. However, the concept can be created using jump and branch statements. This is an example of using ___ control statements to build ___ control statements.

A

Primitive, Complex

27
Q

A program is said to be ___ if it performs to its specifications under all conditions.

A

Reliable

28
Q

___ ___ is simply testing for type errors in a given program b, either by the compiler or during program execution.

A

Type Checking

29
Q

Why is type checking the parameters of a subprogram important?

A

As an example, if, in a division process, an integer is passed rather than a float, the precision is lost; which, depending on the circumstance, could have catastrophic consequences.

30
Q

___ is having two or more distinct names in a program that can be used to access the same memory cell.

A

Aliasing

31
Q

The ability of a program to intercept run-timewe errors, take corrective measures, and then continue is known as ___?

A

Exception Handling

32
Q

Why is readability important to writability?

A

Programs that are difficult to read are difficult to both write and modify.

33
Q

___ is the name given to the collection of techniques that compilers may use to decrease the size and/or increase the execution speed of the code they produce.

A

Optimization

34
Q

What are the 5 contributing factors to cost?

A

1) Training programmers
2) Writing programs
3) Executing programs
4) Reliability
5) Maintaining programs

35
Q

What are the 3 MOST IMPORTANT criteria to consider when choosing a programming language?

A

1) Development
2) Maintenance
3) Reliability

36
Q

___: the ease with which programs can be moved from one implementation (platform) to another.

A

Portability

37
Q

___: the applicability to a wide range of applications

A

Generality

38
Q

___-___: the completeness and precision of the language’s official defining document.

A

well-definedness

39
Q

Generally speaking, unfortunately due to different perspectives, readability, writability and reliability often ___ with one another.

A

Conflict

40
Q

How is the cost of compilers for a given language related to the design of that language?

A

Cost of a compiler can have a great effect on its popularity. As an example, Ada’s first compilers were very expensive, thus attributed to it being less popular in its initial phase. While JAVA compilers have always been free, this has contributed to its increased popularity.

41
Q

___ ___ has been the strongest influence on language design.

A

Computer architecture

42
Q

Most of the poular languages of the past 60 years have been designed around the prevalent computer architecture, called the ___ ____ architecture.

A

von Neumann

43
Q

Languages based on the von Neumann architecture are called ___ languages.

A

imperative

44
Q

What are the characteristics of von Neumann architecture?

A

1) Memory stores both instructions and data
2) CPU is separate from memory
3) instructions/data (memory) => CPU (execution) => results (memory)

45
Q

What 2 programming language deficiencies were discovered as a result of the research in software development in the 1970s?

A

1) Lack of type checking can lead to unreliability of the code
2) Inadequacy of control statements requiring extensive usage of goto statements.

46
Q

What is the fetch-execute cycle in the von Neumann architecture?

A
  • initialize the program counter
  • repeat forever
      • fetch instruction pointed to by program counter
      • increment the program counter to point at the next instruction
      • decode the instruction
      • execute the instruction
  • end repeat
47
Q

The address of the next instruction to be executed is maintained in a register called the ___ ___.

A

program counter

48
Q

What are the 3 fundamental features of an object-oriented programming language?

A

1) Data Abstraction
2) Inheritance
3) Dynamic Method Binding or Polymorphism

49
Q

__ __ encapsulates the data and its associated processes together and also controls access to data

A

Data Abstraction

50
Q

___ enhances the potential reuse of existing software thereby increasing the software development productivity

A

Inheritance

51
Q

___ allows more flexible use of inheritance by allowing the same pointer to call different methods during run-time based on what type of object it points to.

A

Polymorphism

52
Q

What language was the first to support the three fundamental features of object-oriented programming?

A

Smalltalk

53
Q

What is an example of two language design criteria that are in direct conflict with each other?

A

Cost of execution vs. Reliability
EX: JAVA checks that all the references to arrays have their indices within the bounds; thus, JAVA code is more reliable but takes longer to execute. C, on the other hand, does not check the bounds of arrays; thus it is faster to execute, but less reliable due to programmer mistakes that are not caught during compile time.

54
Q

What are the 3 general methods of implementing a programming language?

A

1) Compiler
2) JIT(Just in time)/Interpreted
3) Combination of both of the above

55
Q

Which produces faster program execution, a compiler or pure interpreter?

A

Compiler because it translates all of the code into machine language.

56
Q

What role does the symbol table play in a compiler?

A

Symbol table acts as the database during the whole compilation process. It stores type and attribute information, names specified in the program by user, finally, the information is used by the semantic analyzer for rectifying errors.

57
Q

What does a linker do?

A

The object files produced by the compiler and the library files are combined by the linker to make a single executable file.

58
Q

Why is the von Neumann bottleneck important?

A

The bottleneck refers to the transfer rate of the bus that transfers instructions/data to the CPU. The CPU is already sitting idle a lot of the time; it’s the throughput of the bus that largely hampers the speed of process, not the processor itself.

59
Q

What are the 4 advantages of interpreted code vs. compiled code?

A

1) Platform independence
2) Easier to debug because of ease to acquire source code info
3) Usually comparatively smaller
4) Automatic memory management