Org of Programming Lang Midterm Study Guide

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/62

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:02 AM on 10/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

63 Terms

1
New cards

What are the different programming domains? (Ch. 1)

Scientific, Business, AI, Systems Programming, Web Software

2
New cards

Examples of Scientific Programming Domains

FORTRAN, ALGOL 60; used primarily for data sets and computations

3
New cards

Examples of Business programming domains

COBOL; used to help make business reports

4
New cards

Examples of AI programming domain

LISP, Prolog, Modern day: Python; uses more linked lists than numbers

5
New cards

Systems programming examples

C, C++, Assembly; needs efficiency, types of languages used for low-level things like compilers

6
New cards

Web software programming domain examples

HTML, JavaScript, PHP; deals with front-end + back-end on the web. HTTP protocols.

7
New cards

What are the criteria to evaluate a programming language?

Readability, writability, reliability, cost (extra: security)

8
New cards

What are two conflicting criteria when evaluating programming languages?

Execution efficiency & portability. It’s hard for programming languages to be very efficient and also work in all kinds of domains.

9
New cards

What are some influences on language design?

Computer/ Von Neumann architecture (CPU,RAM), program design methodologies (ex: object-oriented software development, different types of languages used for different things)

10
New cards

What is an orthogonal language?

A language that does not have many exceptions to it. Rules are straightforward.

For instance, a language that can have an array of essentially any datatype is orthogonal. A language that for some reason cannot have an array of strings but can have an array of any other data type is non-orthogonal.

11
New cards

A programming language that allows an if statement with and without curly brackets is an example of what?

A non-orthogonal language

12
New cards

Java does not have pointers/references like C and C++ does. So the programmer cannot work with memory like it can with the other two languages. However, they won’t have to face any potential memory issues. This is an example of what?

Language design trade-offs

13
New cards

What are the 3 implementation methods with programming languages?

Compilation, Pure Interpretation, Hybrid Implementation Systems. (Think CPH)

14
New cards

How is are languages that are compiled executed?

The compiler translates the high-level code to a low-level program before execution. The new lower-level file is executed quite efficiently.

15
New cards

How are languages that are interpreted exeucted? (pure interpretation)

The interpreter translates the code line-by-line during execution. Execution is slower than compilation.

16
New cards

How are hybrid implementation systems executed?

Source code is translated to bytecode. A Virtual Machine (VM) interprets the code with the help of a Just-in-time (JIT) compiler. The reason this approach exists is because the code becomes executable on a lot more things (Windows, Mac) and the speed is not too slow.

17
New cards

What are 3 things every programming language needs to have to be considered a programming language?

Sequence, selection, iteration.

(Ordering things, like steps; if statements, switch statements; for, while loops, recursion.)

18
New cards

What is it called when a language does not have the 3 requirements to be considered a programming language?

A computer language

(ex: HTML, CSS, JSON)

19
New cards

What primary functionality did Fortran need to have when it came out?

Fortran had to be efficient to compete with assembly language. It’s application was for engineering/scientific purposes.

20
New cards

Why did object-orientation evolve?

To deal with complexity and more abstract concepts.

21
New cards

Evaluate Fortran.

High optimizing compilers, paved the way for most programming languages

22
New cards

Evaluate LISP

Pioneered functional programming

(No variables, only functions and new data (old data cannot be modified), recursion and conditional expressions), still the dominant language for AI)

23
New cards

Evaluate ALGOL 60

Good for publishing algorithms, not widely used in the USA— people saw it as too flexible, so understanding it was more difficult.


24
New cards

Evaluate COBOL

Used by Department of Defense, first macro facility in a high lvl language.

25
New cards

Syntax

the form/structure of the expressions, statements, program units


26
New cards

Semantics

the MEANING of the expressions, statements, program units

27
New cards

BNF (Backus-Naur Form)

a standardized formal notation system (meta syntax) used to precisely define the syntax & grammar rules of programming languages

28
New cards

Non-terminals (BNF)

Anything inside angle brackets, something that needed to be further defined

  • ex: <expression>, <variable>, <number>


29
New cards

Terminals (BNF)

Anything in quotes. Actual characters/tokens that can appear in the program

ex: “+”, “=“

30
New cards

What does the vertical bar in BNF mean? ( | )

OR

31
New cards

What does the → arrow mean in BNF?

“can be replaced by”, “can be expanded into”

32
New cards

Why is there only one non-terminal on the left side of BNF expressions?

Because programming languages are context-free, not context-sensitive

33
New cards

Four things needed for BNF

1) Terminals

2) Non Terminals

3) Production rewriting rules

4) Start symbol

34
New cards

True or False: When using programming languages, we use context free languages

True

35
New cards

3 primary methods of semantics description

Operational, denotational, axiomatic

36
New cards

Operational Semantics

HOW a program executes step-by-step


37
New cards

Denotational Semantics

WHAT mathematical value/effect a program computes

38
New cards

Axiomatic Semantics

PROPERTIES and correctness of a program

39
New cards

Lexing

The first phase of a compiler/interpreter where it takes character by character source code and breaking it down to a stream of categorized units called tokens

40
New cards

Parsing

Process of converting a stream of raw input data (usually text) into a highly structured format that a computer can easily understand and execute

41
New cards

Variables have 6 attributes to them. What are they?

Name, Address, Value, Type, Lifetime, Scope

42
New cards

What is the address of a variable?

The location in memory, (could be the CPU, RAM, etc.)

43
New cards

What are some things that can affect the name of a variable in a programming language?

Case sensitivity, types of symbols allowed (e.g. letters, numbers, symbols, etc.)

44
New cards

An int 5 is added to a float 2.0. This evaluates to a float 7.0. What kind of type-casting is this?

Implicit Type Casting

45
New cards

(int)5.7 changes the float to an int: 5. What kind of type-casting is this?

Explicit

46
New cards

Which type casting is at a higher risk of data loss?

Explicit type casting

47
New cards

What is the lifetime of a variable?

How long a variable is bound to a memory location.

ex: int x; is declared inside a function. That means x’s lifetime is only when that function is called.

48
New cards

Static scope/lexical scope

Local, non-local, and global variables

49
New cards

What are some possible binding times? (when variables are assigned to a memory cell?)

Compile time, load time, runtime

50
New cards

When is a binding static?

If it first occurs before runtime and remains unchanged throughout program execution

51
New cards

When is binding dynamic?

When the memory location of the variable changes during execution of the program or it first occurs during execution

52
New cards

What is static lifetime for variables?

When a variable is bound to a memory cell before execution and remains bound throughout → global variables

53
New cards

What is stack-dynamic lifetime variables?

When the variable is bound to the stack at runtime

54
New cards

What is explicit heap-dynamic in variable lifetimes?

Explicitly adding something to add to the heap.

ex: new int x;

delete int x;

55
New cards

What are implicit heap-dynamics?

Allocation and deallocation caused by assignment statements

ex: x = 5;

56
New cards

What’s the benefit + disadvantage of implicit heap-dynamic?

It’s flexible; inefficient

57
New cards

Static typing vs dynamic typing

Checking the data type at compile time; Checking data types at runtime

58
New cards

Scalar variables include…

static, stack dynamic, explicit heap dynamic, implicit heap dynamic

59
New cards

Example of Primitive Data Types

int, byte, a pointer, long, short

60
New cards
61
New cards
62
New cards
63
New cards