Lecture 1 COPY Flashcards

1
Q

Why are different programming languages written?

A

To solve different problems. Different tools for different reasons.

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

What are some general purpose languages?

A

C++, C

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

What are the characteristics of abstraction?

A
  1. Encapsulation

2. Information Hiding

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

What are the types of abstraction?

A
  1. Data

2. Procedural

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

What does an optimizer do?

A

Places statements pertaining to the same data close to one another in memory.

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

What are the three language constructs?

A

Repetition, sequence, condition

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

What percentage of a company’s budget is spent on maintenance vs. on development?

A

80 % on maintenance.

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

What’s another term for reliability?

A

Data integrity

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

What is a unit of work?

A

Do the entire unit of work or do nothing. Ex: ATM. Attempts transaction and backs everything out if there is an issue.

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

What is aliasing?

A

Referring to memory addresses using different types and different symbolic names

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

What is perfective maintenance?

A

Enhancements

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

What is protective maintenance?

A

Security

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

What is adaptive maintenance?

A

Changing technology without changing functionality

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

What is corrective maintenance?

A

Fixing bugs

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

Why is compiling programs a cost?

A

Separation of duties. You have individual employees dealing with the build process.

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

What are the language evaluation criteria?

A

Readability, Writability, Reliability, and Cost

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

What is reliability?

A

Conformance to specifications

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

What does overall simplicity mean?

A

A manageable set of features and constructs, minimal feature multiplicity, minimal operator overloading

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

What is orthogonality?

A

A relatively small set of primitive constructs can be combined in a relatively small number of ways. Optimally, every possible combination is legal.

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

What is abstraction?

A

The ability to define and use complex structures or operations in ways that allow details to be ignored.

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

What is expressivity?

A

The breadth of ideas that can be represented and communicated in the language.

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

What is portability?

A

The ease with which programs can be moved from one implementation to another.

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

What is generality?

A

The applicability to a wide range of applications.

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

What computer architecture are programming languages developed around?

A

The Von Neumann architecture

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

When did the Von Neumann architecture come into ues?

A

1940-1950

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

What are the characteristics of the Von Neumann architecture?

A
  1. Data and programs stored in memory
  2. Memory is separate from CPU
  3. Instructions and data are piped from memory to CPU
  4. Imperative languages match Von Neumann architecture best.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Why do imperative languages match Von Neumann architecture best?

A
  1. Variables model memory cells
  2. Assignment statements model piping
  3. Iteration is efficient
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is the fetch-execute-cycle on Von Neumann architecture computer?

A
  1. Initialize program counter
  2. Repeat forever:
  3. Fetch instruction pointed to by counter
  4. Increment counter
  5. Decode instruction
  6. Execute instruction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What was the programming paradigm in the 1950s/60s?

A

Simple applications, worry about machine efficiency.

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

What was the program paradigm in the late 60s?

A

People efficiency became important; requiring better readability and control structures.

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

What was the program paradigm in the late 70s?

A

Went from process oriented to data oriented

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

What was the programming paradigm in the mid-1980s?

A

Object oriented programming: Data abstraction + inheritance + polymorphism

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

What are the categories of languages?

A
  1. Imperative
  2. Functional
  3. Logic
  4. Markup/Programming Hybrid
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What are imperative languages?

A
  • Variables
  • Assignment statements
  • Iteration
  • Object Oriented Programming
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What are functional languages?

A

Primary means of making computations is by applying functions to given parameters

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

What is object oriented programming?

A

Simplification of data and procedural abstraction and building it into languages.

37
Q

What is range checking?

A

A compiler feature that will prevent you from referencing an element that is out of range of the defined size of an array.

38
Q

What are the language design tradeoffs?

A
  1. Reliability vs. cost of execution
  2. Readability vs. writability
  3. Writability (flexibility) vs. reliability
39
Q

What are the methods of implementation of programming languages?

A
  1. Compilation
  2. Pure interpretation
  3. Hybrid Implementation Systems
40
Q

What are hybrid implementation systems?

A

A compromise between compilers and pure interpreters.

41
Q

What is pure interpretation?

A

Where every line is translated one at a time. It uses more memory and is slower than compilation.

42
Q

What is an example of a hybrid implementation system?

A

Java Bytecode

43
Q

What are the phases of compilation?

A
  1. Lexical Analysis
  2. Syntax Analysis
  3. Semantics Analysis
  4. Code Generation
44
Q

What is lexical analysis?

A

A process that converts characters in the source program into lexical units. This is where the symbol table gets created.

45
Q

What is syntax analysis?

A

Transforms lexical units into parse trees, which represent syntax.

46
Q

What is semantics analysis?

A

Attempts to understand the intention of the programmer, generates intermediate code.

47
Q

How many passes are most compilers?

A

2:

  1. Symbol Table (Syntax)
  2. (Syntax), Intermediate Code, uses symbol table for code generation
48
Q

During which phase in the compilation process can optimization be applied?

A

Semantic Analysis

49
Q

What is a load module?

A

An executable image, the user and system code together

50
Q

What is linking and loading?

A

The process of collecting system program units and linking them to a user program.

51
Q

What is an unresolved reference?

A

When the compiler marks in the symbol table when it is unable to find something

52
Q

What is a linkage editor?

A

Looks in libraries to find reference and updates symbol table with module if found. Otherwise, error out and fail compilation.

53
Q

What is the Von Neumann bottleneck?

A

The connection speed between a computer’s memory and its processor determines the speed of a computer. Since instructions can be executed faster than the speed of the connection, a bottleneck is created.

54
Q

What is a way to get around the Von Neumann bottleneck?

A

Use multiple processors

55
Q

What are the characteristics of Pure Interpretation?

A
  1. No translation (no .exe output)
  2. Easier implementation of programs
  3. Slower execution
  4. Usually requires more space
56
Q

What are the characteristics of hybrid implementation systems?

A
  1. Mix of interpreted/compiled
  2. High level program translated to intermediate language that allows easy interpretation
  3. Faster than pure interpretation
57
Q

What are some examples of Hybrid Implementation Systems?

A

Initial implementations of Java, Perl.

58
Q

What is the Hybrid Implementation Process?

A
  1. Source Program
  2. Lexical Analyzer
  3. Syntax Analyzer
  4. Intermediate code generator
  5. Interpreter
59
Q

What is the Pure Interpretation Process?

A
  1. Source Program
  2. Interpreter
  3. Results
60
Q

Where does the descriptor reside?

A

The symbol table

61
Q

What is a data type?

A

A collection of data objects and a set of predefined operations on those objects

62
Q

What is a descriptor?

A

A collection of the attributes of a variable

63
Q

What is an object?

A

An instance of a user-defined (abstract) data type

64
Q

What are primitive data types?

A

Data types not defined in terms of another set of types

65
Q

T/F - Integer is almost always an exact reflection of the hardware so mapping is trivial

A

True

66
Q

What is the IEEE standard for floating point types?

A

754

67
Q

What happens to the sign of the exponent in floating point data types?

A

It is eliminated to save space

68
Q

What are complex data types?

A

Representation of complex numbers where two floats represent the real and imaginary parts

69
Q

What is packing?

A

In terms of CS, storing information using less memory than designated.

70
Q

What are the attributes of the decimal data type?

A
  • Store a fixed number of decimal digits in BCD
  • Adv: Allow a high degree of accuracy
  • Disadv: Has limited range and wastes memory
71
Q

How are boolean types usually implemented?

A

As bytes

72
Q

What are the attributes of the character data type?

A
  • Stored as numeric coding

- Common codings include ASCII, UCS2 and UCS4. Less common EBCDIC.

73
Q

How are strings stored?

A

As sequences of characters

74
Q

What are the design issues to consider about strings?

A

Static vs dynamic, primitive type or special array

75
Q

How are static strings implemented for processing by a language?

A

As a compile time descriptor

76
Q

How are limited dynamic length strings implemented for processing by a language?

A

May need a runtime descriptor in certain cases, C and C++ don’t

77
Q

How are dynamic length strings implemented for processing by a language?

A

Need a runtime descriptor, alloc/dealloc is biggest issue

78
Q

What are the components of a static string descriptor?

A

String, Length, Address

79
Q

What are the components of a runtime descriptor for limited dynamic strings?

A

String, Maximum Length, Current Length, Address

80
Q

What is an ordinal type?

A

A type in which the range of possible values can be easily associated with the set of positive integers. Are always discrete.

81
Q

What is the maximum number of subscripts in C++?

A

255

82
Q

What are the reasons arrays moved from static to heap?

A

1 Dynamic arrays became more useful and viable
2 More heap memory available in total
3 Better hardware, so heap access is faster
4 Able to reference by address

83
Q

What are the advantages and disadvantages of range checking?

A

Adv - Reliability. Prevents you from going out of bounds.

Disadv - Performance hit (lots of if statement / branching)

84
Q

When are subscript ranges bound?

A

Compile time, generally

85
Q

When does allocation take place?

A

It depends. Declaration is not executable unless initialization is associated with it.

86
Q

What are two ways you can make rectangular multidimensional arrays jagged?

A

1- Array of arrays

2- Allocate as rectangular, keep track of used cells

87
Q

What is array slicing?

A

Extracting a subset of elements from an array and repackaging them as another array.

88
Q

What is array indexing?

A

Mapping from indices to elements

89
Q

When should allocation be performed?

A

Only when you have to. (lazy allocation)