
.NET Productivity Improvements [video] - zubspace
https://channel9.msdn.com/Events/Connect/2016/149
======
Anchor
Visual Studio seems to keep incorporating features from ReSharper in every new
version, and ReSharper subsequently keeps adding new features as a response.
The ReSharper developers have the fun task of combining these features into a
coherent UI.

New features in VS2017 that were already in ReSharper include configurable
suggestions from static analysis, Ctrl+T navigation (it even uses the same
shortcut), structured find references, intellisense filtering, multiple
refactorings in given scope, live unit testing and coverage (in ReSharper
Ultimate).

This is great and a bit amusing at the same time, but as a user, I like the
improvements we get.

~~~
Metasyntactic
Hey Anchor, I'm
[https://github.com/CyrusNajmabadi](https://github.com/CyrusNajmabadi) a
developer on the Roslyn team, and a primary developer around many of the new
features Kasey demo'ed here.

You're definitely correct that many of these things have already appeared in
Resharper. However, that wasn't the point of us building them. We invested in
the Roslyn platform many years ago so that not only could we share and
leverage code across all our languages, but so that other people could plug in
as well to add the sorts of enhancements they would like.

Currently, We've moved C#, VB, TypeScript, JavaScript, and now Xaml, onto the
Roslyn platform. Because of this (note that some of this is bleeding edge),
not only can we all share a common infrastructure for things like Find-
References, IntelliSense, and Refactoring, but 3rd parties can now plug in as
well and add their own capabilities.

For example, all the refactorings we've offered are ones that others could
have as well. We just happen to think that, over time, we should continually
be improving the core set we provide so that you can get a highly capable and
powerful experience out of the box without necessarily having to go install a
lot of extra plugins. Of course, if you do find plugins ( _including
resharper_ ) that you find valuable, then we want you to def go out and
enhance your experience with them.

I hope you get a chance to try this stuff out. As always, please file
feedback/issues on github.com/dotnet/Roslyn

Thanks!

~~~
yareally
Your account appears to be dead. I vouched for your comments in the thread so
they would show up. Not sure why they were dead, but you might want to contact
the staff to get that cleared up.

~~~
sctb
It got caught by a software filter, but we've marked the account so it won't
happen again.

------
sreyaNotfilc
I love this!

We all come from different backgrounds and may never have had the chance to
brush up on the best-practices of the updated code. I just bought a book
that's about 1,600 pages long on the latest ASP.Net framework. Interesting
stuff there, but it can be daunting to learn.

I love how Visual Studio is moving towards suggesting best practices for their
languages with these new features. Not only are you going to write more solid
code, but you'll also can improve and update your skill-set in C#.

I think C# is a fantastic language, and the more I learn about it the more I
want to code in it. Its beginning to be less of a "means to an end" and more
of a very solid tool for productivity code. I can't wait to use this new
version of VS.

~~~
d--b
Having coded in C# with Resharper for more than 7 years, I feel like I can't
code in any other language anymore. I mean anything that doesn't have that
level of intellisense / navigation / refactoring is just so painful to work
with for me.

~~~
Anchor
I especially cannot live without the high quality static analysis possible on
.NET anymore. So much so that any dynamic language just feels "shaky". I mean,
when you are not entirely sure you covered all method calls with that
refactoring, it feels uneasy.

Upon reflection, my code editing workflow follows surprisingly often the
results of the static analyzer: I remove a code element and let the ReSharper
figure where I need to go to make the required changes, be that variables in
one function - up to solution wide elements. Alt+PgDown - Alt+Enter is a very
powerful combination.

Edit: my goodness, it just struck me that I have used C# for 13 years already.

------
setq
Is there a tl;dw (too long didn't watch)? 12 minutes can probably be combined
into a few bullet points which is far closer to my attention span.

~~~
zubspace
Live Updated UnitTest OK/Failed/Not-Covered line indicators.

Better Exception Messages. NullReferenceException displays what variable
caused it. Inner Exceptions are somehow displayed on top level.

Configurable Code Style suggestions/enforcement.

Intellisense filters in dropdown including shortcuts (Only show methods,
properties, etc.)

Ctrl-T. "Goto All". Navigates to file or symbol, also with filters.

Find all References is now a nested, colorized tree.

All in all a nice update, cleary inspired by Resharper. We'll see how
Resharper will evolve after this. I still depend a lot on it, because it
really offers alot of features which are sub par in Visual Studio, for example
like superior refactoring options, better 'find usages', File Structure
Window, UnitTest Sessions. Things I use and depend on each and every day.

Edit: Here's an alternative link on youtube with the same video, if someone
prefers that:
[https://www.youtube.com/watch?v=TJu0hzuz9hE](https://www.youtube.com/watch?v=TJu0hzuz9hE)

~~~
setq
Excellent thanks for this - much appreciated.

I dumped R# a few years back. It couldn't cope well with larger C# projects
that I have to deal with and regularly hoses VS. Plus I spend a lot of time on
Linux platforms so I don't want to get further embedded in that ecosystem as a
mindset really.

------
topbanana
Looks like NCrunch is now built-in. I happily paid for this extension, which
is now redundant. I hope MS paid the developers for their idea!

~~~
alkonaut
How does it find which tests are relevant? How big can the solutions and test
suites be before it starts to...not work?

I have a decent sized project (100 projects, 10k+ tests, different suites with
longer running smoke tests that take hours and so on). How does it know which
tests it can run, and how does it know which will cover a certain line?

~~~
Metasyntactic
Hi Alkonaut, i'm dev on the Roslyn team, and i work closely with the group
working on LiveUnitTesting (LUT). By default LUT just runs all your tests in
realtime, as you make edits. It smartly prioritized tests based on seeing what
code was previously hit by tests.

Now, that said, such an approach would definitely not scale up to projects
with huge amount of tests, or tests that take hours and hours to run. As such,
LUT provides ways to create 'test sets'. i.e. sets of tests scoped down to
just the work you're doing. The intent is to have flexible way to create these
sets and the individual sets can be set up to run automatically or manually
depending on your preference.

A nice things is that all of these test run _outside_ of code VS. So the perf
of the tests is far less impactful on VS than it would be otherwise. i.e. you
don't have a single GC engine trying to manage all the memory for core VS as
well as whatever garbage the tests are generating. With this, and with tests
running at lower pri, your editing experience should not be impacted (and we
take perf impact very seriously with this feature).

Cheers!

~~~
alkonaut
Great answer, thanks

------
bobcostas55
What happened to integrating the Alive extension? MS bought them, shut it
down, and now they're not adding it to VS?

~~~
Metasyntactic
Hi Bob,

I'm a dev on the Roslyn team. Alive is still being worked on. :)

But making something production quality and adding it to VS takes a lot of
time.

~~~
bobcostas55
Good to know, thanks for the info. Hopefully in VS "16", then.

------
gacek
Note: the Go to navigation is available since VS 2010, you only need to set
the shortcut.

Integration of style-cop-like rules seems ok, my only worry is that all those
features will make VS sluggish. And that braces refactoring seems a poor
example. Either you are a member of your team, and you don't write code
without them, or it's some old code, that shouldn't be automatically
refactored if the refactoring is the only goal.

~~~
Metasyntactic
Hi Gacek,

> Integration of style-cop-like rules seems ok, my only worry is that all
> those features will make VS sluggish

They really shouldn't. We've actually spent the majority of our time in VS2017
on perf. So even with all the extra functionality, it's significant faster and
more responsive across the board.

One thing that helps out here is that we don't run any of this analysis in the
core VS process. As such, we are not contending for any resources that VS
itself needs. i.e. a large source of hiccups in VS was due to the GC having to
run right when a UI request was coming in. By moving this analysis out of proc
we dramatically lighten the memory load in VS and we make it so that the GC
runs less often, and takes less time. This clears up the UI thread more and
makes things much more responsive.

> Either you are a member of your team, and you don't write code without them,
> or it's some old code, that shouldn't be automatically refactored if the
> refactoring is the only goal.

Or, you're a team that has decided on new, more stringent, coding
requirements. And now you want to find and fix up all the violations. Or
you're absorbing code by a different group with different coding patterns. Or,
you just missed something during a code review and you want to go fix it up :)

If teams have a style preference, then it is definitely valuable to have
automated tooling checking to ensure the style is maintained. Otherwise you're
shifting the burden onto the team members, which is precisely what tooling
like this is supposed to alleviate.

> And that braces refactoring seems a poor example.

NOte: we've added many style options in VS2017, and we're going to continue
adding more. Options include:

1\. Do you want field/property/methods/events qualified with "this." or not
2\. Do you prefer predefined types (like "string") or do you prefer the .net
fx types (like "System.String") 3\. How and when do you use "var". 4\. Do you
want to use => for simple properties/methods/etc. 5\. Would you prefer to use
the more concise typechecking constructs over the previous approaches for
type-checking. 6\. Do you want to use ?? or ?. when applicable

etc. etc.

------
partycoder
Copying and pasting the code in the live demo really irritated me. They should
make the constructor reuse the default constructor.

