CS 4337 Midterm - Chapters 1-4

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

1/218

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:49 PM on 10/11/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

219 Terms

1
New cards
What three broad categories of language are listed in the course?
Natural human languages, constructed human languages, and programming languages.
2
New cards
How do syntax and semantics differ?
Syntax = structure; semantics = meaning. Together they define a language.
3
New cards
What is a lexicon, and how does it differ from an alphabet?
Lexicon = vocabulary. Alphabet = symbols used to form strings.
4
New cards
What is the intended difference between ambiguity in natural and programming languages?
Natural language often permits ambiguity; programming languages aim for precise, unambiguous interpretations.
5
New cards
Who is Noam Chomsky in the course's language history?
A linguist associated with formal grammars, including context-free grammars.
6
New cards
What are John Backus's major contributions discussed in class?
Led FORTRAN development and introduced the notation that became BNF.
7
New cards
Why study programming-language concepts?
Express ideas, choose and learn languages, understand implementation, use familiar languages better, and advance computing.
8
New cards
Why are there many programming languages instead of one universal best language?
Different domains require different trade-offs in readability, writability, reliability, efficiency, and cost.
9
New cards
What characterizes scientific applications, and which language is the classic example?
Floating-point calculations and arrays; FORTRAN (Formula Translating).
10
New cards
What characterizes business applications, and which language is the classic example?
Reports, decimal data, characters, and records; COBOL (Common Business Oriented Language).
11
New cards
What characterizes the traditional AI domain in the slides?
Symbolic processing and linked lists; Lisp and Prolog.
12
New cards
What characterizes systems programming, and which language is emphasized?
Efficient execution and low-level control; C.
13
New cards

What kinds of languages appear in web software?

Markup (HTML), scripting (PHP/JavaScript), and general purpose languages (Java).

14
New cards
What is an embedded system?
Software built into a device for a dedicated purpose, such as an appliance controller.
15
New cards
How does gaming differ from offline 3-D graphics and animation?
Gaming renders and responds to input in real time; offline animation lacks that immediate interaction requirement. Gaming examples: C++, C#.
16
New cards
What four main criteria evaluate a programming language?
Readability, writability, reliability, and total cost.
17
New cards
What is readability, and why does it matter?
Ease of understanding programs; it affects maintenance and error detection.
18
New cards
What is writability?
Ease of writing programs for a particular problem domain.
19
New cards
What is reliability?
Conformance to specifications under intended operating conditions.
20
New cards
What costs belong in a language's total cost?
Training, development, compilation, execution, tools, failures, and maintenance; portability and generality also affect cost.
21
New cards

How can simplicity improve readability, and when can it hurt?

Fewer features ease learning, but overly primitive constructs can make it hard to read

22
New cards

What is feature multiplicity?

Multiple ways to perform one operation

23
New cards
What is operator overloading?
One operator symbol has multiple meanings or operand types. Surprising uses can reduce readability.
24
New cards
What is orthogonality in language design?
A small set of constructs combines consistently, with few special cases.
25
New cards
Why do suitable data types and clear syntax improve readability?
They express intent directly: timeout = true is clearer than timeout = 1.
26
New cards
What is abstraction?
Using complex operations or structures while hiding unnecessary details.
27
New cards
How do process abstraction and data abstraction differ?
Process abstraction hides an operation behind a subprogram; data abstraction hides a representation behind an interface.
28
New cards
What is type checking?
Detecting type errors at compile time or run time.
29
New cards
According to the sample quiz, what makes a language strongly typed?
All type errors are detected at compile time or run time. Strong typing differs from static typing.
30
New cards
When are types determined or checked in dynamic versus static typing?
Dynamic typing: during execution. Static typing: before execution, usually during compilation.
31
New cards
What is exception handling, and how does it support reliability?
Detecting and handling run-time errors to enable recovery or controlled termination.
32
New cards
What is aliasing?
Multiple names or reference paths refer to the same storage location.
33
New cards
Do equal values imply aliasing?
No. Aliasing requires shared storage, not just equal values.
34
New cards
What two major influences shape language design?
Computer architecture and programming methodology.
35
New cards
How does the von Neumann architecture influence imperative languages?
Variables model memory cells, assignments update stored values, and iteration fits repeated instruction execution.
36
New cards
What is the von Neumann bottleneck?
Limited transfer speed between memory and CPU constrains execution.
37
New cards
What distinguishes imperative and procedural programming?
Imperative programming updates state through commands; procedural programming organizes those commands into subroutines.
38
New cards
What distinguishes functional programming?
Computation applies functions. Pure functional programming avoids mutable state and uses recursion and conditional expressions.
39
New cards
What does it mean that functions are first-class entities?
Functions can be stored, passed as arguments, and returned as values.
40
New cards
What distinguishes logic programming?
Facts and rules are used to infer answers to queries; Prolog is the main example.
41
New cards

How do declarative and imperative programming differ?

Declarative: specify desired results. Imperative: specify state changing steps. Functional and logic programming are declarative.

42
New cards
What features characterize object-oriented programming in the slides?
Data abstraction, inheritance, and polymorphism.
43
New cards
What is a markup/programming hybrid?
Markup extended with programming constructs, such as selection and iteration; examples include XSLT and JSP/JSTL.
44
New cards
Give the three language-design trade-offs emphasized in class.
Reliability vs. execution cost; readability vs. writability; flexibility vs. reliability.
45
New cards
What does a compiler do?
Translates source into another representation, typically machine code in the basic compilation model.
46
New cards

What does a pure interpreter do?

Executes source operations at run time without first producing a separate native executable.

47
New cards
What is a hybrid implementation?
Translates source to intermediate code, then executes it with an interpreter and/or JIT compiler.
48
New cards
What is just-in-time (JIT) compilation?
Compiles intermediate code into machine code during execution, often when a method is needed.
49
New cards
Why can Java bytecode support portability?
The same bytecode can run on any system with a compatible JVM and run-time support.
50
New cards
What language does a CPU execute directly?
Its architecture's machine language.
51
New cards
Why do programmers generally prefer high-level languages to machine code or assembly?
Easier development, understanding, modification, and often portability; faster execution is not guaranteed.
52
New cards
What are the main compilation phases and their jobs?
Lexical: characters to tokens. Syntax: tokens to parse structure. Semantic: check constraints. Code generation: produce executable code.
53
New cards
What is linking?
Combining compiled program units and required libraries into an executable.
54
New cards
What is a preprocessor?
Transforms source before compilation, such as expanding C #include and #define.
55
New cards
Why was early machine-code programming difficult?
It was tedious, error-prone, hard to read/modify, and lacked convenient tools and expressions.
56
New cards
What were Short Code and Speedcoding intended to improve?
Higher-level pseudocode eased programming; Speedcoding added arithmetic, branching, and array support at a speed/memory cost.
57
New cards
Why was efficient compilation central to FORTRAN's success?
Scientific users prioritized machine efficiency; fast compiled code made a high-level language practical.
58
New cards
What early FORTRAN features are emphasized in the slides?
Counted loops, arrays, subprograms, formatted I/O, and three-way arithmetic IF.
59
New cards
How did implicit typing work in early FORTRAN?
Initial I, J, K, L, M, or N implied integer; other initials implied floating-point.
60
New cards
How did FORTRAN develop beyond its earliest implementation?
Separate compilation, explicit types, improved control/strings, modules, dynamic arrays, pointers, recursion, OOP, and parallelism.
61
New cards
What does Lisp stand for, who designed it, and what problem domain motivated it?
LISt Processing; John McCarthy; AI and symbolic computation.
62
New cards
What are Lisp's two fundamental data categories in the slides?
Atoms and lists, including nested lists.
63
New cards
What computational ideas did Lisp pioneer?
Functional programming, recursion, conditional expressions, and garbage collection.
64
New cards
How do Scheme and Common Lisp differ in the slides?
Scheme: small, statically scoped, first-class functions. Common Lisp: larger and combines many dialect features.
65
New cards
What is distinctive about Scala in the course?
Functional support, a strong type system rooted at Any, and JVM execution.
66
New cards
What problem was ALGOL designed to address?
A machine-independent language and common notation for publishing algorithms.
67
New cards
What major ALGOL contributions are emphasized?
Local block scope, recursion, stack-dynamic arrays, machine independence, and syntax formally defined with BNF.
68
New cards

Why was ALGOL influential despite limited adoption?

It standardized algorithm publication and influenced imperative languages. Adoption suffered from implementation issues and established competitors.

69
New cards
What is a block's role in ALGOL-style languages?
Groups declarations and statements and can establish local scope.
70
New cards

What design philosophy characterized the later orthogonal ALGOL design?

A few basic concepts with consistent combinations; contributions included user defined structures, references, and dynamic arrays.

71
New cards
What design goals and features distinguish COBOL?
English-like business programming with long names, hierarchical records, and a separate data division.
72
New cards
Which earlier language influenced COBOL?
FLOW-MATIC, an English-like data-processing language separating data from code.
73
New cards

What language was designed for beginners and became closely associated with timesharing?

BASIC, by John Kemeny and Thomas Kurtz, designed for easy learning and quick turnaround.

74
New cards
What does BASIC stand for?
Beginner's All-purpose Symbolic Instruction Code.
75
New cards
What was PL/I intended to combine?
Scientific and business computing in one language.
76
New cards
What contributions and drawback are associated with PL/I?
Concurrency, exceptions, pointers, and array cross sections; its size and some feature designs made it complex.
77
New cards
What did APL and SNOBOL have in common?
Dynamic typing and storage allocation: assigned values determine types, and storage can be allocated at assignment.
78
New cards
What distinguishes APL from SNOBOL?
APL: powerful scalar/array operations. SNOBOL: string manipulation and pattern matching.
79
New cards
What did SIMULA contribute to programming languages?
Classes, objects, inheritance, and coroutines, originally for system simulation.
80
New cards
What was Pascal primarily designed for?
Teaching structured programming; designed by Niklaus Wirth.
81
New cards
What are C's origin, purpose, and key trade-off in the slides?
Dennis Ritchie at Bell Labs; systems programming. Powerful low-level control, but comparatively weak type checking.
82
New cards
What distinguishes Prolog from a conventional procedural language?
It uses logic and inference over facts/rules instead of explicitly listing procedural steps.
83
New cards

What application area motivated Ada, and what major facilities did it provide?

Embedded and real time systems; packages, exceptions, generics, and concurrency through tasking.

84
New cards
Who is Ada Lovelace in the course's history?
Wrote an algorithm for Babbage's Analytical Engine; recognized as the first programmer and Ada's namesake.
85
New cards
Why is Smalltalk important in object-oriented language history?
An early full OOP language with abstraction, inheritance, and dynamic binding; also influential in GUI development.
86
New cards

How did C++ combine earlier language ideas?

Stroustrup combined C style procedural programming with SIMULA influenced OOP, increasing language complexity.

87
New cards
How do Objective-C and Delphi relate to earlier languages?
Objective-C: C plus Smalltalk-inspired OOP. Delphi: Pascal plus OOP.
88
New cards

What safety and portability choices distinguish Java from C++ in the slides?

Managed references, garbage collection, JVM bytecode, no explicit pointer arithmetic or manual memory deallocation.

89
New cards
What tasks made Perl prominent in the course's web history?
Text processing, CGI programming, and UNIX administration; variable prefixes distinguish scalar, array, and hash namespaces.
90
New cards
What is JavaScript's traditional web role, and how is it related to Java?
Client-side scripting for dynamic web pages. It is a separate language, not a Java dialect.
91
New cards
What is PHP's traditional web role?
Server-side web scripting for forms and database access; PHP means PHP: Hypertext Preprocessor.
92
New cards
What features characterize Python in the slides?
Object-oriented scripting, dynamic typing with type checking, and lists, tuples, and dictionaries.
93
New cards
What features characterize Ruby in the slides?
Matsumoto's object-oriented scripting language: all data are objects, and many operators are redefinable methods.
94
New cards

Which language is presented as the flagship .NET language?

C#, influenced by C++, Java, and Delphi, with delegates, properties, enums, and anonymous types.

95
New cards
What are XML and XSLT?
XML defines structured markup; XSLT transforms XML and includes programming constructs.
96
New cards
What are JSP and JSTL?
JSP supports dynamic web documents; JSTL supplies reusable tags for tasks such as loops and conditionals.
97
New cards

What is a language in formal-language terminology?

A set of sentences formed over an alphabet.

98
New cards
What is a lexeme?
An actual lowest-level syntactic unit, such as sum, 17, +, or if.
99
New cards
What is a token?
A category of lexemes, such as identifier or integer literal.
100
New cards
When does a lexeme match a token?
When its characters match the token category's pattern.