Updated C# V2.0 Specifications now available

After a lot of work on Anders' part, we now have an updated version of the C# 2.0 Language Specification on the website.

Not only does it have updated information on the “big 4” - Generics, iterators, anonymous methods, and partial classes, but it also has new information on a few other areas.

The biggest one is nullable types, which are a new way to creating nullable versions of value types and specialized language syntax to support using these types. There are also a few “miscellaneous” ones, the most awaited one surely being different accessability on property getters and setters.

Comments (21)

  1. On the topic of Nullable Types – looking at the specs it looks remarkably similar to luKa’s project at http://nullabletypes.sourceforge.net/, but of course with the benefit of the new ? moderator.

    Will nullable types now (in 2.0) be used in generated code (like typed datasets for nullable table columns instead of the cumbersome IsMyColumnNull() constructs)?

  2. Li Jianzhong says:

    I don’t think the Nullable Type is a good design ,although inventing it has a good reason. To tell the truth, I had been bothered by this kind of problem.

    But from the view point of one programming language, I think this hurts its chastity & simplicity (although not so much).

    If we need a built-in construct to support the database operation, why not we need a built-in construct to support the network operation? why not we need a built-in construct to support the COM+ , or AOP?

    I prefer to using a good design class library to provide the solution.

  3. How does the introduction of nullable versions of value types affect operations that previously required reference types because they might result in null? The as operator comes to mind – from the 2.0 specs:

    20.8.6 The as operator

    The as operator can be used with a type parameter T as the right hand side only if T is known to be a reference type (§?20.7). This restriction is required because the value null might be returned as a result of the operator.

  4. Luc Cluitmans says:

    Is there a list of changes since the October 2003 version of the document available?

    I noticed my pet peeve of the ‘new()’ contraint not allowing arguments was not addressed (as far as I could see), but I was wondering what things *did* change…

  5. RichB says:

    The class modifiers also lists ‘new’ as a modifier – what is this intended to do?

  6. (luKa) says:

    I like C# 2.0 nullable types spec.

    The comments on what I like, a suggestion for improvements and a comment on the Tread-off between changing C# syntax or using an external library for nullable types is in the gotdotnet forum:


    Ciao from Italy, (luKa)




  7. Keith Farmer says:

    Nifty, but now I have reason to grumble.

    So can those of us who purchased the Feb 2004 of the specs get vouchers for the final print version?

    It *would* be nice, given the lack of warning that exists on other books, that the contents were subject to a 30% increase in 2.0-related material.

    I even still have my receipt from 30 April.

  8. The Pedant says:

    Sorry to be pedantic, but Anders is a single entity (we hope), so it should be: "a lot of work on Anders’s part".

  9. Eric says:


    I’m sorry – there is no change list between the documents. I’ll see if that’s something we could do in the future.


  10. wy6688 says:

    I have asked a new feature before, named as

    property array.

    In C#, we have this [int index] as default

    property array.

    this [int index]


    get {}

    set {}


    I think it should add a name property array

    NamedProperty [int index]


    get {}

    set {}


  11. Eric Newton says:

    property array: doesnt VB.Net have that?

    The Pendant: if you’re gonna point out grammer errors, at least make sure YOUR grammer is correct: the correct usage would be "Anders’".

    I like Nullable types, mainly because I was irritated that .Net as a framework came out AFTER the proliferation of Database engines as primary storage mechanisms instead of object serialization to files of yesteryear, and since the Databases had the notion of int fields with "No valid data" ie NULL, I always felt shortchanged when I had to use an int property and set it to ZERO when the db field was null, and the semantics of the SqlTypes just kinda didnt work well…

    so bravo again on nullable types, in addition to generics and so forth!

    I admire Anders’ work… [and everybody else who’s helping out]

Skip to main content