Attended Microsoft VS 2017 launch event in Portland last week @ViewPoint, and was impressed by some new features presented in VS 2017 and mainly in C#7 framework.
In VS 2017, performance and productivity are the two main areas that you would see quite-a-bit improvement. Comparing to VS 2015, installation of 2017 runs significantly faster. You would experience much faster start-up time and smaller memory footprints. Its new live unit-testing and exception helper features will make your debugging experience more efficient. On the navigation side, its new ctrl +t super-find feature would allow you find any text in your files or jump to any line of you code with this single keyboard shortcut. Super cool!
For C#7 framework, below are the enhancements I really like -
1) For exception handling, now you can chain exceptions together so that while it is captured, it would show you the original trouble-maker in pop-up screen without having you dive into the inner exceptions. A great time-saver!
2) For functions, now you can return a new type tuple. I love this feature since there are times I want to return multiple values with mixed types as a quick dump. The tuple option is quite handy so that I would no longer need to write a structure/ class for that purpose.
var (x, y, z) = myFunction();
3) Fakes - In unit test, we've learned to implement dependency injection to inject mock objects through interface. With fakes, it allows you achieve the same objective with less code and more flexibility. One example demoed at the event is to do a unit-test based on current date. Use a fake date would make your test results more manageable. Of course, Microsoft cautioned you about not over-using it. Similar to TypeMocks, while you try to fake something, it means that You trust it so that this fake itself is not tested.
4) Nested named-functions - if you are familiar with R, this would be nothing new to you. Yes, now you can do nested named-functions in C# too. The main difference between this and delegates is readability.
Overall, this was a very good event with great speakers! I really enjoyed it!
No comments:
Post a Comment