Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Desktop Developer

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « New features in Visual Basic 10Dependency Injection Tool StructureMap 2.5 Has Been Released »
    comments

    The new features in C# 4.0

    by SQLDenis on Oct 28, 2008 in categories Microsoft Technologies, C#

    Microsoft has made available a document showing the new features in C# 4.0.

    The new features in C# 4.0 fall into four groups:

    Dynamic lookup
    Dynamic lookup allows you to write method, operator and indexer calls, property and field accesses, and even object invocations which bypass the C# static type checking and instead gets resolved at runtime.

    Named and optional parameters
    Parameters in C# can now be specified as optional by providing a default value for them in a member declaration. When the member is invoked, optional arguments can be omitted. Furthermore, any argument can be passed by parameter name instead of position.

    COM specific interop features
    Dynamic lookup as well as named and optional parameters both help making programming against COM less painful than today. On top of that, however, we are adding a number of other small features that further improve the interop experience.

    Variance
    It used to be that an IEnumerable<string> wasn’t an IEnumerable<object>. Now it is – C# embraces type safe “co-and contravariance” and common BCL types are updated to take advantage of that.

    You can download a Word document written by Mads Torgersen with a little more info here: C# 4.0

    About the Author

    User bio imageDenis has been working with SQL Server since version 6.5. Although he worked as an ASP/JSP/ColdFusion developer before the dot com bust, he has been working exclusively as a database developer/architect since 2002. In addition to English, Denis is also fluent in Croatian and Dutch, but he can curse in many other languages and dialects (just ask the SQL optimizer) He lives in Princeton, NJ with his wife and three kids.
    Social SitingsTwitterFacebookLinkedInHomePageFlickrLTD RSS Feed
    11089 views
    c#
    InstapaperVote on HN

    5 comments

    Comment from: Christiaan Baes (chrissie1) [Member]
    Christiaan Baes (chrissie1) out of 4 where already in VB.Net ;-) let's hope VB10 gets better lambda support.
    10/28/08 @ 15:19
    Comment from: ca8msm [Member] Email
    ca8msm It's about time that optional parameters were introduced, I quite liked their ease of use in VB.NET.
    10/29/08 @ 08:21
    Comment from: Christiaan Baes (chrissie1) [Member]
    Christiaan Baes (chrissie1) Is there a new features for VB.net 10 somewhere?
    10/29/08 @ 08:31
    Comment from: SQLDenis [Member] Email
    SQLDenis See here: http://code.msdn.microsoft.com/vbfuture
    10/29/08 @ 08:37
    Comment from: tanya [Visitor]
    tanya nice post
    02/18/11 @ 18:34

    Leave a comment


    Your email address will not be revealed on this site.

    To mislead the spambots.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)