Reputation: 35982
I got a book named "Pro C# 2005 and the .NET 2.0 Platform, Third Edition by Andrew Troelsen". I am wondering whether I should buy the "Pro C# 2010 and the .NET 4 Platform, Fifth Edition" instead. Since, the latest version of .NET is 4.0. If I learn C# based on this old book, do I miss some critical parts of the C# language? Or, I can start with this book and learn new .NET 4.0 features with other resources.
Thank you
Upvotes: 25
Views: 1278
Reputation: 8338
Personally, I think 2.0 is the right version of C# to start with. If you're going to learn the language for the first time, then starting with 2.0 is totally fine. 2.0 is the major release of the core language.
From 3.0 some features have been added which are nothing but "syntactic sugars" and "time/typing savers", and which confuse beginners, and you're gonna have to post questions here like "whether I should use constructors or object initializers".
Of course, you'll not find the new features added in 3.0 and 4.0 in a book for 2.0. But just as you said, you can always be introduced with those from other resources.
Upvotes: 3
Reputation: 71565
The major things you will want to know about that have come along since 2.0 include:
dynamic
. This allows .NET to interface more seamlessly with assemblies or native APIs written in "duck-typed" languages (where the type is always dynamic, inferred from what you're trying to do with the instance)Upvotes: 2
Reputation: 99957
You can start with that book and learn C# 4.0 from elsewhere. This is what's been added after C# 2.0:
Upvotes: 69
Reputation: 16828
I think you will be missing out on LINQ, which is quite a notable addition. If you are open to other reccomendations, I would say try Jon Skeet's C# In Depth. It gives a very good coverage of the various changes in the language from versions 2.0 to 4.0 (I purchased the early access edition).
Upvotes: 6
Reputation: 54138
MSDN has a helpful set of pages (start here) that tell you exactly what you will be missing out on when you target older versions of C# and the .Net Framework.
Remember when you target a C# version you are not just tying yourself to the language but to the matching .Net Framework - there is a whole bunch of new stuff in 2008 and then again in 2010 that you will miss out on by going .Net 2.0.
Upvotes: 2
Reputation: 9101
As well as the aforementioned Linq/lambdas etc, the later books will also cover technologies such as WPF which has pretty much replaced winforms for desktop development, and WCF which is the common communications method now, so I'd try and get a later book.
Upvotes: 1
Reputation: 17002
LINQ isn't all you'll miss. A lot of technologies that were added to 3.0 with LINQ (and largely because of it) stand on their own merits and make it very worthwhile to adopt the latest version.
I think you might be doing yourself a disservice if you cripple yourself with 2.0 if you don't really have to. The Framework is, after all, free, and so is the online documentation. Further, online tutorials abound, and you hve a plentiful resource for programming advice right here on StackOverflow.
Upvotes: 2
Reputation: 2340
You would miss most of the new technologies. 3.0 introduced WPF, WCF and WF 3.5 gave us LINQ, and other related techniques like lambda expressions, extension methods... 4.0 brought the DLR, for dynamic typing.
A full summary of new features can be found on wikipedia.
Upvotes: 2
Reputation: 13386
You can certainly start with C# 2.0 and learn the basics. There are many great new features in C# 4.0, but many of them are advanced or what are called 'syntactic sugar' meaning it's a more terse way of writing something you could already do with C# 2.0.
There are many different posts about the new features you can reference, without buying a complete book on it:
http://www.15seconds.com/issue/080228.htm http://code.msdn.microsoft.com/cs2010samples
I'd reccommend not spending the money up front, and checking out what the interweb has to offer.
Upvotes: 3
Reputation: 18972
Programming technologies change so fast as it is, why would you invest time reading such an old book? I'd get the newest one.
Upvotes: 1
Reputation: 37533
The versions of .Net are all primarily similar, but the only thing you may glean by starting with 2.0 would be to get a history of where certain changes in the languages came from. That's more of an experience thing though. If you're not already trained in C#, it would be best to start at the very latest. The fundamentals of the language will still be the same. You'll also learn the latest techniques for accomplishing common tasks rather than learning an outdated method and then having to relearn it later and try to understand the differences and why it exists in the first place.
Start with the latest stuff. Don't learn from antiquated sources and then try to fill in the gaps with extraneous information.
Upvotes: 1
Reputation: 68400
I wouldn't recommend you start learning C# with such an old version.
If you have the money to buy the new edition you should go for it. There were a lot of changes since .net 2.0.
If buying a new book it's not possible for you at this moment you could start learning the basic stuff from that book and learn new features from online resources.
Upvotes: 2
Reputation: 56391
C# 2 has generics, and it's good, but C# 3 and 4 have LINQ and dynamic typing, respectively, both of which are very powerful in their respective milieus.
And that's just to name two. There's a crap-ton more in there that you're missing out on.
If you can, always develop against the latest version.
Upvotes: 3
Reputation: 86074
You will miss a lot. Most notably in my opinion, Linq. Linq changes the whole face of idiomatic C# so much that I could not reccommend starting with the old book.
Upvotes: 24