Hacker News new | ask | show | jobs
by at_a_remove 1989 days ago
I have a rather dumb question about C#.

A skillion years ago I had to do a .NET project and somewhat randomly chose VB.NET as the language over C#. However, I did buy some C# books which I never looked at. Given that the books are now about a decade old, is there any point in keeping them? Has C# changed enough in the years that the language is sufficiently different from what was created in the book that I might as well pick up a newer volume?

I tend to gravitate toward stability in languages. Something of a flaw of mine.

2 comments

A lot of language features have been added over the years so you'll be missing out on some great stuff.

Also some libraries changed around a bit during the transition to .net core, so some the code in your book may not compile.

Finally, if it's a book about web dev (asp.net) or something similar (mobile dev, game dev), that stuff has changed a lot over the past ten years.

You're probably best of ditching the books and hitting up some tutorials or checking with your local library. My public library gives us access to safari books online which has a large selection of technical books.

A decade ago puts you at .NET Framework 4.0 or so, and C# version 4. A lot has changed since then. While your old books would still be somewhat relevant, you are missing out on a lot of new features in both C# and .NET. Especially since depreciation of .NET Framework and the transition to .NET 5.
To add to this, C# added async/await in 2012. Depending on what frameworks you use it may be hard to avoid interacting with it (for example, many APIs in UWP are async without a sync version). I feel like other language features added since then you can get away without knowing while writing code, but of course you may encounter them when reading other’s code.
That being said, C# 5 code can be retrofitted with most new features simply by listening to the IDE which suggests refactorings to make use of them.