开发者

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

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 Generics was not available in .NET 1.0. That makes me think either of these 2 开发者_Python百科things:

  1. Generics was not thought of before, so the developers came up with it after .NET 1.0 which could drastically affect design of C# and .NET but couldn't because of decisions already made (backwards compatibility).

  2. Generics was always planned since the beginning, so the only problem that arise from not releasing it with .NET 1.0 was not being able to use it till 2.0. But other than this, no redundant features were introduced or wrong, irreversible decisions were committed.

I mostly assume #1, but is #2 is the actual case?


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#


I'm almost sure that generics were envisioned from the start. Full well realizing that the job was going to be considerable. The project was headed by Don Syme (of F# fame), his first publication about the design was dated January 2001. The CLR is presented as a given, the paper documents additions to the MSIL, although at the time .NET 1.0 had not shipped yet. That took another year. All and all, it's probably fair to conclude that it took them close to 4 years to hammer this together into concrete shipping software.


Don Syme, the designer of F#, was partially responsible for .NET generics.


if you're interested in the history of c# if check out channel9 and this video in particular

they have done a number of interviews with Anders Hejlsberg about this kind of stuff

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜