Showing posts with label you're. Show all posts
Showing posts with label you're. Show all posts

Wednesday, 23 October 2024

Behind The Tech with Kevin Scott - Trailer

>> You're going to see the future. >> In these podcasts episodes, we're going to get behind the tech. We're going to talk with some of the people that have made our modern technological world possible, and understand what motivated them to do what they did. They had a great idea. They had passion about a particular thing and they did it, and it benefited all of us in this really awesome way, and shouldn't we care about that? I think history is valuable in a ton of different ways, like helping you not get too damned excited over the thing that you've just invented that you really didn't invent because it's been invented ten times already, and if you knew that, maybe you could have saved yourself just a little bit of work. I'd love for developers of all ages to listen, so people who are early in their career to learn a little bit about the history of the industry, and maybe to get some insight and perspective on what it means to be a really great engineer. Wow, it's great that I can see this person who, in a whole bunch of ways, is like me and maybe that inspires me to go off and do something awesome. I think there are also a bunch of folks like me, where it's going to be all kinds of nostalgic. You know just, "Oh my God, I remember that." Like the walk down memory lane. What I want people to get out of the show is inspiration. I want them to be a little more informed about the history of computing, and what's happening now behind the scenes they might not otherwise see. And I think all of that's important because technology is such a huge part of all of our daily lives, that even those of us who aren't engineers should understand a little bit more about what's going on behind the tech that is suffusing our lives. I'm Kevin Scott, Chief Technology Officer at Microsoft. In my new podcast, I'll be talking with really cool people who have done and are still building really amazing technology. So sign up and tune in so we geek out this summer.

Monday, 21 October 2024

AI After Hours Profiling with GitHub Copilot

hey you're watching after hours with the visual studio team and I'm really excited about this episode because when I'm trying to improve the runtime and memory performance of my code base there's always been this really big gap between understanding the profiling results and actually improving my code uh I'm Aaron I'm a product manager for get up copilot in visual studio and we're joined by herada hi I am har I'm a product manager at visual Studios profiling team and Nick and I'm Nick kinsky I'm the dev lead for the visual studio profiler yes so today for this podcast we will be going deep dive into engineering behind the GitHub copilot features in profiling and then before that we will have a quick demo for you to set the stage so here I am in Visual Studio 2022 and the entry to AI helping in your profiling is actually the same as before this should feel really familiar because it's the the bugger it's the profiler that you know and love but wait what's this we see that there's no top insights um because previously we showed a version of this feature where you had to have a top insight for co-pilot to help you but I'm seeing now that even without a top Insight that we're able to provide assistance so R what does ask co-pilot do here yeah so this uh this is a new option which our users will have this is a Asko pilot button where users can when when user click it and co-pilot will actually use the information from the profiling um insights so they will use the top functions the hot part and other information provided they uh the copilot will also go look into the source code and then we'll generate some generic suggestions based on all these details which will help optimize your code these is more like a human readable format for your insights human readable format insights sorry yeah and then once you get to this point uh we take those suggestions from co-pilot and then we generate those top insights like you would normally see on um traces that trigger one of these top insights and then from here it gives you a very actionable issue that uh it tells you that uh what the issue is it tells you a potential description of the issue and then from there you can go the normal ask co-pilot route where you can either jump into the source code or you can just hit ask co-pilot at which case it'll take you over to the source code and then we'll ask co-pilot based on this source code based on this performance data how would you go about optimizing this method to resolve this specific issue gotcha so this is so we've extended what we offered before because now we can use AI based understanding of the overall um profiling result exactly exactly and it's almost as if you have uh what you can imagine a co-pilot performance expert with you that's actually looking at the data and trying to help guide you through to specific regions of your um application to help you optimize and get the most amount of benefit with the time that you invest here I feel like whenever I use an AI tool I always wonder how much it actually knows about my code and my scenario so we'll have to get into that more in a bit but I'm also seeing a new analyze method with co-pilot button on this call tree so it sounds like hey even if you know I don't ask for a top ins sight or there's no top Insight I can kind of Click through my call tree and ask for an analysis of my method to better understand how it works kind of explaining the code which we know is a really popular featuring co-pilot in general but also that adds the performance data that we have here right exactly and this is great if you're let's say you're working on a feature and you've gone and you've done your duty due diligence to actually go and profile your application after you've added your feature um your new feature might not show up in the top functions or in the hot path but you still might be interested in while I'm here and I'm authoring this code what sort of optimizations can I do in it well you can go and you can find your function in the call tree you can dig into it and then once you find your function you can then turn around and ask co-pilot okay we have this performance data we have this function how do I go about and optimize this even further and from there it can guide you on further optimizations you can do so before it was just hey the profiler already has a top Insight you can ask it to explain what's happening and help you make it actionable but now it's hey you can always have co-pilot generate top insights based on the performance profiling results and even if your a method or function interested in is not in the hot path you can still go through the call tree and ask for an analysis and recommendations for that exactly exactly so diving a little deeper into how this AI that we built by combining Visual Studio awareness of your program State and your profiling results with get up Copilot how does this work better than a web search and chat GPT yeah it's a great question so a lot of the web searches with chat GPT you can almost think of this as like a code review where it's looking at your code and it's trying to oide best practices to go ahead and try and optimize your code whereas what we're doing here is we can do that same review but we also have all of this performance information that we've captured so we can funnel that into the llm and we can give it so much more uh Rich context in state and we can really drive it towards these are the lines in the method that are the most expensive please Focus your optimizations here so that we're going to get the most amount of impact for the optimization that we're doing so other AIS aren't aware of this line by line performance or the um or should I say the CPU or memory usage of each line of code and with the web search it's always hey there was this message and I still have to translate what someone wrote on say stack Overflow or YouTube about this message and figure out how that applies to my code exactly exactly and it not that those sorts of optimizations are bad like we all know that repeatedly concatenating strings in a method is probably going to be expensive we should use a string Builder but now that we have the actual performance information we we know this is where you're spending the most amount of time and if we're going to focus our optimizations this is where you should focus it and then we can fill that context over to the llm as well so that when it's doing its optimizations we can really dial it down into where it's going to have the most amount of impact so when you talk about context and the context package that we as Visual Studio are sending get up co-pilot what are what did we find helpful to add to the context package so probably the most helpful part is the source code concatenated with all of the performance information so that we could really tell uh the llm you know at line 37 there is a substring please Focus your investigation on that as that is what's taking 25% of the CPU in this function and then it knows to optimize specifically that instead of potentially like a link query that's earlier that maybe that isn't what's actually impacting the time in that method gotcha and speaking with other teams we know that in some scenarios that providing too much context sometimes leads to a worse result um have you had to make any decisions about context to exclude yeah it's another great question great point is uh we tried to explore kind of the callers and the Coles who's calling into my method and then who in My Method am I calling and can we fill in the source code there as well so that we could try and give it even more context as we started kind of expanding this we found that we were just supplying so much state that it was trying to micro optimize across different methods and it really wasn't having a very um it wasn't returning a good set of results for the optimization so we've really tried to focus it down into how do I specifically optimize this one method now it is interesting to see like in the future could we get better with the callers and call E because then you can almost think we're not just optimizing a method but we could start making larger architectural um changes to your code uh but right now we just haven't been as successful with that and that's why we've really tried to focus it in and narrow it in on this one method gotcha so zooming out a little bit uh what point should I think about using ask co-pilot in the profiler do we know from user studies and other customer research um that developers prefer to use this feature at this point in their flow so right now we're noticing that it's really quick to kind of just ask co-pilot you know based on what you're seeing what do you suggest and it it's gotten to the point where we're almost considering just enabling this by default we automatically ask co-pilot because it gives good suggestions and then if you're not interested in the suggestions you don't have to follow them anymore you can keep going with your performance investigation like you were but by following some of these suggestions you might actually learn a little bit more about uh writing performant code in the language that it is that you're optimizing gotcha so it sounds like really as soon as your recommendation and what we know from customer studies is as soon as you run your profiler if you've got GI up co-pilot installed in this feature enabled that you should really try using it to more quickly help you get a good understanding of um the performance of your scenario yeah totally I think as mentioned in the start uh this is kind of your personal performance expert gotcha and so what's left to build can I use this today so this is going to be shipping in our uh 1711 exper uh release uh and so you you should already see the um ask co-pilot for the specific insights that the uh profiler highlights and then this more ask co-pilot to generate insights will be coming in 17711 uh and so you'll be able to start using that gotcha so we've talked about you know room for improvement with our analysis for callers and col e where else do we think there's room for improvement today this is still like a new experience right like I think we will get to know more firstand experience as you guys tried out and then have uh like a real real feedback from our customers and um that's what I was going to try to say if that's okay I see so so it's sounds like there's really an ask that for anyone who's trying AI features with ghetto co-pilot in profiling that any feedback about scenarios that worked really well or didn't work very well would be really helpful yes give it a try uh AI is new for everyone so we all are trying to learn here and we all are trying to see how we can make it better for and useful for everyone so yeah give it a try see and provide us the honest feedback you have right and the way we think how do you think about success here when as an outsider to this feature team I feel like success is giving is reducing the amount of time it takes for a developer to feel comfortable with the performance of their code or maybe it's the time between running your profiler and actually improving your code like how do how do you two think about this I think that those are both good measures of success my measure of success has always been how can I democratize profiling for everyone I want to really Empower any developer that's in Visual Studio to run the performance profiler to get some insights about the code that it is that they're profiling and then be able to make a positive change and improve the performance uh a lot of times we we have these kind of performance experts who are on the team who have been here forever and they know all the various tips and tricks and things to do um and performance profiling has been kind of gated Behind These experts I would love to see it where more customers are running the profiler they're starting to see some of this data and they're using co-pilot to help them learn about performance investigations and learn about other areas that they can improve the performance and so you can almost imagine a new developer on a team can take the tool they can run a performance analysis on their code base ideally they can have a quick turnaround time with co-pilot and see oh hey I can add this I can make a change here I should save hopefully five or 10 percent and then have that impact on that team soon any comments s uh like what is success to you I would say I would add to what Nick mentioned uh if uh if a new developer is able to use a profiler without any assistance you know not not even without any assistant it's super easy for them to learn from co-pilot and then use those tools and even improve the performance and overall health of their application by certain percentage I would say that's success for me as a product manager gotcha so improving performance more developers using profiling and feeling comfortable with profiling and learning from profiling sounds like pretty awesome Vision yeah okay let's see and so when we think about profiling what can you tell me a little bit about what the team's thinking about next yeah I I think one of the biggest things that the team is looking forward to in the future is this idea of being able to Benchmark various uh components of your product and then be able to uh run performance analysis on those benchmarks and then ensure that once you make those performance improvements you don't necessarily regress them in the future we've seen lots of users kind of Leverage unit tests in this way uh they have unit tests we have our profile unit test scenario they can improve the performance and then then it they have a nice small reproducible Benchmark that they can optimize and measure repeatedly and gain that performance now we want to see how do we take and deliver a similar scenario as well as then put that in place as an artifact so that users can protect that performance that they've gained and not lose that in the future to various changes in the product that's pretty exciting so looking forward to any progress on in the benchmarking space looking forward to customer feedback as we roll out profiling insights where users can click ask co-pilot for insights on their overall profile or or on a method yeah cool thanks for your time cool thank you

Add Resiliency to Your Applications with GitHub Copilot for Visual Studio 2022

let's say you're writing an application that calls out to a web API and that web API crashes find out how you can make your application Not Crash by writing some code with Copilot all right so this is the web application that we're going to make not crash it has a bunch of pizza menus on it and what this does we have one web application calling out to a web API that returns well pizzas and when I go over here and I keep on clicking refresh it refreshes pizza's just fine but what I wanted to do now is go through and introduce an error into my web API that Returns the menu of pizzas so right here as you can see I have just a minimal web API that has returning pizzas and so what I'm going to do here is introduce using some co-pilot to help me out an air so I'm going to type in a comment and I'm just going to say generate a random number between one and two because I can never remember how to use the random number generator all right and it doesn't remember for me between one and two let's see if it does it now all right so how about we just do VAR random equals new random and see if it does it here all right so now we have it then if random number is one I'm going to want to return a 503 error so all I'm doing now is setting up my web API so it returns an error every time that it's a random number generator is number one and if it comes back be number two we're gonna return good so just setting things up any copilot help me out writing that by me prompting it just a little bit all right so I'm going to restart my web application and we're going to go over to the Swagger tooling and see it air out hopefully roughly every other time that we call it coming back up Swagger that's my cart here's my pizzas I'm gonna try it out real quick execute go down here and I did I got a 503 execute 503 and now I got the 200 to come back so it's airing out roughly every now and then so we're implementing some transient errors coming back from our web API and so what I really don't want to have happen then is my web application you can see right here has crash it tried calling out to my web API got that 503 and crashed but if I refresh it eventually it'll come back up like right here because it actually got the good response back so what I want to have happen and this is the key what we're all here today to see is to make sure our web app stays up by implementing some kind of retry policy to try that web app web API again keep on going to that transient error resolves itself oh hey back to the code and so what I want to do then is right here this get menu method is the one that is responsible for calling out to the pizza service to return to menu and so the first thing I'm going to ask is I'm going to actually open up GitHub copilot chat and I'm just going to want to say what's ah good.net Library for doing retries of http error and see what it comes up for me and it says when it's done typing everything poly so I'm going to go through and bring in poly for my packages to my web project browse through the little poly you bet and as it brings it all back in I'm going to jump back over to copilot chat for just a second and it actually is going to show me something pretty neat in that it shows me how to implement knows what I want to try or wait and retry async it's already guessing by where my code is and what it what what it thinks I want to do but I'm going to save here and then I'm going to highlight the code I'm going to right click on it and I'm going to say hey ask Copilot how can I retry this code when an HTTP error occurs copilot thinks about it and then gives me a way to do it so I don't like the way that it just gave me to do it I want to actually use poly to do it so one of these things about when you're using copilot or copilot chat is that you want to Trust but verify the code that it brings back and so what it has here let me open it up just a little bit more is that if it fails three times you know go back you know while retries less than three I want to use poly I want poly to do all the work for me I don't want to have to think about it myself so let's actually do that for us let's try it one more time right click ask Copilot have Ollie create a poly policy to retry when HTTP exception occurs how about that and let's see what a copilot comes up with this time make this a little bit larger so we can see what's going on and then I'll scroll up because I want to get the menu and here we go what I'm going to do is I'm just going to copy this in topic comment on what I had and then put the new one in make sure I actually copy it from the copilot chat happy paste is very hard for me let's see if I can get it now roll C TRL V and here we go and so what it's saying you know what we're gonna try a wait and retry a sync policy first time's gonna be three seconds next time is five one second three five seconds five seconds and then retry and it's saying you know what all the pizzas that might be null here so initially I'm just going to say new list Pizza so again trust but verify so let's start it up and see if what copilot gave us works there were Bill Bears what did I do wrong new expression after the type let's see line 35. have to do my parentheses all right let's go again start everything spins up so let's try our Swagger tooling out try it out let's see we should just be getting 200 values back code 200 we should not see a 503 coming back at all but we or we should still see the 503 coming back from here because we're calling directly to the web API web API is still an error what we shouldn't have happen is our web app should be catching those and continuing on assuming that we don't get three errors in a row looks good so far let's refresh good good still looks like we fixed it all right there we go so you've seen now actually a couple good points here you saw that how we use copilot and GitHub copilot chat to introduce well we how we use it to find a random number and then introduce a random error into our code to return a 503 status code and then how we use copilot chat put in the poly nuget Library so we can have a retry policy inside of our web code to retry whenever our web API blew up but the cool thing that you saw is that sometimes co-pilot and copilot chat aren't 100 correct so you have to trust but verify and we saw that oh what a return the first time wasn't what we thought it would do or was so we went through tried it again and it did give us something that worked better so press but verify sometimes everything's great sometimes you're just on the start of it so anyways at the end of the day we got it working and so there we have it making sure our application can call a web API not fail even when web API on us blows up

.NET Productivity Tips and Tricks

>> No matter what you're coding, what project you're working on, or what your development environment even is, I'm thinking it's safe to say that everyone wants to know how to be more productive. Find out some cool tips and tricks on how to do so on this episode of Visual Studio Toolbox. [MUSIC] Hey, everybody. Welcome to Visual Studio Toolbox. I'm your host, Leslie Richardson, and today I'm joined by Mika Dumont, who is a PM on the.NET Team. How's it going, Mika? >> Good. How's it going, Leslie? >> It's going all right. It's a lovely sunny afternoon in Seattle right now. >> It is. >> Yeah. You're PM on the.NET Team, which is such a broad giant team. .NET is so huge, especially in Visual Studio world. Can you talk a little bit more about what it is that you do? >> Yeah. I'm a Program Manager on the .NET Team. My team, what we try to do is we try to make.NET Developers productive as possible, so whether that's different code fixes or refactorings, as well as different code generation, and completions, and tooling. We just try to give you all the productivity features in order to supercharge your Developer productivity. >> I love that word, supercharge. Speaking of productivity, that's what we're going to be talking about, right? >> Yeah. Leslie, since you work on the debugger, I thought that I can go ahead and start with our debugger refactoring. Let me go ahead and share my screen. There we go. The very first feature that I wanted to show, again, this is brand new. It's a refactoring where you can pin property programmatically in your code by adding this DebuggerDisplay attribute. >> I love that attribute. >> It's pretty awesome. This will also automatically generate a method, and its default return is ToString. But if I want, I can actually go ahead and have it return the first element of an array. I'm going to go ahead and save that. I had already set my breakpoint over here, and I can just debug this test real quick just to show you what this feature does. >> You already get 50 bonus points from me for starting your demo out with DebuggerDisplay or just anything debugger related, so congratulations. >> Cool. Yeah. Here, you can see that the first value is the zero index of the array, which is this little dog emoji. Without having to go ahead and manually pin these properties using the debugger UI, I can just programmatically do that in my code. I'm just refactoring. >> That's neat. Yeah. Because now, you can have it both ways. If you like DebuggerDisplay as an attribute and you want to get crazy complex with it, then you can use that, except now you can access that feature a lot better, it seems. I loved that you made that a refactoring option. Conversely, if you like debugging and you just like playing around in the Watch window, then you can use that pin icon that Mika just explored. >> Yeah, exactly. The next one since we're here, you might notice that we have a couple of these regular string literals. It's, I don't know, Leslie, it's hard to [inaudible] to say, right? >> Yeah. How do you even know what type in for that? >> Exactly. We actually have a refactoring now where you can actually convert this to a verbatim string. Makes it a bit more legible. If I want, I can also convert it back to a regular string. That's just a neat near refactoring that we just added. >> That's really nice because sometimes I might add an extra n or something, or an extra backslash and I don't know if it's actually going to work until I print it out or it goes wherever the string needs to be. >> Yeah. Now, you can just easily see what you're typing and just switch around. >> Instead of having to process it every time you go past that line [inaudible]. >> Exactly. Yeah. Over here, I do want to show you this side too. some going to uncomment this. The keyboard shortcut for toggle blog comment is control, shift, forward slash. I just wanted to point that out. Here, you might notice that I'm getting an error. If I hover over this error, quick info is letting me know that this expression cannot be implicitly cast. Luckily, we have a code fix to add an explicit cast. >> That's so exciting. [inaudible] >> Yeah. I don't know if you're familiar with just having to go and hover over to learn what the type is declared as. This will just go ahead and serve that right up for you. >> That's what's so cool about refactoring tips like that. It's just they're small but mighty quality of life improvements to me that just make my life easier. >> Yeah, it's just the little things. What else? I do want to point out, hopefully, you're pretty familiar or the audience is pretty familiar with this light bulb icon. This light bulb represents quick actions. Quick actions allows you to easily refactor, generate, or modify code with a single action. I can go ahead and invoke this by either selecting the light bulb icon or I can just type control period or alt Enter, and it will also invoke it. This leads refactoring that we have is converting a switch statement to the new C# 8 switch expression. >> Look at that. >> Yeah. It's like magic. Exactly. This will just go ahead and provide a more concise syntax without having to write out the returns in each case. >> Right. It saves you a lot of trouble. >> Yeah. It also just helps you learn about new C# language features too. It's pretty cool. I don't know if you noticed all of these XML comments over here. >> Yeah. Always fun to write whenever you need to explain what a given class or method does. >> Yeah. We actually now have a quick info style support for XML comments. If I go ahead and hover over this class, you will notice that quick info will display italics, bullets, numbers, bold, and clickable link. It's really cool. While I'm talking about XML comments over here, you can see that this DogCard is inherited from this AnimalCard class. Let's see, if I go ahead and add this inheritdoc tag, you will see that DogCard now will inherit from different base clauses or interfaces. It just depends where you want to add that inheritdoc tag. This just eliminates the unwanted copying and pasting of duplicate XML comments, and it will automatically keep your XML comments synchronized. >> Yeah. That's pretty sweet. So before that keyword existed, you'd have to remember to go back to the base class and update accordingly? >> Yeah. You would just have to copy and paste them in here if you wanted to remember. Yeah. >> Yikes. Yeah. Time savers. >> I'm trying to think what else I have that I can show you. Let's see. Here's a good one. You notice how I have comments just to remind me. I'm always [inaudible] code fixes. >> I do that too. I write demo in big bold letters to teach me. >> Yeah, exactly. >> Total natural, don't worry about it. >> So anyways, ternary conditions can be great, but sometimes at the end of editing a cell logic you realize things could be a bit simpler. There's a lot going on here. >> I always have to go on Stack Overflow and look up what does this mean again? What part is the L statement? >> Yeah, exactly. We just want to make things easier to read and we just want our code to just be easily read and consumed. So we do have this code fix to simplify conditional expressions. That just makes it so much clear. Can you believe that they both meant the same thing? >> So you mean I just spent five minutes deciphering this just to find out [inaudible]? >> Did your brain hurt a little bit? Mine did. >> Yeah. It's 2:00 AM. I'm looking at this code. >> Those are just some of the latest code fixes and refactorings. Next, I want to show some tooling improvements. This one's actually my favorite one. There's tons of excitement from the community about this one. We added IntelliSense inside DateTime and TimeSpan literal strings. So in this piece of code, I'm taking a DateTime and I'm calling toString on it. If I start typing a DateTime string literal, you will notice. >> I'm getting suggestions. >> These are completion options and explanations as to what each of these characters mean. So you can see here, this is what it looks like. It's pretty snazzy. >> So useful. >> While I am talking about IntelliSense completions, I'm missing a quotation mark, I do want to point out we also have IntelliSense completion for regular expressions. I can go ahead and just show you that real quick. Let's see. Here, I'm just going to write a regular expression. Notice how I get these completion options and explanations as to what each of these characters mean. What's really cool too is that I also get a tool tip. Quick info will actually let me know if I'm missing my closing parentheses. It's pretty smart. It's really awesome. >> This, seriously, would've been so useful to me a couple of months ago when I was writing the calendar app and writing date formats everywhere and trying to look up what format I needed to be using. >> Yeah. I actually remember that calendar app that you showed me. It's awesome. It's a great app. >> Good times, five years ago in March. >> I know. It feels like forever ago. It's crazy. These are just nice in-line experiences that we offer instead of having to go to the browser and learn how all of this works. >> Sweet. >> Yeah. Let's see. I have another tool tip. We've had change signature for a long time, where you can go ahead and reorder parameters or remove parameters, but we just recently added the capability to add a parameter. So here, I can go ahead and add the type as well as the parameter name. I can also make this required or optional with a default value and I can decide what I want to inject into the call site. I can also introduce to-do variables. This will basically put a to-do in my code so I can visit those errors and go through each call site independently and decide what needs to be passed. >> That's awesome. >> For optional parameters, I can choose to omit the call site completely. It's pretty cool. Once you select "Okay", you will see a preview of the new method signature and you will see that this is the new parameter. So it's pretty awesome. This is one of our highest requests from the community, so we're really excited to get this one out. >> That's really great. I especially like the adding the to-dos just automatically, instead of having to remember where you called this function everywhere. That's pretty nice. >> It's a pretty awesome new feature. Let's see. I have another one real quick too that I want to show. We added file header support. This allows you to add file headers to existing files within a project or a solution using an editor config. This is an editor config file, for those of you that don't know. It's a single file that documents all of your code cell or code quality options that lives at the root of your repository and can be managed by your regular source control and shared across your entire team. You can think of it as a universal way of enforcing code cell or code quality preferences across your team. >> Sweet. >> It's pretty cool. Here, we have this file header template, and you would just have to set the value to equal the file header that you'd text, that you would like to get applied to your C Sharp or Visual Basic file. This currently only works for C Sharp and Visual Basic. If you go to the first line of your file, you can go ahead and select this file header. It's pretty awesome. Not only that, I just want to point out a lot of our code fixes, and for the file header feature as well, you can really actually apply all of these fixes to your entire document, project, or solution so you can scope it however you like. If I want, I can add this file header across my entire project and it will open this Preview Changes window where I can just select or deselect which files I want this to apply to. Can go ahead and do that. You can see that it was added. If I go to other classes, you can see that was added too. So it's pretty cool. >> That's pretty cool. I'm going to add emojis to all my file headers from here on out too. >> That's the only way to write file headers. >> Yeah. Well, [inaudible] it up a bit. It seems there's a lot you can do in that editor config window in general. How can people learn more about what they can and can't do in there specifically? >> Well, we have documentation that I can always point users to. We also have for all the different code style options, you can go to "Code Style". You can just use Ctrl+Q Search over there. Here, it's a little bit easier to understand this UI that we have and you can actually see all the different code style preferences that you want and have it applied to your editor config as well. >> That's neat. >> Yeah. So if you want, you can do tabs versus spaces. I don't want to bring anything up. I know there's a lot of controversy there. So you can just enforce these code style and code quality options across your team. If you're really adamant about tabs, you can just sneak that word in there and then just push your code to everyone just have to use tabs. >> That's the dream of being a manager. You get to assert your belief of tabs versus spaces, no matter what, by accessing editor config. >> Yeah. We're doing a lot of work with this too. Stay tuned with the EditorConfig. It's exciting stuff happening with that. >> Yeah, it is. >> Yeah, go on. >> I was just going to say, speaking of exciting things coming, it feels like, I look away for five minutes and all of a sudden there's 20 new cool refactoring items added. What's coming soon in productivity land? >> Let me show you. Let's see. Some new features that are coming. The first one I can show is, so here we have, let's see which one should I show first. I can show this one. There's now a refactoring that introduces the new C# 9 Pattern Combinators. Over here, I just place my cursor and select, let's see, "Use Pattern Matching". It will go ahead and use those Pattern-Matching combinators. >> Wow. >> That's a new C# 9 feature or the Pattern Matching Combinators. It's really exciting. >> That's what it looks. >> Another one that we recently just added, so these are all coming in 16.8 PV 1. Everyone who wants to learn more about it can just check out the release notes as well. >> I think this is really cool. >> This one here, we now have a Suppression Operator Warning and Code Fix, and this helps you easily identify and fix suppression operators that have no effects. In this case, I wanted to express that something isn't type string. This operator here makes sense, but it's not actually checking for that. We have a hotfix where you can either remove the operator completely or if you want to actually check it, you can use the Is Not. That's if you're checking if it's not a type string. Yeah. >> That's great. >> Yeah. That's a new one that we just came out with, and let's see what else do I have here. We have another one where you can remove the in keyword where the argument should be parsed by reference. That's just also a quick little fix too, and trying to think what else. We have another one, let's say here I can see it, let's say, I want to just go ahead and let's see. Let's say, I want to just create a Abstract Method, let's see. Over here, you'll just notice that I have an error and that's because my class isn't abstract. We have a quick fix to also make a class abstract, and you can see here that. >> Wait, that wasn't there before? >> No. >> Yeah. >> Wow, it just seems something that would naturally be there or something but that's there. >> Yeah. Those are the latest code fixes refactorings coming to a 16th on a preview one. >> That is very exciting. There's not a bad one in the bunch from what I can tell, they all just seem super beneficial to anybody who's just coding away no matter what you're working on, which is the cool part about productivity tools like that. >>Yeah, it's really awesome, and I don't know if we have time, but I can also just show a couple on the Solution Explorer that was recently added, that are just really cool. >> Yeah. >> Okay. Yeah, here I have a test project, and it's just for demo purposes. I'm going to delete this reference. So I'm referencing my projects here. Now, I'm not referencing anything and if I want to go ahead and add a project reference, I would have to go to Add and then add the project reference. But we just added the ability to drag and drop the project you'd like to reference. Notice how this project reference is added, and it was also added underneath the dependencies node within the Solution Explorer. >> Great. No need to worry about syntax, typos, any of that? >> Yeah, just so you can just drag and drop. >> Yeah. Another last thing about with the Solution Explorer that I wanted to point out is we added the capability of copying, pasting, and dragging files from File Explorer to Solution Explorer. Instead of having to right-click and add an existing item, and we then have to really navigate to where your path already is. You can now simply drag and drop this file, and it will get copied right to your source. It's pretty awesome. >> That is so great. >> Yeah, it's really cool. Gosh. >> Are these features available in 16.8 or they out now? >> They are already available, yeah, they're out now. >> So exciting >> Yeah, it's pretty exciting stuff. Let's see. I think that's all I have today, but definitely, check out the release notes and also all of our code fixes or refactorings are at aka.ms/refactorcode. That's where you can just learn about all these new tips and tricks, then you can be the coolest person on your team that everyone goes to learn and all that. >> Just sitting in your office chair like, "Yeah, so did you know that you can now drag and drop into the solution file, I mean, I figured everybody knew, but just in case you didn't, here you go." Well, that's a really exciting. I'm going to have to make a trip to that website too, because I keep missing out on all of these wonderful refactorings that I should totally be taking advantage of, as should everybody. Thanks for being here Mika, that was super informative. I feel supercharged in my self experience, definitely. >> Awesome. >> Thanks. Again, if you want to learn more, check out the website that Mika just mentioned aka.ms/ >> Refactorcode. >> Awesome. >> Yeah. >> Sweet. With that, happy coding. [MUSIC]

Building Bots Part 1

it's about time we did a toolbox episode on BOTS hi welcome to visual studio toolbox I'm your host Robert green and jo...