What are the other new features in C # 4.0 after dynamic and optional parameters?
So C # 4.0 came out yesterday. It introduces the much discussed keyword dynamic
, named and optional parameters. Smaller improvements were implicit ref
and indexed and standard property recognition in COM methods, contra- and co-variance (actually .NET CLR, not just C #) and ...
Is it really so? Are the dynamic
optional / named params the only real improvements in C #? Or am I missing something? Not that I'm complaining, but seems a bit lean after C # 2.0 (generics) and C # 3.0 (lambda, LINQ). Maybe the language has just reached actual maturity?
a source to share
This is almost it, yes. There are some minor changes around blocking and events, but usually it won't be noticeable. For changing events, see the Chris Burrows blog series ; for blocking see Eric Lippert's blog . In short, the lock is now more secure - it uses a new overload Monitor.Enter
so that it can determine if the lock was acquired even before asynchronous exceptions. Event-like fields are now blocked, and accessing an object-like accessor (add / remove) in the declaration class will refer to the event, not the field.
This is definitely a smaller set of changes than 2 and 3, but I think this is good in many ways - I think it takes developers a certain amount of time for the current features to "stand up". Both 2 and 3 were really big feature releases ... and some of those features are still not quite clear IMO.
I'm sure this is not the end of the evolution of C #. I have some ideas, so I bet the C # team has a lot more - but there is only so much to pack into one release. While I suspect most developers won't actually use dynamic typing very often, this is a huge change in terms of the language itself, IMO is a very tricky thing to get right. I'm not surprised the team didn't have a lot of time to build many more features in the same release period.
Keep in mind that VS2010 was working too, integrating all the new features and working on some pretty significant changes in Visual Studio itself.
One thing worth mentioning is that while covariance and contravariance are certainly CLR functions - and indeed have been since CLR v2.0 - they are still language and library functions like generics and NULL value types covering the CLR, framework, and language.
a source to share