1. Home
  2. Explore
  3. Computer Science
  4. Language Design Principles

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Language Design Principles

  • 66Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Language Choice

Why was AWK a more suitable language than C for identifying volcanic eruptions in a large data set?

66 questions

  1. 1

    Why was AWK a more suitable language than C for identifying volcanic eruptions in a large data set?

    1. A

      AWK provided concise, robust notation for text-oriented data selection

    2. B

      AWK always produced faster machine code than a compiled C program

    3. C

      AWK required programmers to specify every input operation explicitly

    4. D

      AWK was designed primarily for numerical simulation and graphics

    Correct answer
    A

    AWK provided concise, robust notation for text-oriented data selection

    Explanation

    The task involved scanning and selecting records from text-like data. AWK made this concise and robust, whereas the C version took much longer to write and was less tolerant of problematic input.

  2. 2

    For a program that will run only once and finish in a tiny fraction of a second, which kind of efficiency is usually most important?

    1. A

      Machine efficiency rather than programmer efficiency

    2. B

      Memory efficiency rather than notation or development efficiency

    3. C

      Compiler efficiency rather than input-processing efficiency

    4. D

      Programmer efficiency rather than machine efficiency

    Correct answer
    D

    Programmer efficiency rather than machine efficiency

    Explanation

    When execution already takes a negligible amount of time, reducing the programmer's time to write the program matters more than optimizing its runtime.

  3. 3

    Why would a search engine such as Google's generally not be implemented in AWK?

    1. A

      Search engines require programs written only in assembly language

    2. B

      Large, repeatedly executed systems require machine efficiency

    3. C

      AWK programs cannot contain variables or control structures

    4. D

      AWK cannot process any form of textual information

    Correct answer
    B

    Large, repeatedly executed systems require machine efficiency

    Explanation

    AWK is excellent for concise text processing, but large systems that run continuously and process enormous workloads require the machine efficiency associated with languages such as C or C++.

  4. 4

    What central design issue is illustrated by the contrast between the C and AWK solutions?

    1. A

      A language should minimize the number of available data types

    2. B

      Every useful language must support object orientation

    3. C

      The notation should match the task being performed

    4. D

      Compiled languages are always less robust than interpreted languages

    Correct answer
    C

    The notation should match the task being performed

    Explanation

    The talk emphasizes that suitable notation can make a task dramatically easier. AWK's notation matched data selection and text processing much better than C's.

  5. 5

    What was a major advantage of high-level languages over assembly language?

    1. A

      They required programmers to understand more machine-specific details

    2. B

      They raised programming above the details of a particular machine architecture

    3. C

      They restricted programs to one specific hardware platform

    4. D

      They eliminated the need to translate programs before execution

    Correct answer
    B

    They raised programming above the details of a particular machine architecture

    Explanation

    High-level languages allowed programmers to express solutions in terms closer to human problem solving rather than machine-specific instructions.

  6. 6

    What portability benefit did high-level languages provide?

    1. A

      A program could be translated for different machines after being written once

    2. B

      A program automatically used the same machine instructions everywhere

    3. C

      A program became independent of compilers and operating systems

    4. D

      A program could execute on every machine without any translation

    Correct answer
    A

    A program could be translated for different machines after being written once

    Explanation

    A high-level program could be written once and translated into the instructions required by different target machines.

  7. 7

    Which language was described as especially important for implementing core computing software such as compilers and operating systems?

    1. A

      C

    2. B

      BASIC

    3. C

      EQN

    4. D

      SNOBOL

    Correct answer
    A

    C

    Explanation

    C became important in the 1970s because it could implement compilers, loaders, assemblers, editors, and operating-system components while remaining a high-level language.

  8. 8

    Why did object-oriented features become increasingly valuable as computers and programs grew larger?

    1. A

      They made all programs independent of their application domains

    2. B

      They helped programmers maintain structural control over larger codebases

    3. C

      They removed the need for programmers to organize program structure

    4. D

      They guaranteed that every program would execute with maximum speed

    Correct answer
    B

    They helped programmers maintain structural control over larger codebases

    Explanation

    As programs became larger, languages added features such as object orientation to help programmers maintain intellectual and structural control.

  9. 9

    What tradeoff was associated with interpreted languages such as Java in the talk?

    1. A

      They eliminated portability by depending on one processor architecture

    2. B

      They required more manual memory and instruction management than C

    3. C

      They could sacrifice speed in exchange for easier programming and portability

    4. D

      They improved speed by requiring more machine-specific programming

    Correct answer
    C

    They could sacrifice speed in exchange for easier programming and portability

    Explanation

    Interpretation can reduce execution speed, but it can make programming easier and portability much simpler, especially when hardware is powerful enough to absorb the cost.

  10. 10

    Which historical progression best represents the development described in the talk?

    1. A

      High-level languages, machine code, scripting languages, and assembly languages

    2. B

      Machine code, assembly languages, high-level languages, and structure-oriented languages

    3. C

      Scripting languages, machine code, functional languages, and assembly languages

    4. D

      Object-oriented languages, machine code, assembly languages, and high-level languages

    Correct answer
    B

    Machine code, assembly languages, high-level languages, and structure-oriented languages

    Explanation

    The talk presents a broad progression from absolute machine code to assembly, then high-level languages, followed by languages adding features for larger programs and specialized uses.

  11. 11

    Which characteristic most fundamentally distinguishes scripting languages from traditional mainstream languages in the talk?

    1. A

      Types are specified more rigidly than in strongly typed languages

    2. B

      Programs are always compiled directly into machine code

    3. C

      Text is treated as a fundamental data type

    4. D

      Programs cannot manipulate numbers or perform arithmetic

    Correct answer
    C

    Text is treated as a fundamental data type

    Explanation

    Scripting languages naturally manipulate text as well as numbers. In languages such as C, text processing is less central and more cumbersome.

  12. 12

    How are regular expressions typically related to scripting languages?

    1. A

      They are an integral part, either built in or provided through libraries

    2. B

      They are excluded because scripting languages process only numerical data

    3. C

      They are used only by compilers and never by application programs

    4. D

      They replace associative arrays as the universal data structure

    Correct answer
    A

    They are an integral part, either built in or provided through libraries

    Explanation

    Regular expressions are closely integrated into scripting languages. They may be built into the language, as in AWK and Perl, or supplied through libraries, as in Python.

  13. 13

    Which data structure was identified as characteristic and especially useful in scripting languages?

    1. A

      Linked instruction streams

    2. B

      Associative arrays

    3. C

      Fixed-size machine registers

    4. D

      Binary syntax trees only

    Correct answer
    B

    Associative arrays

    Explanation

    Scripting languages commonly provide associative arrays, which are useful for aggregating and organizing data by keys.

  14. 14

    How do scripting languages generally handle types compared with languages such as SML, OCaml, or Haskell?

    1. A

      They require complete compile-time proofs of every type relationship

    2. B

      They prohibit values from changing between textual and numerical use

    3. C

      They require programmers to declare every variable's type explicitly

    4. D

      They tend to handle types flexibly and often provide minimal type theory

    Correct answer
    D

    They tend to handle types flexibly and often provide minimal type theory

    Explanation

    Scripting languages commonly play fast and loose with types, often relying on flexible or minimal type checking rather than elaborate type inference systems or strict declarations.

  15. 15

    Why do scripting languages often use interpreters?

    1. A

      Interpreters always execute faster than optimized machine code

    2. B

      Modern hardware can make the performance cost acceptable

    3. C

      Interpreters eliminate the need for any language syntax

    4. D

      Interpreters are required whenever a language has regular expressions

    Correct answer
    B

    Modern hardware can make the performance cost acceptable

    Explanation

    Interpreters may be slower, but increased hardware power often makes the performance sufficient for scripting tasks while preserving convenience and flexibility.

  16. 16

    What was the primary intended scale of AWK programs?

    1. A

      Large operating systems with millions of lines

    2. B

      Long numerical simulations requiring extensive optimization

    3. C

      Very short programs, often one-liners

    4. D

      Graphical applications with complex user interfaces

    Correct answer
    C

    Very short programs, often one-liners

    Explanation

    AWK was designed for simple one-line programs involving data selection, transformation, and report generation.

  17. 17

    Which combination best describes the main tasks AWK was designed to support?

    1. A

      Data selection, data transformation, and report generation

    2. B

      Interactive graphics, animation, and three-dimensional modeling

    3. C

      Device drivers, memory allocation, and instruction scheduling

    4. D

      Formal theorem proving, type inference, and symbolic execution

    Correct answer
    A

    Data selection, data transformation, and report generation

    Explanation

    AWK was intended for selecting records, transforming data, and generating summaries or reports.

  18. 18

    What is the pattern-action paradigm in AWK?

    1. A

      A pattern specifies the machine instructions used by each action

    2. B

      A pattern describes a program's memory layout before compilation

    3. C

      An action is executed only after every input record has been stored

    4. D

      An action is performed whenever its associated pattern matches input

    Correct answer
    D

    An action is performed whenever its associated pattern matches input

    Explanation

    AWK examines input and performs the action associated with a pattern when that pattern matches the current data.

  19. 19

    How does grep illustrate the pattern-action paradigm?

    1. A

      A regular expression is the pattern, and printing matching lines is the action

    2. B

      A grammar is the pattern, and compilation is the action

    3. C

      Printing is the pattern, and a regular expression is the action

    4. D

      A numerical field is the pattern, and sorting is the action

    Correct answer
    A

    A regular expression is the pattern, and printing matching lines is the action

    Explanation

    In grep, the pattern is usually a regular expression, and the corresponding action is to print input that matches it.

  20. 20

    Which three nested operations summarize AWK's automatic processing structure?

    1. A

      Compile functions, allocate objects, and optimize machine instructions

    2. B

      Read bytes, assemble opcodes, and link executable modules

    3. C

      Create classes, infer types, and invoke garbage collection

    4. D

      Process files, process lines, and test patterns before performing actions

    Correct answer
    D

    Process files, process lines, and test patterns before performing actions

    Explanation

    AWK automatically goes through files, then lines within each file, then patterns for each line, executing actions when patterns match.

  21. 21

    Which task does AWK automate to make short data-processing programs easier to write?

    1. A

      Reading input and splitting lines into fields

    2. B

      Allocating every variable at a fixed memory address

    3. C

      Designing the processor's instruction set

    4. D

      Generating graphical interfaces for each input file

    Correct answer
    A

    Reading input and splitting lines into fields

    Explanation

    AWK automatically reads input and splits records into fields, allowing users to refer directly to fields such as the first or second field.

  22. 22

    How does AWK treat variables in the design described?

    1. A

      Variables can hold only numbers because AWK is intended for arithmetic

    2. B

      A variable may hold a string or number, with operations adapted to its apparent use

    3. C

      Every variable must be permanently declared as either a string or number

    4. D

      Variables can hold only strings because AWK is exclusively a text language

    Correct answer
    B

    A variable may hold a string or number, with operations adapted to its apparent use

    Explanation

    AWK uses flexible variables and attempts to perform consistent operations depending on whether a value appears to be a string or a number.

  23. 23

    What happens in AWK when an action has no associated pattern?

    1. A

      The action is executed only after the entire file is summarized

    2. B

      The action is ignored unless a regular expression is supplied

    3. C

      The action is performed for every input line

    4. D

      The action is performed only for the first input line

    Correct answer
    C

    The action is performed for every input line

    Explanation

    An action without a pattern applies automatically to every input line.

  24. 24

    Why are associative arrays particularly useful for the budget example involving pizza and beer?

    1. A

      They automatically sort all purchases by their monetary value

    2. B

      They allow totals to be accumulated under meaningful keys such as pizza and beer

    3. C

      They prevent different categories from being stored in one structure

    4. D

      They force every record to use the same numerical index

    Correct answer
    B

    They allow totals to be accumulated under meaningful keys such as pizza and beer

    Explanation

    Associative arrays store values by keys, so the program can accumulate separate totals under labels such as pizza and beer.

  25. 25

    Why can machine-generated input expose program defects more effectively than ordinary human input?

    1. A

      It can be extremely large and can contain unusual cases humans rarely produce

    2. B

      It uses only the input patterns anticipated by the programmer

    3. C

      It is always shorter and simpler than input written by people

    4. D

      It automatically corrects malformed data before a program receives it

    Correct answer
    A

    It can be extremely large and can contain unusual cases humans rarely produce

    Explanation

    Machines can generate large volumes of data and combinations that humans would not naturally produce, stressing programs and revealing failures.

  26. 26

    What tension commonly arises when maintaining a programming language?

    1. A

      Designers must choose between adding variables and removing all control structures

    2. B

      Designers must choose between text processing and numerical processing exclusively

    3. C

      Designers must balance compilation by hand with execution by hand

    4. D

      Designers must balance correcting or extending the language with preserving stability

    Correct answer
    D

    Designers must balance correcting or extending the language with preserving stability

    Explanation

    Language designers face pressure to fix mistakes and add features, while users need stability so existing programs continue to work and remain learnable.

  27. 27

    What is a domain-specific language?

    1. A

      A language that must reproduce the full capabilities of an operating system

    2. B

      A language designed to solve every programming problem equally well

    3. C

      A language whose syntax is defined only by a particular hardware platform

    4. D

      A language focused on a relatively narrow and specific application domain

    Correct answer
    D

    A language focused on a relatively narrow and specific application domain

    Explanation

    A domain-specific language targets a particular area, such as database retrieval, statistics, optimization, drawing, or document preparation.

  28. 28

    Must a domain-specific language be Turing complete?

    1. A

      No, but only if it uses machine code instead of formal semantics

    2. B

      Yes, because domain-specific languages are larger than general-purpose languages

    3. C

      No, it may deliberately lack the ability to simulate arbitrary computation

    4. D

      Yes, because every language must support all possible algorithms

    Correct answer
    C

    No, it may deliberately lack the ability to simulate arbitrary computation

    Explanation

    The talk explicitly notes that domain-specific languages need not be Turing complete because they focus on restricted tasks.

  29. 29

    What formal properties can qualify a specialized notation as a language?

    1. A

      A graphical interface and support for object-oriented inheritance

    2. B

      A formal grammar and well-defined semantics, at least in principle

    3. C

      A requirement that it execute every computable mathematical function

    4. D

      A compiler written in assembly language and a numerical type system

    Correct answer
    B

    A formal grammar and well-defined semantics, at least in principle

    Explanation

    Specialized languages have formal, rigorous grammars and defined meanings, even when their domain is narrow and their computational power is limited.

  30. 30

    Which example correctly matches a domain-specific language with its domain?

    1. A

      SQL with operating-system device drivers

    2. B

      Regular expressions with airline crew scheduling

    3. C

      R with lexical analysis

    4. D

      AMPL with mathematical optimization

    Correct answer
    D

    AMPL with mathematical optimization

    Explanation

    AMPL is designed for optimization modeling. SQL focuses on databases, R on statistics, and regular expressions on pattern matching.

  31. 31

    Why can creating a small domain-specific language be more realistic than creating the next C++?

    1. A

      Its limited scope eliminates the need for grammar or semantic definitions

    2. B

      Its limited scope guarantees that no users will ever request changes

    3. C

      Its limited scope ensures that it will automatically become widely used

    4. D

      Its limited scope makes the design and implementation more manageable

    Correct answer
    D

    Its limited scope makes the design and implementation more manageable

    Explanation

    A small language aimed at one task is simpler to design and implement than a large general-purpose language with broad and complex requirements.

  32. 32

    What is the fundamental mathematical goal of a linear programming problem?

    1. A

      To find a grammatical structure for a sequence of symbols

    2. B

      To optimize a linear objective subject to linear constraints

    3. C

      To generate random values without imposing any constraints

    4. D

      To translate source code into machine instructions efficiently

    Correct answer
    B

    To optimize a linear objective subject to linear constraints

    Explanation

    Linear programming seeks values for variables that satisfy constraints while minimizing or maximizing a linear objective function.

  33. 33

    What does AMPL allow users to describe conveniently?

    1. A

      Graphical animations using notation based only on mouse movements

    2. B

      Optimization problems using notation close to ordinary mathematical notation

    3. C

      Text files using notation restricted to regular expressions

    4. D

      Operating-system kernels using notation close to assembly language

    Correct answer
    B

    Optimization problems using notation close to ordinary mathematical notation

    Explanation

    AMPL is a modeling language that lets users express optimization problems algebraically in a form familiar to people with mathematical training.

  34. 34

    What role does AMPL play between a mathematical model and an optimization solver?

    1. A

      It combines the model and instance data, sends a representation to a solver, and presents the results

    2. B

      It converts solver output into machine code without using model data

    3. C

      It replaces the solver by manually evaluating every possible solution

    4. D

      It stores only the final answer and discards the original problem structure

    Correct answer
    A

    It combines the model and instance data, sends a representation to a solver, and presents the results

    Explanation

    AMPL translates a model plus specific data into a form suitable for a solver, then maps the solver's results back into the model's original terms.

  35. 35

    In the diet problem, what is the optimization objective?

    1. A

      Maximize the number of food types regardless of cost or nutrition

    2. B

      Maximize food cost while avoiding all nutritional requirements

    3. C

      Minimize nutrients while purchasing a fixed number of packages

    4. D

      Minimize food cost while meeting required nutrient constraints

    Correct answer
    D

    Minimize food cost while meeting required nutrient constraints

    Explanation

    The diet problem seeks the least-cost combination of foods that provides enough required nutrients without exceeding specified limits.

  36. 36

    What is the purpose of the nutrient-by-food array in the AMPL diet model?

    1. A

      It records how much of each nutrient is present in each food

    2. B

      It records the programming language used by the solver

    3. C

      It records the order in which foods are displayed to the user

    4. D

      It records the number of constraints that the model can support

    Correct answer
    A

    It records how much of each nutrient is present in each food

    Explanation

    The two-dimensional parameter identifies the amount of each nutrient supplied by each type of food.

  37. 37

    Why is an AMPL model separate from its data?

    1. A

      The model cannot contain variables or constraints until after solving

    2. B

      Separating them prevents the solver from using any numerical values

    3. C

      One model can describe many specific instances with different data

    4. D

      The data must always describe a different problem domain from the model

    Correct answer
    C

    One model can describe many specific instances with different data

    Explanation

    The same diet model, for example, can be applied to different foods, prices, nutrient requirements, and populations by changing the data.

  38. 38

    What does it mean that AMPL is declarative in its modeling component?

    1. A

      It states the problem and constraints without specifying the computational procedure

    2. B

      It requires the user to write every algorithmic step used by the solver

    3. C

      It describes only data storage and excludes mathematical relationships

    4. D

      It executes each constraint immediately as soon as it is entered

    Correct answer
    A

    It states the problem and constraints without specifying the computational procedure

    Explanation

    AMPL describes what the optimization problem is rather than how the solver must compute its solution.

  39. 39

    What is notable about the matrices produced by typical industrial linear programming models?

    1. A

      They can be large while having density far below one percent

    2. B

      They are small and usually have every entry filled

    3. C

      They are always square and contain only binary values

    4. D

      They contain no zero entries because every variable affects every constraint

    Correct answer
    A

    They can be large while having density far below one percent

    Explanation

    Industrial models may have thousands of rows and columns but remain very sparse, with far fewer than one percent of possible entries nonzero.

  40. 40

    What additional language component does AMPL provide for specific problem instances?

    1. A

      A data specification language for supplying tables and parameter values

    2. B

      A graphical language for drawing the solver's processor architecture

    3. C

      A type-inference language for converting all numbers into strings

    4. D

      A machine-code language for replacing the optimization solver

    Correct answer
    A

    A data specification language for supplying tables and parameter values

    Explanation

    AMPL includes ways to specify the data associated with a general model, often by constructing tables of values.

  41. 41

    Why would an AMPL user add an integer declaration to the diet model?

    1. A

      To require package quantities to be whole numbers

    2. B

      To make the model independent of the available foods

    3. C

      To allow the solver to ignore all cost information

    4. D

      To convert nutrient constraints into textual descriptions

    Correct answer
    A

    To require package quantities to be whole numbers

    Explanation

    Without an integer restriction, a solution might request fractional packages. Declaring the variables integer requires whole-number quantities.

  42. 42

    Why is integer linear programming generally harder than ordinary linear programming?

    1. A

      The integer version cannot be represented using matrices

    2. B

      The integer version includes a computationally difficult, NP-complete constraint

    3. C

      The integer version cannot contain any objective function

    4. D

      The integer version always has more variables than the continuous version

    Correct answer
    B

    The integer version includes a computationally difficult, NP-complete constraint

    Explanation

    Requiring integer solutions makes the problem substantially harder; the talk identifies integer programming as NP-complete.

  43. 43

    What happened to AMPL after it began as a purely declarative modeling language?

    1. A

      All modeling features were removed and replaced by assembly instructions

    2. B

      It abandoned optimization and became a general text-formatting tool

    3. C

      It became limited to displaying results without accepting input data

    4. D

      Loops, conditionals, and function calls were added to support broader programming needs

    Correct answer
    D

    Loops, conditionals, and function calls were added to support broader programming needs

    Explanation

    Users needed more computational flexibility, so AMPL acquired loops, conditionals, function calls, and related programming-language mechanisms.

  44. 44

    What design consequence resulted from adding programming features to AMPL later?

    1. A

      The language became incapable of expressing declarative constraints

    2. B

      The original modeling notation became simpler and more uniform

    3. C

      The added syntax became irregular and weakened the language's original conceptual integrity

    4. D

      The added features made the entire language substantially smaller

    Correct answer
    C

    The added syntax became irregular and weakened the language's original conceptual integrity

    Explanation

    Features added after the original design often fit poorly with the initial structure, producing irregular syntax and reducing conceptual cleanliness.

  45. 45

    What was the central idea behind EQN?

    1. A

      Represent every mathematical expression as a graphical mouse gesture

    2. B

      Represent mathematical notation in a form based on how mathematicians speak it

    3. C

      Represent numerical formulas exclusively as machine instructions

    4. D

      Represent document structure through database queries

    Correct answer
    B

    Represent mathematical notation in a form based on how mathematicians speak it

    Explanation

    EQN used spoken mathematical phrases such as 'x sub i equals pi' as a convenient textual notation that could be translated into typesetting commands.

  46. 46

    Why was a pipeline architecture useful for early document-processing tools such as EQN?

    1. A

      Small separate programs could process different parts of a document despite limited memory

    2. B

      A pipeline ensured that mathematical material was processed manually

    3. C

      A pipeline eliminated the need for specialized input notations

    4. D

      A pipeline allowed every feature to be placed into one very large program

    Correct answer
    A

    Small separate programs could process different parts of a document despite limited memory

    Explanation

    Early machines had very limited memory, so separate programs connected by pipelines could divide document-processing tasks into manageable components.

  47. 47

    How did EQN influence TeX?

    1. A

      TeX's mathematics mode developed from the same basic idea in a richer and more robust form

    2. B

      TeX replaced mathematical notation with assembly-language instructions

    3. C

      TeX prevented users from entering mathematical expressions textually

    4. D

      TeX used EQN only as a system for processing database records

    Correct answer
    A

    TeX's mathematics mode developed from the same basic idea in a richer and more robust form

    Explanation

    The talk states that Don Knuth drew on EQN's basic approach while developing TeX's more powerful mathematics facilities.

  48. 48

    Why was EQN accessible to typists without mathematical backgrounds?

    1. A

      It required typists to understand parser construction before use

    2. B

      It avoided all mathematical symbols by allowing only numerical data

    3. C

      Its notation was simple enough to learn and use without deep mathematical knowledge

    4. D

      It automatically converted handwritten equations using image recognition

    Correct answer
    C

    Its notation was simple enough to learn and use without deep mathematical knowledge

    Explanation

    Bell Labs typists could learn EQN's straightforward notation in about an hour and use it to produce documents of the required complexity.

  49. 49

    What implementation technology was used to build EQN's parser?

    1. A

      A browser-based JavaScript interpreter

    2. B

      YACC, a parser-generator system

    3. C

      A machine-code monitor based on switches

    4. D

      A spreadsheet calculation engine

    Correct answer
    B

    YACC, a parser-generator system

    Explanation

    EQN used YACC to generate its parser, making it possible to implement the language without writing the parser entirely by hand.

  50. 50

    What was Pic designed to describe?

    1. A

      Line drawings such as flowcharts and organization charts using text

    2. B

      Compiler optimizations using machine-level instructions

    3. C

      Database schemas using declarative query expressions

    4. D

      Statistical models using tables of numerical observations

    Correct answer
    A

    Line drawings such as flowcharts and organization charts using text

    Explanation

    Pic described line drawings textually and converted those descriptions into commands for the Troff typesetting system.

  51. 51

    What advantage did a textual Pic description provide over manually drawn artwork?

    1. A

      The drawing required a separate artist for every small alteration

    2. B

      The drawing could be modified or extended systematically with little effort

    3. C

      The drawing could never be changed after it was first generated

    4. D

      The drawing was independent of all other document-processing tools

    Correct answer
    B

    The drawing could be modified or extended systematically with little effort

    Explanation

    Because the picture was represented procedurally, changes such as adding sampling lines or altering a curve could be made by modifying the description.

  52. 52

    How did the graph-generation tool described in the talk use Pic?

    1. A

      It converted Pic drawings into raw machine code for numerical processors

    2. B

      It replaced all textual data with manually positioned graphical elements

    3. C

      It converted data into Pic descriptions, which were then converted into Troff output

    4. D

      It used Pic only to collect data without producing any visual output

    Correct answer
    C

    It converted data into Pic descriptions, which were then converted into Troff output

    Explanation

    The graphing system generated Pic from data, and Pic in turn generated Troff commands for typesetting the graph.

  53. 53

    Why did EQN, Pic, and related Troff tools become less widely used?

    1. A

      They could not represent any mathematical or graphical content

    2. B

      The document-preparation niche centered on Troff was largely superseded by TeX and LaTeX

    3. C

      They required more memory than modern graphical systems can provide

    4. D

      They were replaced because textual descriptions cannot be modified systematically

    Correct answer
    B

    The document-preparation niche centered on Troff was largely superseded by TeX and LaTeX

    Explanation

    The tools were effective, but the ecosystem in which they were used declined as TeX, LaTeX, and related systems became more prevalent.

  54. 54

    According to the talk, what is the most important condition for a language to succeed?

    1. A

      It must solve a problem people care about with notation easy enough to use

    2. B

      It must require programmers to learn an entirely unfamiliar notation

    3. C

      It must be designed for a broad domain even if users lack a real need

    4. D

      It must contain as many features as possible regardless of usability

    Correct answer
    A

    It must solve a problem people care about with notation easy enough to use

    Explanation

    A language succeeds when its notation addresses an important problem and makes expressing solutions sufficiently easy.

  55. 55

    What does cultural compatibility mean in language design?

    1. A

      The language avoids all syntax resembling existing languages

    2. B

      The language is restricted to one national programming community

    3. C

      The language uses conventions familiar to its intended programmers

    4. D

      The language must be implemented by a government standards body

    Correct answer
    C

    The language uses conventions familiar to its intended programmers

    Explanation

    Cultural compatibility includes familiar syntax and established conventions, which reduce the barrier to learning and adopting a language.

  56. 56

    Why did C-like syntax help languages such as C++, Java, JavaScript, and AWK gain acceptance?

    1. A

      Programmers could recognize and reuse familiar surface conventions

    2. B

      C-like syntax automatically guaranteed superior runtime performance

    3. C

      C-like syntax made all of the languages semantically identical to C

    4. D

      C-like syntax prevented the languages from adding new features

    Correct answer
    A

    Programmers could recognize and reuse familiar surface conventions

    Explanation

    Familiar syntax makes a new language easier to approach, even when its semantics and features differ from C.

  57. 57

    What does environmental compatibility mean for a programming language?

    1. A

      The language can run only in a newly created operating environment

    2. B

      The language avoids interoperability with established systems

    3. C

      The language requires users to replace all existing software tools

    4. D

      The language fits existing tools, libraries, platforms, and working practices

    Correct answer
    D

    The language fits existing tools, libraries, platforms, and working practices

    Explanation

    Environmental compatibility reduces the amount of new infrastructure and working practice that users must adopt.

  58. 58

    Why did C++ benefit from environmental compatibility with C?

    1. A

      It could be used only on a new class of processors unavailable to C

    2. B

      It required users to abandon C libraries and rewrite all existing programs

    3. C

      It was successful because it deliberately avoided C's syntax and platforms

    4. D

      It fit naturally into the C ecosystem, including Unix, libraries, and similar source code

    Correct answer
    D

    It fit naturally into the C ecosystem, including Unix, libraries, and similar source code

    Explanation

    C++ could operate within the existing C and Unix environment, making adoption easier and allowing users to build on established infrastructure.

  59. 59

    Why was JavaScript more successful than Java in web browsers according to the talk?

    1. A

      Java was rejected because it had no support for object-oriented programming

    2. B

      JavaScript succeeded because browsers could not process any source code

    3. C

      JavaScript required users to compile every web page before viewing it

    4. D

      JavaScript source was easier to send to browsers than compiled Java results

    Correct answer
    D

    JavaScript source was easier to send to browsers than compiled Java results

    Explanation

    Sending JavaScript source to a browser was considerably easier than compiling Java programs and distributing the compiled results in the relevant browser environment.

  60. 60

    How did favorable timing contribute to C's success?

    1. A

      C became successful by avoiding every new hardware platform

    2. B

      C succeeded because hardware development stopped soon after its creation

    3. C

      C was used only during the minicomputer era and then disappeared

    4. D

      C repeatedly benefited from major hardware waves such as minicomputers, workstations, PCs, and embedded systems

    Correct answer
    D

    C repeatedly benefited from major hardware waves such as minicomputers, workstations, PCs, and embedded systems

    Explanation

    C gained renewed opportunities as computing moved through minicomputers, workstations, personal computers, and embedded systems.

  61. 61

    Which is an example of a language failing because its domain disappeared?

    1. A

      C lost its niche because embedded systems stopped using software

    2. B

      JavaScript lost its niche because browsers stopped supporting source code

    3. C

      AMPL lost its niche because optimization ceased to be useful

    4. D

      Troff-related document tools lost their niche as other systems became dominant

    Correct answer
    D

    Troff-related document tools lost their niche as other systems became dominant

    Explanation

    The Troff ecosystem declined when its document-preparation niche was largely replaced by systems such as TeX and LaTeX.

  62. 62

    Which design problem can cause a programming language to fail even when its ideas are useful?

    1. A

      A notation that is concise and well matched to its domain

    2. B

      Excessive size, complexity, slowness, or lateness

    3. C

      Compatibility with existing libraries and operating systems

    4. D

      A small scope that makes implementation manageable

    Correct answer
    B

    Excessive size, complexity, slowness, or lateness

    Explanation

    The talk identifies excessive size, complexity, poor performance, and arriving too late as possible causes of failure.

  63. 63

    What does it mean for a language to 'fail to thrive' rather than disappear completely?

    1. A

      It becomes successful only after its original domain disappears

    2. B

      Its syntax becomes more popular while its implementation vanishes

    3. C

      It is immediately removed from every computer system

    4. D

      Its user population shrinks even though the language continues to exist

    Correct answer
    D

    Its user population shrinks even though the language continues to exist

    Explanation

    Very few languages vanish entirely; more commonly, they remain available but stop growing and lose users.

  64. 64

    Why can adding features gradually damage a language's conceptual integrity?

    1. A

      Later features always remove useful capabilities from the original language

    2. B

      New features prevent users from extending the language further

    3. C

      Adding features guarantees that every program will become shorter

    4. D

      Later features may fit awkwardly with the original design and notation

    Correct answer
    D

    Later features may fit awkwardly with the original design and notation

    Explanation

    A language that begins with a coherent design can become irregular when features are added without being part of the original conceptual structure.

  65. 65

    What lesson about language research was drawn from functional programming languages?

    1. A

      Functional languages replaced all mainstream imperative languages

    2. B

      Ideas such as recursion, garbage collection, type inference, and first-class functions influenced mainstream languages

    3. C

      Functional languages contributed no concepts used outside universities

    4. D

      Functional languages were successful mainly because they avoided abstraction

    Correct answer
    B

    Ideas such as recursion, garbage collection, type inference, and first-class functions influenced mainstream languages

    Explanation

    Although functional languages were described as relatively uncommon in industry, many ideas first explored there later entered mainstream practice.

  66. 66

    What advice does the talk give to someone interested in designing a new language?

    1. A

      Begin by designing a language that handles every possible programming task

    2. B

      Focus first on reproducing the full complexity of an existing general-purpose language

    3. C

      Begin with a small domain-specific language rather than attempting to build the next C++

    4. D

      Avoid solving a concrete problem until the language has many advanced features

    Correct answer
    C

    Begin with a small domain-specific language rather than attempting to build the next C++

    Explanation

    A small, focused language is more feasible to design and can still have a meaningful practical effect.

Question 1 of 66
Question 1 of 66

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent