Contents    Page-10    Prev    Next    Page+10    Index   

Dynamic type checking:

  • A: has significant runtime cost but adds flexibility
  • B: has no runtime cost
  • C: always has a high storage cost
  • D: can and should be made illegal in a good programming language
  • E: has little use in practice

    Answer: A

    Dynamic type checking can impose a factor-of-10 speed penalty. Static type checking is best seen as an important kind of optimization. However, if a language does not provide dynamic typing, the programmer will invent it by adding a type variable to a record.