How did generics influence the design of C# and .NET?

前端 未结 4 895
野性不改
野性不改 2021-02-01 06:53

This might be a broad question but this is something I am not really clear and very curious.

Often times for certain problems I hear the reasoning that it was because Ge

4条回答
  •  盖世英雄少女心
    2021-02-01 07:43

    Generics have been around a long time and can be loosely compared to C++ templates, although the concept (and probably implementation in other languages) predates even that.

    .Net 1.0 is the first cut of a platform so the plan was to ship something that works reasonably. Generics would have to have been on the "planned future" if any decent architect was on the team, but is something that could be added later. In fact, the paper on implementing generics for .NET came out a year before .Net Framework 1.0 RTM eventuated.

    Timeline: (http://en.wikipedia.org/wiki/List_of_.NET_Framework_versions)

    2002-03-05 .Net Framework version: 1.0.3705.0 released
    ~May, 2001 Don Syme's paper on "Design and implementation of generics for .NET"
    

    Microsoft could have taken 10 years to build .Net Framework 4.0 (as version 1.0), but with so much code and so many features out at once, it would take 5 years to find all the bugs and usability issues if the project can even succeed.

    So the answer to your question would be #2.

    Don Syme primarily designed and implementated generics into C# and .Net.

    Resources

    • Language features added to C# over time (C# is the showcase language for .Net features)
    • Design and implementation of generics for the .NET Common language runtime
    • Formalization of generics for the .NET common language runtime
    • Anders Hejlsberg, lead architect of C#
    • Anders Hejlsberg talks a bit about generics

    Anders Hejlsberg is my hero - from Wikipedia - original author of Turbo Pascal, the chief architect of Delphi, later lead architect of C#

提交回复
热议问题