Part 3. C# 6

C# 6 is one of my favorite releases. It has lots of features, but they’re mostly independent of each other, simple to explain, and easy to apply to existing code. In some ways, they’re underwhelming to read about, but they still make a huge difference to the readability of your code. If I ever have to write code in an older version of C#, it’s the C# 6 features that I find myself missing most.

Whereas each earlier version of C# introduced a whole new way of thinking about code (generics, LINQ, dynamic typing, and async/await, respectively), C# 6 is more about applying some polish to the code you already have.

I’ve grouped the features into three chapters: features about properties, features about strings, and features that aren’t about properties or strings, but this is somewhat arbitrary. I recommend reading the chapters in the natural order, but there’s no big buildup to a grand scheme as there was with LINQ.

Given the way C# 6 features are easily applicable to existing code, I recommend trying them out as you go along. If you maintain a project that has old code you haven’t touched in a while, you may find that to be fertile ground for refactoring with the benefit of C# 6.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset