1. Home
  2. Explore
  3. Computer Science
  4. Bjarne Stroustrup Technology Lecture

Study methods

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

Bjarne Stroustrup Technology Lecture

  • 92Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Design and History
C++ grew from the combination of C's close-to-the-hardware model and Simula's
concepts.

92 questions

  1. 1
    C++ grew from the combination of C's close-to-the-hardware model and Simula's
    _____
    concepts.
    Hint

    Think of the mechanism Simula introduced for building user-defined abstractions.

    Answer

    class

  2. 2
    C's model of representing objects of the same type next to one another in memory supports structures such as
    _____
    .
    Hint

    This structure stores a sequence of same-type elements.

    Answer

    arrays

  3. 3
    C represents a collection of fields of different types grouped together as a
    _____
    .
    Hint

    This C construct groups unlike data fields.

    Answer

    struct

  4. 4
    Fortran helped shift programming from expressing machine operations toward expressing the
    _____
    .
    Hint

    This is what a programmer is trying to solve, rather than the details of the machine.

    Answer

    problem

  5. 5
    Simula's class system let programmers build their own
    _____
    instead of relying only on built-in data structures.
    Hint

    These let programmers represent domain-specific ideas, such as vectors or matrices.

    Answer

    abstractions

  6. 6
    C++ added constructors and destructors to help create and clean up
    _____
    .
    Hint

    These are instances of classes that may need initialization and cleanup.

    Answer

    objects

  7. 7
    One central goal of C++ is to improve
    _____
    so that many incorrect operations can be caught before runtime.
    Hint

    It concerns how reliably a language checks the types used in operations.

    Answer

    type safety

  8. 8
    C++ aims to support performance close to the
    _____
    when systems code needs it.
    Hint

    Think of the physical machine that executes the program.

    Answer

    hardware

  9. 9
    For hard real-time systems, operations must have predictable execution
    _____
    .
    Hint

    A real-time system may require a known upper limit on how long an operation takes.

    Answer

    time

  10. 10
    A design goal for C++ is that code complexity should be proportional to the complexity of the
    _____
    being performed.
    Hint

    This is the work the program is intended to accomplish.

    Answer

    task

  11. 11
    C++ is particularly aimed at efficient abstractions for systems, infrastructure, and resource-constrained
    _____
    .
    Hint

    These are programs or systems built to operate under limited resources.

    Answer

    applications

  12. 12
    Maintaining long-term
    _____
    is a reason C++ cannot simply discard every old feature.
    Hint

    It allows existing programs to keep working as the language evolves.

    Answer

    compatibility

  13. 13
    A resource must be acquired and later
    _____
    to the place it came from.
    Hint

    This is the opposite of acquiring a resource.

    Answer

    released

  14. 14
    Memory, file handles, communication connections, and locks are all examples of
    _____
    .
    Hint

    Programs acquire these items and must eventually give them back.

    Answer

    resources

  15. 15
    When allocated memory is not released, the program has a memory
    _____
    .
    Hint

    The resource remains unavailable because cleanup was missed.

    Answer

    leak

  16. 16
    A clear resource
    _____
    identifies which part of a program is responsible for cleanup.
    Hint

    This is the entity responsible for giving a resource back.

    Answer

    owner

  17. 17
    In resource acquisition is initialization, a resource is acquired as part of an object's
    _____
    .
    Hint

    The key idea connects obtaining a resource with setting up an object.

    Answer

    initialization

  18. 18
    With RAII, an object's destructor releases its resources when the object goes out of
    _____
    .
    Hint

    This is the region in which a local object exists.

    Answer

    scope

  19. 19
    A constructor can establish an object's
    _____
    ; its destructor can tear that state down.
    Hint

    This is a condition that should remain true for a properly formed object.

    Answer

    invariant

  20. 20
    Standard containers such as vectors, strings, and maps manage their resources and clean up when they go out of
    _____
    .
    Hint

    Think about when a local container stops existing.

    Answer

    scope

  21. 21
    A vector of strings cleans up its elements by having the vector destroy each managed
    _____
    .
    Hint

    The vector contains objects that also have their own cleanup behavior.

    Answer

    string

  22. 22
    RAII helps ensure cleanup still happens when a function exits because of an
    _____
    .
    Hint

    This is an error-handling event that can interrupt the ordinary flow of execution.

    Answer

    exception

  23. 23
    A raw pointer is best used to refer to an object owned by
    _____
    rather than to hide responsibility for owning it.
    Hint

    The pointer can refer to an object without being responsible for its lifetime.

    Answer

    somebody else

  24. 24
    When one part of a program is the sole owner of a dynamically allocated object, a
    _____
    pointer expresses that ownership.
    Hint

    The name indicates that there is only one owner.

    Answer

    unique

  25. 25
    A shared pointer maintains a
    _____
    so it can determine when the last owner has gone away.
    Hint

    It tracks how many owners share the managed object.

    Answer

    use count

  26. 26
    Garbage collection does not automatically manage every kind of resource, such as file handles and locks; it primarily addresses
    _____
    .
    Hint

    This is the resource that garbage collection conventionally reclaims.

    Answer

    memory

  27. 27
    A shared pointer can impose coordination costs because its ownership
    _____
    is shared and updated by multiple owners.
    Hint

    This value tracks how many shared owners remain.

    Answer

    count

  28. 28
    If an object is not actually shared, using a shared pointer introduces a shared
    _____
    unnecessarily.
    Hint

    This is what the ownership count becomes when multiple pointers coordinate through it.

    Answer

    resource

  29. 29
    Returning a large object by value can be problematic if it requires an expensive
    _____
    .
    Hint

    This operation duplicates the object's representation.

    Answer

    copy

  30. 30
    Returning a raw pointer to a newly created object raises the question of who is responsible for its
    _____
    .
    Hint

    The issue is deciding who must eventually delete or clean up the object.

    Answer

    ownership

  31. 31
    Returning a reference to a local object does not solve ownership problems and can leave the caller with an invalid
    _____
    .
    Hint

    The caller receives an alias that may outlive the object it refers to.

    Answer

    reference

  32. 32
    A move operation transfers an object's
    _____
    instead of duplicating all of its contents.
    Hint

    For a matrix, this may include the internal pointer to its stored elements.

    Answer

    representation

  33. 33
    After transferring its representation, a move constructor leaves the source object in a state that can be safely
    _____
    .
    Hint

    The source no longer owns the transferred resource, but its lifetime still ends normally.

    Answer

    destroyed

  34. 34
    Moving a matrix can be inexpensive because its stored elements can remain in place while ownership of their representation is
    _____
    .
    Hint

    The destination takes over the existing storage rather than copying every element.

    Answer

    transferred

  35. 35
    A move constructor defines what it means to
    _____
    an object, while a copy constructor defines what it means to duplicate one.
    Hint

    This operation transfers the object's resources rather than duplicating them.

    Answer

    move

  36. 36
    If a class's members already know how to copy and move themselves, the compiler can often generate the class's special
    _____
    automatically.
    Hint

    These include the operations used to copy or move an object.

    Answer

    constructors

  37. 37
    Returning a new object directly expresses the intended value semantics more naturally than returning a pointer to the
    _____
    .
    Hint

    The caller should work with the matrix or shape itself, not an address to it.

    Answer

    object

  38. 38
    Unique ownership is usually preferable to shared ownership when an object has only one
    _____
    .
    Hint

    There is no need to track multiple parties if just one party controls the object's lifetime.

    Answer

    owner

  39. 39
    In object-oriented programming, inheritance is most useful when the concepts in a domain form a meaningful
    _____
    .
    Hint

    Shapes, circles, and triangles can be organized by more general and more specific categories.

    Answer

    hierarchy

  40. 40
    A circle that can be treated as a shape illustrates a hierarchical
    _____
    relationship.
    Hint

    The specific type can be described as a kind of the more general type.

    Answer

    is-a

  41. 41
    A virtual function supports runtime
    _____
    by allowing a call through a base interface to select a derived implementation.
    Hint

    One interface can invoke different implementations depending on the object's actual type.

    Answer

    polymorphism

  42. 42
    A class with an incompletely implemented interface can be made
    _____
    so it serves as a base rather than a complete object.
    Hint

    This kind of class cannot be instantiated as a fully concrete object.

    Answer

    abstract

  43. 43
    C++ supports interface inheritance as well as
    _____
    inheritance.
    Hint

    This kind of inheritance shares behavior or code in addition to an interface.

    Answer

    implementation

  44. 44
    The override specifier makes it explicit that a derived function is intended to replace a
    _____
    function.
    Hint

    This base-class function supports runtime dispatch.

    Answer

    virtual

  45. 45
    The three main C++ access levels discussed for class members are public, protected, and
    _____
    .
    Hint

    This access level restricts direct access from outside the class.

    Answer

    private

  46. 46
    Making data protected can make it harder to preserve an object's
    _____
    because derived classes can modify that data.
    Hint

    This is a condition the class relies on remaining true.

    Answer

    invariant

  47. 47
    Virtual calls can be costly in performance-sensitive code partly because they can inhibit
    _____
    .
    Hint

    This optimization replaces a function call with its body at the call site.

    Answer

    inlining

  48. 48
    The claim that good programming always means using large object-oriented class hierarchies is
    _____
    .
    Hint

    The lecture warns that object-oriented programming is not the only way to write good code.

    Answer

    wrong

  49. 49
    Templates let programmers parameterize types and
    _____
    so reusable code can work with different inputs.
    Hint

    The same operation, such as sorting, can be applied to different element types.

    Answer

    algorithms

  50. 50
    When a template argument's type can be inferred from the argument passed to a function, the compiler performs type
    _____
    .
    Hint

    The programmer does not need to spell out the type in that call.

    Answer

    deduction

  51. 51
    Template code that accepts a type based on whether it supports the operations used by the code follows the idea of
    _____
    typing.
    Hint

    The saying is that if something behaves like a particular animal, it can be treated as one.

    Answer

    duck

  52. 52
    A traditional template may produce confusing errors when its argument type fails to support a required
    _____
    .
    Hint

    For example, sorting may require that elements can be compared.

    Answer

    operation

  53. 53
    Template code is checked during compilation, so many type or operation errors can be caught before the program is
    _____
    .
    Hint

    This occurs before users receive the program.

    Answer

    shipped

  54. 54
    A function object can hold
    _____
    that an algorithm uses when applying the function.
    Hint

    Unlike a plain function, this object can retain information such as a comparison value.

    Answer

    state

  55. 55
    A lambda expression provides a concise way to write an inline
    _____
    for use with an algorithm.
    Hint

    It can stand in for a small callable object, such as a comparison rule.

    Answer

    function object

  56. 56
    An iterator pair can represent only part of a sequence, allowing an algorithm to work on a
    _____
    .
    Hint

    The selected range may be smaller than the entire container.

    Answer

    subsequence

  57. 57
    A generic algorithm can use an element's
    _____
    instead of requiring a particular concrete container type.
    Hint

    This lets one algorithm work with different containers holding the same kind of values.

    Answer

    type

  58. 58
    The STL's generic approach separates algorithms from the
    _____
    that provide their input ranges.
    Hint

    Vectors and other structures store the elements an algorithm processes.

    Answer

    containers

  59. 59
    In generic programming, a container's elements may need to be
    _____
    so algorithms can rearrange them.
    Hint

    Sorting often changes the positions of values rather than creating an entirely new container.

    Answer

    swappable

  60. 60
    The lecture describes generic programming as ordinary
    _____
    applied to types and operations selected at compile time.
    Hint

    The point is that it does not require an entirely separate way of thinking.

    Answer

    programming

  61. 61
    A concept states the requirements a template places on its
    _____
    .
    Hint

    These are the types or values supplied when the template is used.

    Answer

    arguments

  62. 62
    A sorting algorithm that requires direct access to arbitrary positions needs a
    _____
    access range.
    Hint

    This iterator capability supports jumping to an indexed position rather than advancing one step at a time.

    Answer

    random

  63. 63
    The standard sort algorithm cannot use a linked list's ordinary iterators because they are not
    _____
    access iterators.
    Hint

    The missing capability is jumping directly to an arbitrary element.

    Answer

    random

  64. 64
    A sorting requirement may include that elements can be compared using an ordering such as
    _____
    than.
    Hint

    This is the default ordering relation commonly used by sorting.

    Answer

    less

  65. 65
    When an algorithm searches a range and finds no match, it commonly returns the range's
    _____
    iterator.
    Hint

    This iterator marks the position just beyond the searched range.

    Answer

    end

  66. 66
    Concepts can improve template diagnostics by identifying which stated
    _____
    a type fails to meet.
    Hint

    This is a requirement that must hold for a template argument.

    Answer

    constraint

  67. 67
    A concept for sorting can express requirements such as iterator access and an element
    _____
    .
    Hint

    The algorithm needs to know what kind of values it is sorting.

    Answer

    type

  68. 68
    The lecture argues that concepts make template
    _____
    explicit instead of leaving them implicit in the code.
    Hint

    These describe what a template needs its arguments to provide.

    Answer

    requirements

  69. 69
    Generic code that uses a container parameter and a lambda can still perform runtime
    _____
    through a class hierarchy.
    Hint

    The example draws objects through a shared shape interface.

    Answer

    polymorphism

  70. 70
    The lecture recommends choosing programming techniques for the problem rather than arguing over programming
    _____
    .
    Hint

    These include styles such as object-oriented, generic, and functional programming.

    Answer

    paradigms

  71. 71
    Using a vector with its size available can reduce errors associated with C arrays losing their
    _____
    .
    Hint

    This property tells a program how many elements the array or container holds.

    Answer

    size

  72. 72
    Using containers and their size can help prevent out-of-bounds
    _____
    .
    Hint

    This occurs when code refers to an element beyond the valid range.

    Answer

    access

  73. 73
    A unique pointer can provide automatic cleanup without the shared ownership bookkeeping of a
    _____
    pointer.
    Hint

    This pointer type tracks multiple owners.

    Answer

    shared

  74. 74
    Garbage collection can interfere with predictable timing because it may require a collection
    _____
    .
    Hint

    Processors may have to wait while the collector performs work.

    Answer

    pause

  75. 75
    In hard real-time engine controls, an operation with an unpredictable execution time may be
    _____
    .
    Hint

    Such an operation may violate the system's timing guarantees.

    Answer

    disallowed

  76. 76
    C++ aims to make code readable by both humans and
    _____
    .
    Hint

    The lecture's design goal names these alongside human readers.

    Answer

    machines

  77. 77
    A static analyzer can help find defects in a large codebase without waiting for them to appear during
    _____
    .
    Hint

    This is when the program is running.

    Answer

    execution

  78. 78
    Code transformation can help
    _____
    older code into safer or more modern styles.
    Hint

    This means updating existing code to use newer practices.

    Answer

    modernize

  79. 79
    The speaker identifies performance as one reason programmers use compile-time techniques instead of postponing work until
    _____
    .
    Hint

    This is when the program is executing.

    Answer

    runtime

  80. 80
    Hardware support for range checking could help enforce bounds safety when code accesses an
    _____
    .
    Hint

    This is a low-level sequence whose valid index range can be exceeded.

    Answer

    array

  81. 81
    C++ code can use arrays close to the hardware while relying on higher-level containers for most ordinary
    _____
    .
    Hint

    The lecture recommends reserving direct array use for low-level cases.

    Answer

    work

  82. 82
    A pointer to const can allow concurrent tasks to observe data without granting them permission to
    _____
    it.
    Hint

    The data remains readable but is not changed through that pointer.

    Answer

    modify

  83. 83
    C++ modules are intended in part to avoid repeatedly processing the same
    _____
    files across many source files.
    Hint

    Traditional C++ source often includes these declarations from other files.

    Answer

    header

  84. 84
    Repeatedly compiling the contents of included headers across many source files can increase compile
    _____
    .
    Hint

    This is the duration programmers wait for compilation to finish.

    Answer

    times

  85. 85
    C++ compiler vendors often prioritize compatibility with their own previous compiler versions because customers depend on existing
    _____
    .
    Hint

    This is the large body of software that users already have.

    Answer

    code

  86. 86
    The binary interface and name-linking conventions used by different C++ compilers are not universally
    _____
    .
    Hint

    The problem is that compilers may not agree on a common convention.

    Answer

    standardized

  87. 87
    One barrier to adopting newer C++ standards is that large organizations may need their code to compile with older
    _____
    .
    Hint

    These tools may not support newer language features.

    Answer

    compilers

  88. 88
    The lecture argues that modern C++ styles can be both safer and capable of generating
    _____
    code.
    Hint

    This describes improved execution speed.

    Answer

    faster

  89. 89
    A new programming language may struggle to succeed if it cannot join the existing C++ community and
    _____
    .
    Hint

    This includes the established tools, libraries, and ecosystem around a language.

    Answer

    infrastructure

  90. 90
    C++ is not intended to be the simplest language for every domain, such as simple
    _____
    applications.
    Hint

    This domain commonly refers to software that runs through browsers or web services.

    Answer

    web

  91. 91
    The speaker recommends teaching good modern practices rather than beginning and ending with outdated
    _____
    styles.
    Hint

    These are ways of writing programs that may persist in old codebases.

    Answer

    coding

  92. 92
    The C++ community may retain an unsafe old feature because preserving existing
    _____
    is considered more important than breaking them.
    Hint

    These programs may depend on long-standing language behavior.

    Answer

    code

1 of 92
Question 1 of 92

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent