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

  • 74Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Language Choice
For a task involving large amounts of data, writing a program is generally preferable to doing the analysis
.

74 questions

  1. 1
    For a task involving large amounts of data, writing a program is generally preferable to doing the analysis
    _____
    .
    Hint

    Think about the approach that automates repetitive processing.

    Answer

    by hand

  2. 2
    The speaker's C implementation of the volcanic-eruption task was difficult partly because he repeatedly forgot details of functions such as fgets, scanf, and
    _____
    .
    Hint

    This C function was criticized as being especially poorly designed.

    Answer

    strtok

  3. 3
    In C, reading a floating-point value with scanf requires the conversion specifier
    _____
    rather than %d or %ld.
    Hint

    Use the scanf specifier for a double-precision value.

    Answer

    %lf

  4. 4
    For the data-processing example, AWK was preferred over C because it took about
    _____
    to write and worked correctly immediately.
    Hint

    This was dramatically shorter than the 20 minutes or half hour needed for C.

    Answer

    two seconds

  5. 5
    A notation that matches the task can make a programming job substantially
    _____
    .
    Hint

    Good notation reduces the effort needed to express the solution.

    Answer

    easier

  6. 6
    For a program that runs only once and finishes in a tiny fraction of a second,
    _____
    efficiency matters more than machine efficiency.
    Hint

    This refers to the time needed to write the code.

    Answer

    programmer

  7. 7
    Google's search engine is presented as an example of a system where
    _____
    efficiency does matter, so C or C++ is used instead of AWK.
    Hint

    This is the efficiency of the running program rather than the person writing it.

    Answer

    machine

  8. 8
    Choosing a programming language involves tradeoffs between programmer efficiency and
    _____
    efficiency.
    Hint

    One concerns development time; the other concerns execution performance.

    Answer

    machine

  9. 9
    The Tower of Babel analogy is used to compare the many natural languages created in the story with the many
    _____
    languages available today.
    Hint

    These are artificial languages used to instruct computers.

    Answer

    programming

  10. 10
    In the late 1940s, computers were programmed directly using absolute machine code represented in
    _____
    .
    Hint

    Think of the two-symbol representation used by machine hardware.

    Answer

    binary

  11. 11
    Assembly languages automated the clerical work of converting op-codes into
    _____
    .
    Hint

    These are the binary patterns understood by the machine.

    Answer

    bit-patterns

  12. 12
    High-level languages raised the level of discourse above the details of a particular machine
    _____
    .
    Hint

    This refers to the organization and details of a specific computer system.

    Answer

    architecture

  13. 13
    FORTRAN was originally associated with
    _____
    kinds of problems.
    Hint

    This language was designed for numerical and scientific work.

    Answer

    engineering

  14. 14
    COBOL was associated with
    _____
    kinds of problems.
    Hint

    Think of commercial data processing.

    Answer

    business

  15. 15
    The major software advance of the late 1950s and 1960s was the invention of
    _____
    languages.
    Hint

    These languages abstract away from machine-specific details.

    Answer

    high-level

  16. 16
    The ability to write a high-level-language program once and translate it for different machines improved
    _____
    .
    Hint

    This means the program can be moved across hardware platforms.

    Answer

    portability

  17. 17
    C became important in the 1970s because it enabled programmers to write core systems components such as compilers, loaders, assemblers, editors, and the
    _____
    system.
    Hint

    This is the central software layer managing computer resources.

    Answer

    operating

  18. 18
    Object-oriented languages added structures that helped programmers maintain intellectual control as programs became larger and more
    _____
    .
    Hint

    The issue concerns increasing difficulty of understanding and maintaining code.

    Answer

    complex

  19. 19
    C++ is identified as the dominant example of the
    _____
    language trend.
    Hint

    This paradigm organizes software around objects and their relationships.

    Answer

    object-oriented

  20. 20
    A defining characteristic of scripting languages is that
    _____
    is treated as a fundamental data type.
    Hint

    Scripting languages naturally manipulate this as well as numbers.

    Answer

    text

  21. 21
    Regular expressions are typically an
    _____
    part of scripting languages.
    Hint

    They are built in or provided as libraries and form an important part of the language environment.

    Answer

    integral

  22. 22
    All scripting languages are described as having
    _____
    arrays for handling collections of data.
    Hint

    These arrays use keys rather than only numeric positions.

    Answer

    associative

  23. 23
    Compared with languages such as SML, OCaml, and Haskell, scripting languages tend to play fast and loose with
    _____
    .
    Hint

    The issue concerns whether values are strings, numbers, or other categories.

    Answer

    types

  24. 24
    Scripting languages commonly use
    _____
    because modern hardware can compensate for some execution-speed loss.
    Hint

    These execute programs without first compiling them fully into machine code.

    Answer

    interpreters

  25. 25
    The earliest scripting-language example mentioned in the talk is
    _____
    .
    Hint

    It predates shell programming and AWK in the historical sequence.

    Answer

    SNOBOL

  26. 26
    JavaScript began in 1995 and became the dominant scripting language, especially on the
    _____
    .
    Hint

    Think of the platform accessed through browsers.

    Answer

    Web

  27. 27
    Functional programming research influenced mainstream languages through ideas such as recursion, garbage collection, type inference, and
    _____
    as first-class citizens.
    Hint

    These callable units can be treated like values in functional programming.

    Answer

    functions

  28. 28
    A language designed for a narrow and specific problem domain is called a
    _____
    language.
    Hint

    The term contrasts with general-purpose programming languages.

    Answer

    domain-specific

  29. 29
    A domain-specific language does not necessarily need to be
    _____
    complete.
    Hint

    This property concerns whether the language can simulate arbitrary computation.

    Answer

    Turing

  30. 30
    AWK was developed from experience with the UNIX
    _____
    .
    Hint

    This command environment was useful but not very good for numerical work.

    Answer

    shell

  31. 31
    AWK was created through the collaboration of Al Aho, Peter Weinberger, and Brian
    _____
    .
    Hint

    The speaker is one of the three people named.

    Answer

    Kernighan

  32. 32
    Al Aho contributed an interest in regular expressions, while Peter Weinberger contributed an interest in
    _____
    kinds of applications.
    Hint

    These applications organize and retrieve structured information.

    Answer

    database

  33. 33
    AWK was intended for simple one-
    _____
    programs.
    Hint

    The goal was to express a task in a single line of code.

    Answer

    liner

  34. 34
    Finding all volcanic eruptions with magnitude greater than 6 illustrates AWK's use for data
    _____
    .
    Hint

    This operation keeps records that satisfy a condition.

    Answer

    selection

  35. 35
    AWK's central notational paradigm is the
    _____
    -action structure.
    Hint

    A test is paired with an operation performed when the test matches.

    Answer

    pattern

  36. 36
    In grep, the pattern is a regular expression and the action is to
    _____
    the matching input.
    Hint

    The result displays records that satisfy the expression.

    Answer

    print

  37. 37
    AWK automates processing through three nested loops over files, lines, and matching
    _____
    .
    Hint

    The final loop checks the conditions associated with actions.

    Answer

    patterns

  38. 38
    AWK automatically reads input and splits each line into
    _____
    .
    Hint

    These are the individual pieces of a record, such as the first or second item.

    Answer

    fields

  39. 39
    AWK variables can contain either strings or numbers because the language uses flexible, largely
    _____
    typing.
    Hint

    The programmer does not need to initialize a fixed type for each variable.

    Answer

    dynamic

  40. 40
    An AWK action with no pattern is executed on
    _____
    input line.
    Hint

    Without a condition, the action applies universally.

    Answer

    every

  41. 41
    The speaker describes the associative array as the most useful single
    _____
    structure.
    Hint

    It is a mechanism for organizing collections of related values.

    Answer

    data

  42. 42
    Linear programming seeks variable values that satisfy constraints while minimizing or maximizing an
    _____
    function.
    Hint

    This function expresses the quantity to optimize.

    Answer

    objective

  43. 43
    When constraints and the objective are linear, the problem is classified as
    _____
    programming.
    Hint

    This is the standard optimization category described.

    Answer

    linear

  44. 44
    AMPL lets users describe optimization problems using notation convenient for people familiar with basic
    _____
    notation.
    Hint

    The notation resembles algebra written on a board.

    Answer

    mathematical

  45. 45
    AMPL combines a model description with data for a specific instance and sends the result to an optimization
    _____
    .
    Hint

    This program computes the optimal solution.

    Answer

    solver

  46. 46
    The diet problem seeks a food plan that supplies enough nutrients, avoids excessive amounts, and minimizes
    _____
    .
    Hint

    The university wants to keep people alive as cheaply as possible.

    Answer

    cost

  47. 47
    In the diet problem, the amount of each nutrient in each food is represented by a
    _____
    -dimensional array.
    Hint

    The array varies over both foods and nutrients.

    Answer

    two

  48. 48
    AMPL is fundamentally a
    _____
    language because it describes what problem to solve without specifying the computational process.
    Hint

    It states the desired model and relationships rather than an algorithm of execution.

    Answer

    declarative

  49. 49
    Industrial linear-programming models may have thousands of rows and columns but are typically very
    _____
    matrices.
    Hint

    Most entries are zero, so the density is far below one percent.

    Answer

    sparse

  50. 50
    AMPL includes a separate data specification language because the same model can be applied to different
    _____
    instances.
    Hint

    The model stays general while the actual inputs vary.

    Answer

    specific

  51. 51
    Adding the word integer changes an AMPL model so that the solver seeks an
    _____
    solution.
    Hint

    This prevents fractional quantities such as forty-six and two-thirds packages.

    Answer

    integer

  52. 52
    Integer linear programming is described as a much harder problem because it is
    _____
    -complete.
    Hint

    This is the computational-complexity classification mentioned in the talk.

    Answer

    NP

  53. 53
    The EQN language was designed to typeset
    _____
    material using notation based on how mathematicians speak expressions aloud.
    Hint

    It handled expressions such as 'x sub i equals pi.'

    Answer

    mathematical

  54. 54
    EQN processed mathematical input through a Unix
    _____
    that fed its output into a program handling ordinary text.
    Hint

    This mechanism connects separate programs so one program's output becomes another's input.

    Answer

    pipeline

  55. 55
    The first Unix machine mentioned had only 64
    _____
    bytes of memory.
    Hint

    The speaker contrasts this unit with M and G.

    Answer

    K

  56. 56
    The mathematics mode in TeX derives from the basic idea introduced by
    _____
    .
    Hint

    This was the earlier Unix document-preparation language.

    Answer

    EQN

  57. 57
    EQN was easy enough to teach to Bell Labs typists with no mathematical background in about
    _____
    .
    Hint

    The instruction period was very short.

    Answer

    an hour

  58. 58
    EQN's implementation used YACC, a
    _____
    generator.
    Hint

    This tool converts a grammar into a program that recognizes the language.

    Answer

    parser

  59. 59
    Pic was designed to specify textual descriptions of
    _____
    drawings such as flowcharts and organization charts.
    Hint

    The drawings consist primarily of lines, boxes, and related shapes.

    Answer

    line

  60. 60
    Pic converted drawing descriptions into
    _____
    commands that produced the final formatted picture.
    Hint

    This was the document-formatting system used in the pipeline.

    Answer

    Troff

  61. 61
    Adding a conditional to the Pic description made it easy to draw every fourth vertical line when illustrating waveform
    _____
    .
    Hint

    The vertical marks indicate selected points on a waveform.

    Answer

    sampling

  62. 62
    The language Grap generated graphs by converting data into Pic, which then generated
    _____
    input.
    Hint

    Pic served as the intermediate drawing language.

    Answer

    Troff

  63. 63
    A language is more likely to succeed when its notation solves a problem people care about while remaining easy enough to
    _____
    .
    Hint

    The issue is the effort required to express programs in the language.

    Answer

    write

  64. 64
    Languages whose syntax resembles familiar C syntax are described as culturally
    _____
    .
    Hint

    Familiarity makes programmers more willing to try the language.

    Answer

    compatible

  65. 65
    A language is environmentally compatible when it fits existing tools, libraries, operating systems, and ways of
    _____
    .
    Hint

    The phrase concerns avoiding a completely new development environment.

    Answer

    doing business

  66. 66
    C++ succeeded partly because it fit naturally into the existing
    _____
    ecosystem.
    Hint

    The language was deliberately designed to remain close to its predecessor.

    Answer

    C

  67. 67
    The speaker argues that open-source status is increasingly important because users can invest in improving a language without first having to
    _____
    for it.
    Hint

    This is the financial barrier removed by open-source software.

    Answer

    pay

  68. 68
    JavaScript outperformed Java in browsers partly because JavaScript source could be sent directly, without first sending a
    _____
    result.
    Hint

    Java required an additional translation step before deployment.

    Answer

    compiled

  69. 69
    C benefited from good timing by gaining renewed use with minicomputers, workstations, PCs, and
    _____
    systems.
    Hint

    These are specialized systems built into devices.

    Answer

    embedded

  70. 70
    Languages can fail when the application
    _____
    they serve disappears, as happened with many Troff-related tools.
    Hint

    This is the specialized area in which a language has a role.

    Answer

    domain

  71. 71
    Languages may also fail because they become too large, complicated, slow, or
    _____
    .
    Hint

    Arriving after the relevant opportunity has passed is one possible failure mode.

    Answer

    late

  72. 72
    The speaker recommends beginning language-design projects with a small
    _____
    -specific language rather than attempting to build the next C++.
    Hint

    Focus on a narrow task instead of every possible programming problem.

    Answer

    domain

  73. 73
    When a language accumulates loops, conditionals, and other later additions, it may lose its original conceptual
    _____
    .
    Hint

    This term refers to the cleanliness and coherence of the original design.

    Answer

    integrity

  74. 74
    The talk concludes that most languages do not disappear completely; instead, they often
    _____
    to thrive as their user populations shrink.
    Hint

    This phrase describes decline without total extinction.

    Answer

    fail

1 of 74
Question 1 of 74

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent