Big difference between C# 3 and 4?

Associate
Joined
6 Jul 2003
Posts
2,075
If I'm halfway through a C#3.0 book which makes use of VS2008, am I at a disadvantage now that version 4 is available (with VS2010)? Should I stop and pick up a C#4 book instead?

Thanks :)
 
There isn't a huge amount between them really. In terms of the C# language the biggest difference is probably the dynamic stuff that's been introduced. You will be fine learning version 3 and then reading up on the few things that have changed in 4 though. No point throwing away the books you have already got.
 
It's just building on what's already there so you need to know C# 3.0 anyway.

---

I think I'll ignore dynamic as much as possible personally. Doesn't seem worth muddying the waters unless you absolutely have to.
 
Last edited:
I think if you're just learning you will find the 3.5 and 4.0 stuff quite difficult to understand, unless you have a strong background in other languages.

Techniques such as lambda expressions, extension methods, and the task parallel library are introduced. Extension methods aren't terribly advanced, but they're not really needed unless you're working on a large project. Lambdas and TPL are quite advanced though.
 
lambda expressions have been in C# for ages?

They were added in C# 3.
The OP mentions C# versions rather than framework versions, so the main differences between 3 and 4 are the dynamic stuff and optional parameters.

Stuff like the task parallel library is a framework feature rather than something in the C# language itself.
 
Last edited:
He's quoting .NET numbers, but within a C# context. :) Therefore both syntax/language features and framework features are relevant, as both are being released with the new versions of .NET. :)
 
TPL is just some useful threading libraries that should have been there from at least v3.0. It's funny but if you wanted to do a threaded divide/conquer algorithm in .NET 3.5 you'd have to implement your own solution to join the threads once they complete. Clearly, this was ridiculous and yes MS has fixed that now (and some) with TPL. TPL also takes the ThreadPool and adds some neat, much needed, features to it - such as concurrency level and a primitive form of prioritisation levelling of tasks.

Lambda's are just how delegates should have been since v1.0. No biggie. MS realised their mistake and fixed it.

Extension methods are just syntactic sugar to save some typing.

The dynamic typing stuff in C# 4 is powerful and we're going to start seeing more of it coupled with a reduction in the amount of Reflection code. This is a good thing really.

None of these are "advanced" concepts IMO. They're pretty standard knowledge for a C# developer.
 
Back
Top Bottom