New Features in C# 4.0 Paper, plus Feedback and Samples

Mads Torgersen, a C# PM and member of the C# design team, has worked with other members of the C# team to create a document that outlines the new features in C# 4.0. Along with Anders’ PDC talk, this is probably the best way to get an overview of what the C# team has planned for the next release of the language. I also want to make sure you know about the C# 4.0 samples. These short projects are designed to demonstrate how to use the new language features in C# 4.0. Finally, I provide a link to the Visual Studio 2010 CTP forums based feedback area, where you can comment on the new features Microsoft has planned for the C# language and the VS IDE. These forums provide a place where you can provide the PM’s who are driving the new features in VS 2010 with your valued feedback.

Here are the links to the:

Here are direct links to

Except for the CTP Feedback Forums, all the items listed above are found on the Code Gallery based C# Future site. That site provides a single nexus of information where you can learn about our plans for the next version of the C# language.

kick it on

Comments (69)
  1. You’ve been kicked (a good thing) – Trackback from

  2. Neil Stevens says:

    I know im going to start a huge debate here, but do we really need optional parameters in C#, one of the things i love the most about C# is how easy it is to read over the likes of VB and i refer specifically to optional parameters.

    I have always felt that optional parameters are ugly in written code and make it harder to read code and understand its intention, i have never liked the likes of

    M "Hello World",,,"Hello"

    For someone picking up the code, they would have to ask what are the three commas for? what parameters do they represent?

    I think (IMHO) that overloading methods is far better than optional parameters and makes the code far more readable.

    If im the only one who thinks that then ill eat my words.

    Thanks for listening

    You’ve been a great audience…

  3. Ajit says:

    What is the difference between use of "dynamic" and "var" in C# 4.0

  4. I would not worry to much about optional parameters, They will make some aspects of programming in csharp much easier.

    the difference var is unknown type you cant call members directly like you can in with dynamic types.

  5. Matt says:

    var – statically know (i.e. the csc compiler works out the type for you).

    If you decompile the result you would be unable to spot the difference between

    int i = 1;


    var i = 1;

    (it would look like the first one in both cases)

    dynamic – the compiler no longer knows what it is at compile time. Instead a variety of mechanisms occur at runtime to attempt to match the name of the method/property-or-field along with other know aspects like other parameters to the method* to an actual method/property/field.

    If you decompiled

    string s = "foo";

    int i = s.Length;


    dynamic d = "foo";

    int i = (int)d.Length;

    the differences would be massive (and the magic performed by the runtime would not be visible even then)

    Note also the cast from the dynamic result of the Length access to an int. It is possible that this is not required. The mechanisms that control the behaviour of implicit casts on dynamic is an area I have not yet looked at in detail (any anyhow this isn’t finalized anyway)

    * This bit is highly complex when you get down to the nitty gritty though in practice many of the expected simple behaviours are just like the static compilers behaviour (an intentional design decision on the language designers point)

  6. Marc says:

    I agree with the first post. If you want a Visual Basic like language, then use Visual Basic.

    C# should retain it’s purist ideals. Optional parameters look horid, and as far as I can make out have no use except for when programming with COM interfaces, and we have a workaround for that, System.Reflection.Missing.

    If the future of C# is becoming more like VB,  then I am dissapointed. VB is a mess of ByVal ByRef optonal this, end if, end this, end that that. Ouhgh!!

  7. ccalvert says:


    The simple explanation is that var is strongly typed and resolved at compile time, while dynamic is not strongly typed and it is resolved at run time. But that perhaps begs the question. I’m putting together a post that will explain this in more depth.

    For now, a great way to get started understanding Dynamic is to watch Anders’ talk from PDC:

    – Charlie

  8. zeltera says:

    I didn’t finish to completely learn the 3.5 version, and we speak about 4.0 version. I saw the "Mads’ New Features in C# 4.0 Paper", I already finished reading it and looks interesting. I like dynamics and also, I the COM improvements are welcome for me.

  9. AC says:

    I like the idea of named parameters. Code becomes less sensitive to parameter reordering, and it is also easy to read. Easier on code generators too. Is it really needed though? Need to read more on that.

    I don’t like the idea of default parameters.

    We already have a mechanism for that. It’s called method overloading.

    You could also argue with extension methods client code doesn’t even need default parameters, because client code can, for lack of a better term, ‘monkey patch’ 3rd party classes.

    public static int FooWithDefault( this MyClass c, string s )


     return c.Foo("default1", "default2", s);


    c.FooWithDefault("Hello") is better than c.Foo( ,,"Hello")

    It was (maybe still is) a nightmare in VB.

    Even worse, when the MyClass changes it’s defaults, perfectly working, compiled client code no longer works as it might have. (The same can happen with overloads)

    dynamic – I didn’t like the idea of at first, but have done some reflection stuff in the past, and reflection code is messy. dynamic as a reflection 2.0 is cool (when not abused).

  10. Sadek Drobi says:

    We need better type inference in C#. Currently type inferrence in C# is really poor compared to F# or Haskell!

  11. Silas says:

    Im concerned how intelliesense will work with dynamics.. I mean, since the compiler at design time does not know which type your object is, how will intellisense react to the potential garbage method you write? Maybe they’ll show the appropriate method available if the name is unique to the imported libraries?

    And yes, Im as concerned as everyone else with the optional parameters.. if one wants VB, one should use VB.

  12. ccalvert says:

    One other quick point I should make here. This syntax for optional parameters is not valid in C# 4.0:

    M "Hello World",,,"Hello"

    You can only use named parameters, you can’t use this comma based syntax. The reason for this decision was to keep the syntax as clean and simple as possible. So the call above might look something like this:

    M(Title: "Hello World", Caption: "Hello");

    Which I think is fairly clear as compared to the empty commas. Here we name the parameters we want to specify, one being Title, and the other being Caption. Then we put in a colon, and finally we list the parameter we want to pass in, which in this case is "Hello World" and "Hello."

    Again, I’ll write more on this in a separate post.

    – Charlie

  13. Denny says:

    As a former Lisper, I absolutly have always wanted &optional, &key parameters with defaults.  BTW, I also want real macros…

  14. Amitabh Ojha says:

    I dare say C# 4.0’s support for dynamically typed objects is leading to VC#A.



  15. jQuery/ASP.NET/ASP.NET AJAX/ASP.NET MVC Visual Studio patched for better jQuery IntelliSense . Yes! Steven

  16. Herve says:

    I’m concerned by the fact that they try do everything (and more) in C#. It seems that it will be very difficult to understand at the end. I’m OK for the .NET framework being able to cope with dynamic languages, but why adding a dynamic keyword to C# ? C# was not designed to be a dynamic language at the beginning, hence the need to add this keyword maybe ? true dynamic languages do not have this keyword, and they don’t need it !!!

    People are always wining about Java beginning to be complex (with all these libraries in the core JDK), but I’m curious to know what they already think about C# 3.0, and what they will think of C# 4.0. Maybe all of this is a matter of marketing after all 😉

  17. water says:

    The C# langauage changes too faster to we learn it hardly.

  18. Regarding the first post: we (at DlhSoft) have developed multiple products in C# basically because we have more C# experienced programmers. However, in some cases, we ended up with as many as 20-30 overloaded constructors (or methods) simply because in C# 3.0 we didn’t have optional parameters. I think it’s a good thing to have this in C# too, as a gain from "co-existence" of C# and VB .NET. It’s not like "we will use VB .NET just because it has optional parameters", especially when we have a lot of experienced developers using C# already. It wouldn’t be productive at all. And therefore I agree that purism/idealism should be sometimes defeated by practical reasons. Sorry guys…

  19. Charles Garnler says:

    What about ‘break twice’, or break(n), to break out of several nested loops? I’ve written too much such code either using boolean flags (which increases the line count without adding any real functionality) or some gotos (for too long that’s been the way all programmers have had to do it). The ability to specify the number of times to break a loop at the language level could actually be extremely useful, and I don’t know of any language that supports it.

  20. David C says:

    Sorry but I have to agree with the first commenter and others – just say "no" to optional parameters in C#.  We do not need a language that "holds our hand" so much.  There is already a .Net language that does that, it’s called Visual Basic.  I’ve worked with both languages quite a bit and I very much prefer the conciseness and, as another put it, purity of C# over VB’s verboseness and hard to read ugly code.  I love you guys at MS, I really do, but I think you are missing the mark if you put optional parameters into C#.

  21. Optional Parms says:

    Some seem to forget that C++ has optional parameters.  I know of many of the developers that I hwave worked with that are looking forward to them being added to have the feature more like C++.

  22. atakavci says:

    ok , now i know there is someone else who feels like c# 4.0 is ‘com and/or VB’ oriented c#.

    yes,, dynamics is good way to avoid reflection mess, and code may look elegant.

    and variance seems handy.

    but i think optional parameters and named parameters are subjects to argue.

    does optional parameters feature seem to an effort to stand close to former VB developers.

    quote from Herve

    "Maybe all of this is a matter of marketing after all 😉 "

    i believe optional parameters and named parameters will end up with less readable code on our projects and everywhere on internet (may be it also belongs to us as the people who aware of the situation).

  23. silashansen says:

    yes, C++ has them, but only as the last optional parameter, which makes very much sense.

    Means you can do:

    M("foo", "bar", "now");

    M("foo", "bar"); //default 3. parameter: "now"

    but not

    M("foo", ,"now"); <– really guys, this is ugly which is why C++ probably didnt implement it.

    I could tolereate that C# implemented it that way also as it keeps the method calls clean to look at, except last parameter. Going with the named parameter hell will add too much garbage overhead to the code.

  24. Jesper says:

    silashansen: Yes, that’s ugly, which is why C#4 doesn’t support it. Read up. If you skip parameters, you have to pass them by name, which preserves clarity.

    The reason default and optional parameters are both useful is because if you have a bunch of methods that can take more or less parameters, you will soon be drowning in overloads since it may be practical to have different combinations of the parameters use their default value.

  25. llorrac says:

    As a development manager, I applaud the decision to include optional parameters and named arguments. I have never understood why the architects of C# felt it was better to be forced to write, test and maintain multiple versions of the same rountine when a single version woud do the job. I recognize overloading is useful in may circumstances, but there are also cases where it makes the developed code more difficult to understand, test and maintain.

  26. Guy kolbis says:

    There are a few new features coming out in C# 4.0. I gathered some posts that will help you to &quot;get

  27. Seablade says:

    I have to say that all of you should get over the optional parameter angst in C# 4.0 and quit making such a hullabaloo over it.  I’ve programmed with Visual Basic for many years (and still do) and C# for the last 4 years and I welcome the change.

    Let’s face it:  if you don’t like optional parameters and named parametes, JUST DON’T USE THEM!  If you’re a manager and really want to stick it to your underlings, forbid its usage!  It’s as simple as that.  I don’t understand all the hoopla surrounding this simple feature.

    I prefer method overloading where the methods really do very simple tasks, but I’ve had to write numerous overloads for a method where the only call inside each overload is to a core method.  I really would have rather written a single core method where it made sense and provide optional values.

    All of C#’s changes and VB’s changes are to bring them to essentially the same technological level and this is a most welcome change; I work in a shop where both languages are used extensively and it’s really hard for my fellow VB programmers to use the technology that I use and conversely I the same when programming C#.

    Just get over it.

  28. Michel says:

    Charlie, what i would like is something like property pointers. AFAIK that’s not possible now.

  29. Will says:

    Most of the features in C# 4.0 are already there in VB.

    Sounds there are really few things to improve for those languages.

  30. int19h says:

    There is a very simple example to demonstrate why optional & keyword arguments improve code readability. Compare:

     new MemoryStream(data, 0, buffer.Length, true)


     new MemoryStream(data, index: 0, count: buffer.length, writable: true)

  31. kemal erdogan says:

    Am I the only one here to recognize that the most significant change is the inclusion of covariance of generic type parameters!

    It will make generics a lot more useful tool and finally allow us to make them part of our APIs as they are polymorphic now

  32. Dmitri says:

    Personally, I am somewhat disappointed with this new set of features. There’s nothing here that one would go "woo-hoo!" about, compared to C# 3.0.

  33. Peter says:

    I am new to programming. I have started working with c# 3.0 with .Net Framework 3.5. I am discouraged by the fact that a new version of teh language and new version of .net framework is coming out soon. Shoud I wait until teh new langugae debuts and then start my learning path? Or should I Continue with my learning with current standards.

    Please advise.

  34. int19h says:

    Peter, you should understand that new versions will keep coming out probably with the same rate (.NET 1.0 was in 2002, 1.1 in 2003, 2.0 in 2005, 3.0 in 2006, 3.5 in 2007, 3.5 SP1 in 2008). If you will wait for the next version to start learning, you will never finish 🙂 In this industry, you have to be able to pick up the new stuff as you go.

    But, anyway, the majority of the .NET Framework remains, and of course everything that’s in C# 3.0 will still be in C# 4.0, and heavily used as well… so you’d have to learn it one way or another – and then, why not start now?

  35. ice says:

    Any chance .NET 4.0 will have the ability to turn background compilation on/off for the C# users? It would be nice to have the option at times to utilize it. That’s about the only thing I miss from VB even though it is not optional there and would at times drag my system with VS 2003 but it didn’t seem too bad in VS 2005.

  36. Avi Farah says:

    I saw only one request for break(n).  I do like the Java way of breaking from nested loops where the loop is labeled and you break from the specific labeled loop.

    This is the only place I will use a goto where you look for a 0 in a matrix of numbers.  You need to break from a nested for (row..) nested within for (col..)  Having break(n) or break label will plug this hole.



  37. silashansen says:

    break(n)-like feature would be greatly appreciated too!

  38. int19h says:

    Guys, there’s nothing wrong with goto to break out of a loop. It’s not an Inherently Evil Statement. It’s a wrong tool for many jobs, but breaking out of nested loops isn’t one. If you want labelled break just so that you won’t have to write "goto", then you should pause for a moment and consider the reasons for your phobia 🙂

  39. A while ago we announced Visual Studio 2010 and C# 4.0. In case you’d like to catch up and read articles

  40. David Jacobson says:

    The new features will be very useful to anyone who wants to use C# in combination with the HTML DOM, Javascript, or COM.  Those purists who are not interested don’t need to use them.

    However, there is one significant part of the story that has been skipped over in the presentations that I have seen.  That is the issue of passing delegates to dynamic code to be used as callbacks or event handlers.  Virtual Earth seems to be a favorite example.  But a C# to VE interface will be pretty limited unless you can call VE with C# methods that will be used by VE to pass back results or to handle VE events.  I assume this point has not been overlooked by the C# team.  So I am a little puzzled why nobody seems to be commenting on it at all.

  41. Steve Adey says:

    I can see the nice clean new implementation of optional parameters.  Method overloading is not always possible.  Take the following:

    Foo(string str1, string str2, string str3)

    you want 2 overloads, one to set str1 and str2 and one to set str2 and str3.  How you going to do that with overloading?

    This can only be achieved with optional parameters.

  42. John Marrone says:

    Steve, you are so right. I have run into this so many times I have had to change the methods name to get around it. Heck, if you don’t like optional parameters don’t use them.

  43. [Incoming semi rant]

    I too am against the idea of optional parameters.  To the person that complained of 20 or so overloaded constructors, that’s what you’re supposed to do.  Methods and constructors should have a single minded purpose and enforce a contract to the outside world.  If you include optional parameters on a constructor then you open the object to be used in scenarios where the contract isn’t full understood.  Optional parameters need to be accounted for in the body of the constructor and that means the constructor will have multiple uses, under multiple conditions which isn’t using proper encapsulation and polymorphism.  The black box this creates is problematic for consumers of your objects.

    If I had what I wanted in C#, I’d like polymorphism to be name/type aware instead of just type aware.  I’d like to be able to declare a method A(UserID int, …) and A(CompanyID int, …) and have the compiler recognize that these are two different methods.  Today that doesn’t happen because of the way the call stack evaluates methods in polymorphic scenarios so I am left writing AforCompanyID(ID int, …) and AforUserID(ID int, …) which of course removes some of the benefits of polymorphic behavior.

    Please note, I want two seperate methods in my example.  I want two methods that each implement a specific piece of my object’s contract with the outside world.  What I don’t want is A(UserID int, CompanyID int, …) because that’s not readable and it black boxes a switch statement that increases the method’s dependencies throughout the application and is not visible to the object’s consumer.

    Optional parameters, like anonymous methods and functions invite developer laziness and don’t work well in a corporate environment where code standards matter.

  44. dcf says:

    Derek, I see your points to some degree, but at the same time I’m not sure I can completely agree.  If done right, optional parameters with the proper defaults can make code more readable and easier to code.  And with intellisense you, as the creator of the method, can impart more knowledge about how the parameters are used – which ones are critical to the function of the method and which ones can be defaulted out.

    To your point on having two different methods with the same name, but different first parameter names, I can only see chaos from the point of maintainability down the road.  Consider the following use:



    Which one of these is the userid? and which is the companyid?  Sure we could say:




    But do I really want to do all that typing?  Also, in spite of all these new 4.0 features, I think the authors of .NET Framework Design Guidelines would have something to say about method overloading and parameter positions…Shifting the meaning of the a parameter position (regardless of new language features) just seems like a bad idea in general.

  45. The problem space in and of itself is a tricky one to solve. It either involves what I was talking about or optional parameters.  Neither solution is elegant and both have their own related drawbacks.  I guess I am ok with the way C# evolves as long as I can continue to use C# in the typesafe, non-optional-parameter based world I and my developers have been accustomed to.  Honestly, the situation does not arise that often for us because most of the time the issue can be worked around relatively easily by changing the design.  What I don’t want to see is dynamics used everywhere.  I’ve been there.  It’s called VBScript and that’s partly how SQL Injection attacks were born.  Developers not understanding the type of variable they were working with and thusly not knowing when to protect said variable from certain attack vectors like SQL injection…

  46. Steven Behnke says:

    There is a small typo on page 3 of the document.  Under the heading: Dynamic Operations in the comments of the following line

    d[“one”] = d[“two”]; // getting and setting thorugh indexers

    Through is misspelled.

  47. Paul says:

    hmmmm… i think if you need 20 constructor overloads on a class then optional parameters arent going to save you from a completely horrible lack of design or thought about what you are doing… sorry but that’s just insane. Would you prefer one constructor with 20 * n optional params? Uggh!

    That said, i was always opposed to optional params (esp of the ,,, syntax variety), but the way it’s been done in c# 4.0 isn’t too bad. Personally i prefer overloading because of the neatness it provides when cascading the ‘optionals’ down – but we’ll see. At the end of the day,  if you design your systems and classes properly in the first place, optionals should really pose few issues, even to purists.  As an example, think in terms of parameter objects, (wrapping params into one single object and passing that) – we can use class initialisers already which have similar name/value syntax to optionals, so optionals may actualy be quite helpful in terms of creating strong ‘Message’ Types for services and hard to break contracts.  It’s all about design – if you don’t think through the code you write then optional params (or lack thereof) really arent’ going to make a difference.

  48. Paul says:

    ps.. the example of the memory stream from int19h is case in point why something that might of seemed nasty in the past, isn’t actually all that bad. Excellent example.

  49. llorrac says:

    Perhaps it’s the code I develop but I would find as construct like — if (name in {"Fred", "Tom", Mary"}) — extremely useful. I realize there are several ways to do this using the current syntax but don’t feel any are quite as compact or clear from a documentation perspective.

  50. I’m just prepering for a presentation of new features in VS 2010 and .NET Framework 4.0, so let me give

  51. How about the ability to alias class and method names? That would be very useful to most of us who cannot invent proper class and method names as fast as we need to deliver the code. Here is a contrived example of what I find myself doing.

    public class SomeClass


        public void DoSomething() { }


    Several weeks later after the class has been compiled into an assembly and the assembly has been referenced by everything else I find myself inspired ti rename it properly.

    public class ByteCounter


       public void CountBytes() { }  


    Rebuilding the universe leads to all kind of breakage because the SomeClass has disappeard.

    So why not correct bad naming like so:

    public class ByteCounter aka SomeClass


      public void CountBytes aka DoSomething() { }


    The compiler could surely recognized the old names and issue some warning so that subesequent correction can be made at some later time.

  52. pss says:


    I dont mean to be rude, but after a few minutes, or even after a few days, you should already know what the proper name of the class your writing is. More often than not, you should know the class name before you even start the code.

    As for the optional parameters, as previously stated, if people don’t need/want it, then they shouldn’t use it. To me it just makes C# more flexible by leaving out the defaults. It isn’t exactly the same as overloading either.

    {end rant}


  53. Sam says:

    To me, named optional parameters would be incredibly useful.

    It is ludicrous needing to have 20 constructers, when all you are logically trying to achieve is perhaps 5, but requiring 4 permutations of each (just for the sake of having to manually code in your optional parameters each time).

    And not only does it make it less maintainable, it becomes a lot less friendly to use, and find the version you are after.

    I think the frightened belief of those against this feature, stems from the fear that only one constructor would be created and with say 10 optional arguments. Therefore, there is no logical guidance of which parameters should be exclusively, required in combination. This discipline, I think belongs to partitioning and modelling the constructors correctly.

    Also, I believe the code should reflect as strongly as possible, the subject matter of the object, and not mainly lines of a bunch of copied and pasted constructors.

  54. Bart says:

    I don’t get the rational for introducing VB-like features into C# and vice versa. These are 2 different languages and attempts to make them similar will, at best, create two languages that are indistinguishable. And at worst, create 2 languages that appeal to neither VB followers nor C# followers.

  55. int19h says:

    For those in the "overloading is better than optional parameters" camp – why not just treat optional parameters as a syntactic sugar for hand-writing all those 20 overloads? In which case, how is it any better or worse?

  56. Goran says:

    Has anyone remember Clipper? That was almost  20 years ago.

    1. Garbage collector,

    2. code blocks (exactly as lambda expressions),

    3. optional params as proposed in C#4 (except possibility to have empty one; just commas)

    4. macros as in javascript

    5. array assignments and access like

    arr = { { 1, 2, 3 }, {obj1, obj2}, "str1" }


    6. type change in runtime

    a = 1

    a = "str"

    Maybe some things breaks strong type definitions, but there were lot of good stuff.

    I understand that it is really hard for C# to draw clear line and not to spoil langugage.

  57. HI GUYS,






    Suppose there was a Bakery Owner and a Customer(myself).

    Now Suppose, I was accustomed to or like to eat Pizza daily in that bakery. And after sometime the owner of the bakery want to attract more customers or want to provide more items in his bakery, so he introduces a new item called Burger which was not available before in this bakery and suppose I do not like burger.

    1. Do you guys mean that I have to smack down the owner for selling burger in his bakery because I only want to eat the pizza and don’t like burger?

    2. What about other customers who want to eat a burger instead of pizza ?

    3. Why can’t I only eat pizza in that bakery and never eat the burger. There was nothing ambarrassing to have an extra item in the bakery.

    4. The only situation I have to argue with the owner is, if he removes the item pizza from the bakery and replaces it with burger.

    5. If he is providing both pizza & burger in his bakery, why should I or anyone bother or argue with him. Myself or any other customer can select their own favourite and should feel happy for having the option to select any of these items to eat rather than having only one item which we should always eat.













    Sriram Naresh Akula (Working on C#)

    (Team Lead, Slash Source Technologies, Hyderabad, India)

    My contacts:


    Visit my Homepage:

  58. Parveen says:

    Specifying the argument with name in method call is going to be an excellent advancement C#. Its like wish come true for, as I was dealing with a function in library where there were 3 Overloads for the same method and VisualStudio intellisense is nightmare if number of argument is more than 4-5. Kudos to C# team.

    On a different note

    I am in line with  what Neil said above. Optional parameter is like going back 4 steps from where C# started.

    VB language supported this feature and that time I thought it’s just a backward compatibility support for VB6 developers in VB.Net. As in OOP overloading is way to go achieve the same. I have faced issues in VB.Net when you create WebService (Now WCF) methods with optional parameters. I consider using optional parameter is a bad practice even in VB.Net.

  59. Sidhartha Grover says:

    If I wanted to waste my time ever while developing a project I would use VB.NET with its horrible options like Optional Parameters. Then again, i someone likes using them they can use VB.NET and be happy with it. But this is the B@st@rdization of C#. C# is finally making its mark in history and wil get spoilt like this. Why dont some of the greatest languages with the C syntax like C++ and Java dont have optional parameters? I’m sure others would be feeling the same…

  60. bmx says:

    The new features seems really nice, but it’s kind of hard for me to tell as the docks are posted in the docx format of all things. We are on the web theese days, and you guys seem rather clever, so I do hope to see a html vertion of your future documents 🙂 There are just no excuses to deliver documents in such an mediocre format, as not all of us has jumped on the Office bandwagon. The only alternative for me is the openoffice tools, and they are …less then satisfactory… I find.  But keep up the good work on the framework guys! (but please up the ante on the docs 😉

  61. K Ray says:

    For all of you ranting about optional parameters being new to C# v4.0…  Just remember that optional paramters have been in the language since v2.0 (although only used with custom attributes).  So this is not a new feature, just a new application of an existing feature.  

    I am not surprized about this change, nor the syntax.  It seems to be a logical improvement.  It also simplifies some problems with COM interoperability.  For some, this is a much needed improvement.  

  62. Wyatt Wong says:

    I love the optional and named parameter ! The optional parameter recalled the days when I use C++ and the named parameter have been available for years in VB and finally in C# ! The use of dynamic type in the example of COM (e.g. automate Excel) is a great feature, but it seems to be a bit LATE (well, I should say RATHER LATE) since on one hand, Microsoft had released the Office 2007 XML document file type and encourage people to use them instead of using COM to automate Word/Excel, but on the other hand the dynamic type for COM is telling the developers that – hey folks, you can now automate Excel through COM easily in C# 4.0 by making use of the dynamic type, and forget about the Office XML document type ! It seems to be a contradiction !! But nevertheless, I hope that IntelliSense will be provided when using the dynamic type to automate Word/Excel App !

    Last but not least, recalled the days that it was a total failure to Borland Delphi 4.0 and Borland C++ 4.0, I DO sincerely hope that the number 4.0 is NOT causing another failure to C# !

  63. mastermemorex says:

    I think that optional parameters could be a good improvement, because I frecuaently face that problem of having 20 constructors and 20 methods that do the same thing, but nevertheless it is not my highest priority.

    On the other hand dynamic type would be confusing, source of bugs and as far my main  concerns is performance, I will stay away of that. Furthermore, most of dynamic type issues can be more elegantly and efficiently imlemented if C# allows struct inheritance, field interfaces and operator constrains.

  64. ben says:

    Really miss Spec# non nullable reference types would remove ALL those if null checks for collections etc

  65. I like thes site

    Thermal paper rolls, ATM thermal paper rolls, colored thermal paper, printer ribbons, POS printer supplies and credit card supplies. offers a full line of POS thermal paper rolls, printer ribbons, point-of-sale printers, credit card paper rolls, laser labels, barcode scanners, credit card sales slips, cash register ribbons, ATM paper, kiosk paper, cash drawers and other paper related supplies for your business including shopping bags and can liners.

  66. I like this site

    Thermal paper rolls, ATM thermal paper rolls, colored thermal paper, printer ribbons, POS printer supplies and credit card supplies. offers a full line of POS thermal paper rolls, printer ribbons, point-of-sale printers, credit card paper rolls, laser labels, barcode scanners, credit card sales slips, cash register ribbons, ATM paper, kiosk paper, cash drawers and other paper related supplies for your business including shopping bags and can liners.

  67. devil says:

    I find that I am interested in the part of barcode scanner:…/vbnet_barcode_generator.html

    This is something on the contrary.

  68. Debbie says:

    I'm confused with what is stating here but I just want to know if this product is same with what this site offers?

Comments are closed.

Skip to main content