Lecture overview -- Keyboard shortcut: 'u'  Previous page: Predefined generic delegates -- Keyboard shortcut: 'p'    Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 21 : 21
Object-oriented Programming in C#
Generic Types and Methods
Generic types and methods - Pros and Cons

What are the advantages and disadvantages of generic types?

  • Advantages

    • Readability and Documentation

      • More precise indication of types.

      • Less downcasting from class Object

    • Type Checking

      • Better and more precise typechecking

    • Efficiency

      • There is a potential for more efficient programs

      • Less casting - fewer boxings

  • Disadvantages

    • Complexity

      • Yet another abstraction and parametrization-level on top of the existing