[Music] hello everybody and uh welcome to this last session of the day the last session before the big celebration is happening somewhere behind us here in a big room and um I'm very very happy that you have chosen to share this time here with us today because we're going to talk about some cool tips and tricks for visual studio right productive developers are happy developers and this is very important stuff so we want to make sure you have a good time I know you kind of want to get to that celebration get some food get a drink maybe so let's have a good time let's have some fun and if you have any questions please post them to the usual place online we got the Jim and Vera sitting over here and Matt and Andy sitting remotely helping to answer the questions as we go along and if we have time at the end we can take some of the uh the bigger questions at the end of the session here so um let's just get to it all right so here I have a project oh look at this hang on oh you know what it is look at all my tool Windows it all looks like a mess here what happened was that before I plugged in up here I had my laptop plugged into like a large monitor that's really wide so I had all this room for Tool windows but now it looks kind of all crammed in so let me just uh fix that real quick there we go or as I like this here fresh car smell this is my favorite uh way to start Visual Studio in the day Windows minimized oh very very nice and I can just go between all these layouts here all right here's my wider screen layout here's my web layout and here's my fresh car smell so this is not a new feature I'm showing you here I'm doing this with a single keyboard shortcut to move between all these it's called saved Windows layouts the reason I want to show you this is because I know we got data on this that you don't use it so what you do is that you create all your tool Windows you drag them around you put them in the location you want maybe multiple monitors you have solution Explorer on one side and test Explorer on the other whatever it might be and then you go to window and just hit save window layout when you do that that gives you a bunch of all your saved layouts you can give them any name you want and very easily you can change between them so that's what I did with all the keyboard shortcuts here Ctrl alt and then you know one two three four five however many you've got so a little tip to get started all right so this project I Got Loaded here it's a web API project asp.net and it has swagger so it renders this UI when I run it in the browser that's what it looks like so I can see all my endpoints but Visual Studio has never really had that ability for me to really quickly get a glance of what are the different endpoints that I have in my app so if I do my saved window layout for my web workload see I don't just have a window layout for each monitor configuration I have one for the different types of apps I'm building so when I'm in web mode here I want to show the new um endpoint explore shows up here so this looks pretty much what we saw on the Swagger UI I get to see all my endpoints here can take this let me just drag it up here there we go so that's kind of nice and I can even open all these different um these are basically routes right my endpoints I can see what file they belong to the methods I can navigate through them by clicking on them and so on but what if I want to make an HTTP request to any of these so let's go down and look at the contact endpoint here I'm going to right click and I can also generate requests click that and it's going to create an HTTP file dot http This Is A New Concept in Visual Studio it's not the new a new concepts of the world an extension for vs code and a few other editors support this format but what it does it allows me in plain text to send requests let me just zoom in here a little bit so check this out it creates a variable at the top to point to my local host and I can just hit the play button and it will now send an HTTP request and return it right here so because this is an HTTP file it's just a text file on disk I can check this into my source control so my team members can see how to use my API or our API but also I can use it as documentation let's say I have an open source project or something like that this file can now act as documentation on how to use the API and um oh let me get my explore I think back here let's do another get request here I'll just right click another one of the end points here this is one that returns for certain ID let's do ID number two and hit the execute here and now we can see we get just that one request or sorry that one record back um but I can also make a post I can make anything here and you see these green pound signs or hashes those are the delimiters between the different requests I'm sending but I can go in here and see now I want to do a post request so I'm going to say well oh content type application Json all right and then I just need to give it some Jason I got something right here copy that in oh I just want to make sure you can see it here we go so I'm going to make a post request to this particular endpoint and I'm going to pass it in a HTTP header and a request body and executing that super simply gives me this just a confirmation pack and if I now get all my records again we can see that I now have oh did I not send it correctly maybe not ah is that right all right it's here there we go thank you everybody so now as I'm building up my HTTP file here I'm documenting my API and I'm making something that my whole team can use to test new things you know to test the API that we're building so really really handy and what's really cool is if some of you are using vs code some of you are using visual studio and whatnot this file works on all the different editors they all understand this format all right but speaking of testing what if I want to test something that or I have a mobile app talking to my API and it might be a colleague of mine that builds that mobile app and that colleague wants to test something that I'm doing on my laptop here on the API how do we take a mobile app from one person's desktop and connect it over to my API on my localhost well typically that's not really been that easy there are some products out there that can help with that you have to pay for them but now you probably have heard this we have Dev tunnels and so I can go up here on my play button and go to Dev tunnels and I can create a new tunnel let's give it a name how about build we can then say should this be temporary or persistent like how long should we keep this Dev tunnel alive let's just do a temporary and what about the security of this should be just private organizational or public let's do public so now I've created a tunnel and I'm gonna here's a confirmation you've created a tunnel yes thank you so now if I run the app again Ctrl F5 it's going to spin up that same swaggering as before but this time it's going to show me a confirmation you are about to connect to a developer tunnel and then some sort of URL and we can see I get the exact same UI here but it's no longer a local host it's this other thing and just to prove that I'm not cheating here if you want to you can point your camera that you're at that QR code right there and see if you can hit this because remember we did a public endpoint uh so you should see the exact same thing on your mobile device okay I'm gonna just grab this URL and I can go back to my HTTP file and paste it in right here okay so now I changed my URL and if I hit the button here I'm now creating a request toward the public API and it works just fine right because I have a death tunnel that basically connects the public internet with my Local Host right here so if I build web hooks or viable apis for mobile apps or if I have any other scenario where I need someone else or some other system to connect to my machine do I want to test maybe I want to test whatever website I'm working on on my phone to see if it renders correctly on a mobile device I can now do that super easily and not only is it easy it's free so that's very very nice [Applause] all right so so that was the endpoints the the web server endpoints but what about the code that generated them so here they are this is what it looks like um web API this is what web API looks like nowadays and you know I don't necessarily know how this works I remember back in you know.net framework with MVC and so this looks a little bit different to me than I'm used to and you probably know this when you're working with apis that you're not you don't know if you're using a new nougat package that you haven't used before you don't know how to use that API that it provides or if you're new to a team you don't know how that team writes their code right so if we look at this code here there's something called group dot map post right here I don't I'm not sure what that means so check this out if I just hover over this API okay I got to be faster look at the bottom I'm sorry I can't scroll this but at the bottom it says GitHub examples and documentation I'm holding the mouse over the method called map post okay this is an API method so I'm not going to click this and it opens up a new window right here assuming just check the scroll bar this is a long list of examples of other apps using this API in all sorts of different kinds of ways there's really a lot here I can learn a lot by doing this like what did I have to do before I had to go read documentation right well if there was documentation but now I get to see how people are actually using it right here and it's so clever that it even knows about the different overloads for this particular method and it can give me all these examples what's really helpful to me here what I really think is really cool about this direction is first of all in order to provide relevant examples the AI engine in Visual Studio understands the context that my code is in so when I hover over something it understands what that code is there for and can therefore give me relevant examples but last year a survey came out I think this is even more interesting a survey came out that found that the average developer codes for 52 minutes per day the rest of the time goes with reading code reading documentation code reviews you know email meetings and so on so all the time we spent reading documentation wouldn't that be nice if we can kind of get that back and we can code some more so instead of 52 minutes we can get 50. eight or even more and that's what this helps me with this has saved me several times already I've used this for a couple of months now in our internal bills and it's now all available here to everybody so I'm very excited for that one all right let's um let's add a new folder to this project so you know how you add a folder you right click oh go down to add new folder right that's how we do it so recently we added a new thing that instead of doing that I can do add new item but you know add new item let's do the keyboard shortcut what's the shortcut for add new item shift F2 okay there's someone here that knows what I'm about to show it's Ctrl shift a add new item and we get this little thing up now this doesn't look like that add new item thing the add new item thing looks like this that's what I'm looking for normally right but it now has this compact View and so if I want to do a folder let's call it folder I'm just going to end it with a slash and hit enter and immediately that was created there okay so some oh all right I'll take it thank you so what's this Ctrl shift a does it always gets you back to the view used before did you use the compact view or the full View but if you're like me I always want the compact view first regardless of whether or not I use the full view earlier and so what someone was saying shift F2 always gets you to the compact view regardless and from here oh I can do some other cool things I can create a what if I create two files foo.cs followed by I bar.cs now I got two phones super easy well what if I want to create a subfolder or a file inside a subfolder that doesn't exist I can do SUB folder slash .cs and now I have that file so I can comma separate I can create subfolders I can create folders super easily here I'm very excited for this feature um this was one of the highest voted for extensions that existed that you voted for us to put in the box so it's finally here and um I love it but how smart is this thing so this was the bass class here's the foo class it's a class how does it know it's a class I just gave it a file name well because it maps to the templates that was in that big view the old add new item dialogue you know we have all those templates it is clever enough to map file extensions to what is probably the most likely template that you want in this case a class but what about that I bar file that we did it's an interface yes exactly because naming convention right all right bar makes sense so this thing is pretty clever and um and that's cool I want to show you something else that's really clever this is another thing that um I think it was until we added this no more than I think two weeks ago the second highest voted feature that we add and it goes like this what is the difference between enthusiasts and I bars yes or in another way how do I find out what the difference is well now I can right click one and I can compare with any file on disk or I can select this for compare so now I take I bar right click that and can say compare with food.cs because that was the one I just selected and doing that gives me the diff View [Applause] yeah finally sorry for the wait it's now here and this is just the first um the first feature we have of this uh we're going to look at much more comparison between files and clipboards and all sorts of things that have to do with file comparison and different going forward this is the first one that landed uh and it's in the the latest preview release all right I'm going to shift over here to a different project different instance of Visual Studio here I have a bigger project loader I think it's two projects actually in this solution and I got a bunch of stuff open here you know I'm gonna I don't even know how many files I got open so I'm just going to start by clicking up here next to the tabs and say show tabs in multiple rows oh yeah thank you so now I can actually see all the tabs that are open [Applause] um but I just opened this project or this solution rather and you know if I'm working on something if I'm working on a solution I'm working on a task and I'm not finished with the task but I have to go home you know in the afternoon I'm not closing Visual Studio I'm going to I leave it in the that stated it's in so that when I come in the next morning I can continue where I left off but for all the times when I don't need to continue where I left off let's say I'm done with the task of the day I probably closed Visual Studio and then when I start Visual Studio again in the morning and I open my solution I don't want this I don't want it to open to the state I was in yesterday so this might not be true for you this is me okay I don't want this because I want the fresh car smell this is not fresh car smell it has everything open and notice solution Explorer everything is expanded okay so what happens is when I open this solution in Visual Studio then says oh let me hydrate the state that this solution was in the last time it was worked on from disk into memory and then on the UI thread expand all the notes in solution explorer that means nothing else can happen we can't paint anything else on the screen at that point while that runs and then we're going to open some C sharp files which means we have to load all of Roslyn we have to load the language Services the colorizers all those things who says I'm even going to open a C sharp file that might not be what I'm going to do right now so I'm going to go to tools options and under project and solutions there are two check boxes that are there unless we remove them one of them is called reopened documents on solution load and the next one is restore solution Explorer project hierarchy State on solution load that's a mouthful going to remove that too and click ok so let me close the solution and I'm going to open it again okay one two three click and there it is so very very fast solution load here because no state was hydrated by reading a file on disk into memory onto the UI thread okay and fresh car this is wonderful foreign I got two quick ones to go notice the top it has like this orange Banner if I go back to the other solution it had a green Banner what's this about well I'm using an extension here and I want to mention this not because this extension is particularly awesome which it happens to be particularly awesome but because there's so many cool extensions out there and I want to make sure that you know about that we have extensions I think you needed to be reminded sometimes that there's thousands literally thousands of extensions that can help us be more productive and this one is called solution colors and it allows me to give any color to any solution including if I'm working on the same solution in two different instances of Visual Studio but different branches they can have different colors because I can sometimes have a hard time differentiating between the different open instances of Visual Studio again and check this out it even puts that color down here in the windows jump list or taskbar so I can very easily navigate between the two all right so the last thing I want to show you I gotta have to be fast here is um code cleanup and code cleanup profiles so again it is not the newest of features but I know that you're not using it okay so I want to draw your attention to this this is cool this little thing down here that looks like a Duster or broom or something it's called code cleanup and I can configure code cleanup into two profiles by default it just has a few fixes included but I can take all the available ones and we got a lot now I'm going to hold down shift so that I can select multiple here move that up click ok so now what I'm doing is that I'm applying all my coding standards that I have configured either in my settings under Tools options or if I'm a team I probably have an editor config file so whatever wherever I get my coding standards and Coach styles from I can have Visual Studio apply this super easily so let's take this file as an example I can now hit Ctrl ke and my entire team's coding standards are now applied really really quickly so about 20 of code reviews go to talking about code standards and coding Styles and so now we can get that time back because I can do that very easily here I can even set it up so it happens automatically on Save okay I don't even have to invoke this manually and speaking of of getting ready for code review we have some brand new features in Visual Studio 2022 for working with git and to demo some of that I want to invite my friend Jesse on stage to show some of the really really cool and new things that we have available Jesse all right awesome hi everyone my name is Jesse and I'm the product manager for the Version Control team in Visual Studio we know that you care a lot about productivity and we want to boost that productivity while you're using git so my goal is to show you how we've made Version Control easy and efficient by allowing you to do more in the IDE and minimize distractions that take you out so to set the stage for the demo we've made some changes and I've already opened the get changes window here so let me make that a little bit bigger I've got some changes in my resize file and my enumclass and I'm going to start preparing my commit so there are two GitHub issues that I care about in this scenario the first one is actually tracking the work that I'm doing on this project and the second one I was tagged in by a colleague because they thought it was relevant to my work so as I start typing my commit I'm going to use the closest keyword when I complete this pull request it's going to go ahead and close that issue for me so I don't have to worry about it that's nothing new but then I want to reference my GitHub issue and what you would need to do is go out into the browser copy paste that issue ID or look up and find exactly what you're looking for but if you had a good idea of the title or the name of that one you can use our issue search so if I type the hash button I get that list of all of my recent issues that I've been tagged on I can use keyword search to narrow down my results and I can find exactly what I'm looking for without leaving Visual Studio yeah it's pretty awesome the other issue that I wanted to reference let me do that quickly and I'll use the button here which does the same exact thing let me narrow that down grab that and you can see that both of these items were added to my related item section and if I wanted more context I can right click and open these directly in the browser so I'm realizing this is my last commit that I want to make before completing my pull request so just to avoid any surprises happening in the pipeline I'm going I'm going to go ahead and rebuild my solution now we've all been there where a build starts and it might take a while to run we might be tempted to leave Visual Studio go check teams or catch up on email and we heard that it's a blocker to not be able to do your git operations so we've enabled staging and then committing all while the build is running so I can continue doing my git flow while the build is still going on and you can see that happening below all right let's look at my git repository window I've got some updates in there that I want to share so I've clicked on the view all commits button that's my preferred way easiest way to get there and I want to draw your attention the graph here is nothing new but we did add some UI enhancements to Aid and readability and what I want to show is the multi-branch graph that we've created so I mentioned that I'm creating a pull request and I'm going to do that against the develop branch so let me just click on this eye icon and visualize that and now I can see exactly how my commits stack up between my branches whereas before I'd have to wait till I made my pull request and get that view in the web so now I'm all prepared to create my PR right away awesome another great thing about the multi-branch graph is that it makes me really confident when I'm performing complex git operations now if I was asked to cherry pick a bug fix for a branch that I worked on a while ago I'd be fumbling between stack Overflow trying to find the right command and then the right commit ID so that I didn't make a mistake and mess up my reap up so with the multi-branch graph I can just visualize that bug fix Branch let me scroll to it really quick and then I can right click here and then if I want to make doubly sure that this is the right change I can double check that in my commit details and now that I'm confident I'll go ahead and just click cherry pick I've got the banner to let me know that was successful then I can scroll back to the top of my feature branch and just ensure that that's exactly the right bug fix I wanted to apply that was so much easier than having to go track down the right command to do that cool so you figured out all of the commits that you wanted to add to this PR the build ran successfully and now you're ready for that last step which is creating your pull request so I'm pushing my changes and I'm greeted with that Banner that lets me know that it was successful and then you might be familiar with this link today if you tried it out and clicked on that link it would take you out into github.com or Azure devops or wherever you were creating that floor quest in the web but we heard from you all that it's pretty silly to be able to complete 90 of your workflow in visual studio and then have to leave to do the last 10 percent so I'm excited to share the new pull request view in Visual Studio which allows me to finish creating that right in the IDE so it's got everything that you might want I'll go ahead and quickly create my pull request it's not going to be terribly descriptive or interesting but you guys are going to do much better than I am and then I've got that same issue search available here and I can go ahead and create that pull request and see it by refresh available on GitHub right there so these are all the features that I wanted to share in the time I had today but they're only a fraction of the updates that we've made make sure that you're downloading the latest preview of visual studio and engage with us on developer Community these were all different requests that came from you all and it's what allows us to make such awesome features so I'll give it back to meds but enjoy the rest of your build thanks yeah that's some good stuff um and uh everything you saw here so far has is currently available except for the last PR the pull request thing it's coming very soon so during the summer here or winter if you're on the southern hemisphere I guess but soon let's say um other things we talked so we talked a lot about like things that you're requesting us to put into Visual Studio new features all this stuff and the thing that comes up all you know all the time of course is performance and um it's hard to demonstrate performance in a setting like this so I just want to make sure I had a slide to let you know that it's something we actively work on we have a lot of Engineers that work on this it's their full-time job and we have made some great strides 17.5 came in um it's the version of Visual Studio 2022 that we shipped in February it had a bunch of improvements if your.net developer um check out the new build acceleration if you haven't already you're going to cut your build times uh by 80 it's like a huge win there's a whole lot of other things solution load is eight times faster if you have those some of those big solutions that really need that extra boost um solution closed which is interestingly enough is actually a thing who thought that that would matter but it does and it's now faster and so is the profiler I want to I want to call out the profiler uh for two reasons one is you're not using it and it's fantastic it lets you find performance issues hot paths reliability issues very very easily in directly in Visual Studio it instruments your running app and it can give you all those answers and we've been making so many updates to it that it's better than ever and it's really can answer those hard questions about performance and reliability and it now generates the results three and a half times faster for me that has actually meant I can make it part of my inner loop so when I write Visual Studio extensions for instance I can run the profiler just that I would like run my debugger because it's now so fast it's not something I have to think of doing later on it's just something that's part of my inner loop and it makes my code stronger um all right so all this stuff is um of course we continue work on performance so uh 17 6 we've released a week ago 17 7 preview one has even more stuff um so go check out the latest and greatest uh 17.6 if you're on the release Channel if you're on the preview Channel get 17.7 and the extension I showed you was called solution colors if that has any interest all right so three weeks ago I think Dante something like that we had a blog post coming out about a topic that turned out to be really interesting to all of you and so we thought we can't do build without showing you and talking about this particular subject and for that I want to invite my friend Dante on stage to do exactly that Dante thanks France so my name is Dante gagne I'm one of the product managers of visual studio and I'm in charge of the UI refresh so as mads mentioned we published a blog post about the UI refresh that we've been working on and yeah I want to come up here and show a little bit about what we're doing so I'll go ahead and show you what we're looking at and basically if you've been looking at visual studio and saying to yourself you know this looks like a UI that was designed uh like a decade ago and the reason is is because for the most part it has been it's been a while since we've had a new refresh and we decided it's time to do a new one and this isn't something that we take on light light mostly because the UI in Visual Studio this is something that affects every single one of us it's something that we're going to be looking at every second of every hour that we work on visual studio and that's more than the 52 minutes we spend coding it's really all your time is going to be spent time so we want to make sure we get it right we want to spend the time and make sure it's going to be the UI that it's going to be more comfortable and it's going to be something that we're going to enjoy working in and our guidance is we want to make it the most accessible and approachable UI that we've ever had now I'm not gonna go through all the design principles I'm going to encourage you go up to AKA dot Ms slash vs fluent that's the blog post that we put up there and it's got all of the principles and everything but what we're doing this time we really want to work with our community we want to work with you to make sure that this is the UI that we're ready to work with some folks who have been working with visual studio for a while might remember some of the UI that wasn't necessarily accepted quite so well and we want to make sure that this time it is what we want and let me show you what I'm talking about here what I'm showing on the screen now the top toolbar is the toolbar that you've got right now in visual studio if you've got 17 6 or any of the more recent ones that's what you've gotten below that is one of the toolbars that we showed in that blog post this conforms with some of the web content accessibility guidelines of larger controls that make it easier say for people with a motor disability to be able to click on those controls and make sure that they're not misclicking larger controls reduce cognitive load make it a little bit easier for people to use it a lot of things like that that adhere to the fluent UI design guidelines a whole bunch of other things like that but the feedback we immediately got from our developer Community is it's a little bit too big so we went back and said you know based on the guidelines that we're working with and based on the community guidelines or the community feedback that we're getting can we take all of that into account and below that I'm showing the next Generation mock-ups that we're working with so we're iterating on that feedback and we're iterating on our design principles and we're moving towards a UI design that we feel is going to be more in line with what we're trying to reach that accessible and approachability and at the same time taking into account what our our community what our developers folks like yourself what's more important to you and that's how we're approaching this UI refresh we want to make something that is going to be what we are going to be spending a lot of our time doing in the days and years to come here's another example the document tabs these ones again the top one is the document tabs that you're used to and the one below that is the one that we showed in the blog post and immediately we heard people say don't take any room from the coding window please don't take any room from the coding window okay how what can we do with that one how can we change the things and the bottom one was showing one that took quite a bit less room from the coding window and in fact one of my designers is showing me a new mock-up that she was just working on that actually gave one or two more pixels to the coding window but still adhere to those design principles that we're working with and all of these things that we're doing are coming from feedback from the community now I've already had a couple people asking me when are we going to get a chance to look at this and the answer is I don't know right now because we don't we're not ready to make this available in the previews until we're making sure that we're listening to the feedback from the community and we're taking that all into account we've got time we're not in a rush to put this out because we want to be very deliberate for this refresh before we're rolling it out so we don't have a timeline on it we want to take our time and we want to get this right and the way we get that right is with engagement with y'all and getting you all into the conversation so I do want to encourage folks once again AKA dot Ms slash vsfluent that's the blog post and we're going to continue to engage at vs fluent we're going to continue to be working with developer Community I know mads and uh Jesse both mentioned that as well that we're working with the community and we're really serious about that with UI refresh here please join in the conversation and we're going to continue to iterate on that with everybody there so um with that I look forward to talking with folks more about it and I'll hand it back to men's thank you thanks Dante all right so we are at the end of uh this session and I want to just take a moment and say thank you so much for coming here I know it's just before the celebration and you're probably thinking when does he shut up so I can go stand in line I understand but before I let you go uh I just want to say it's been a privilege to be here on stage with these two fine people representing the visual studio team and show you some.net things some some Visual Studio things and as you know there's a bunch of different sessions here at build about Azure and all sorts of different uh topics and if you want more visual studio and net it is super important that you tell us and the way you tell us is to fill in one of these session surveys like give us a good rating here in the comments let us know you want more visual studio and Dot net for future conferences whether it's build ignite or whatever it might be the powers that be listen to that stuff so please help us out and uh cast your vote so to say thank you so much and see you in Celebration foreign
Wednesday, 23 October 2024
Bring AI and ML into Visual Studio with IntelliCode - Visual Studio Office Hours, 57
good morning everybody and welcome to this week's episode off the visual studio remote office hours my name is max Kristensen and I am delighted that you are joining us here today because we have an exciting show for you we're going to talk about machine learning and artificial intelligence intelligence rather inside visual studio because we actually have some inside visual studio and what does it do how does it help us and what will it do for us in the future these are all great questions that we're going to look into now I will give you a little update on my home office because I kind of do that every time here's my latest little gadget that I bought this is a USB speaker you can see there's our cable here that is just up on my pegboard here on the my work bench so if you go there's a picture of what it looks like today this morning so if you go check out my Twitter you can see what that looks like but this is basically like a ten dollar USB speaker and it's a hell of a lot better sound let me tell you then then sort of a laptop slowly getting into a more professional estate here in my very unprofessional home office so with that out of the way let's say hello to our two guests and so Katie why don't you start by introducing yourselves hi my name is katie and i am one of the program managers for visual studio in tellah code i'm looking forward to this conversation today awesome and mark hey yeah i met you and i have worked together for a long time I'm a program manager I've been a program manager on Visual Studio for like 12 years something like that now I don't know I'm getting too old and now I'm working with Katie as a program manager on the Intel akkad team been at this for like two and a bit years now and thoroughly enjoying it so looking forward to chatting with all the folks about what we can do with AI fantastic yeah I think mark I think the first time I met you you were the program manager for the visual studio editor just the editor itself that built with you know syntax highlighting and intellisense and all that sort of stuff so this is this is quite some years ago I guess so for the people that are online please remember that you have on your right side of the screen you have a Q&A panel so that means that you can ask us any question you like anything for mark and Katie about machine learning and AI inside Visual Studio but you can ask any question about Visual Studio and you know with three people here that works on the visual studio team there's a good chance that we were able to answer that so just keep the questions coming and we will answer them as we go along okay let's get into it so mark I know that you're on the year while you're both on the intel eco team and i've heard a lot about Intelli code I think I know what it is but every time we talk I learned that it is more than I think it is it happens every single time like it's expanded the role of the machine learning is is doing something I didn't even know that it used to do and stuff like that so things are moving quick it seems like but what is in Teleco can you kind of give an overview of what it is and how we use the machine learning and AI yeah for Angelica glad to do it I mean you know I've been at this I say I was looking back a bit yesterday and realizing that I've been playing this game now for two two and a bit years working on Intelli code and we first previewed some stuff way back in 2018 a build but we've we've really kept the same focus all the way along right so from the start we were looking at ways that we could use the power of the machine to delve into your code as data and the things wrapped around your coders data and present back to you based on the kind of wisdom that it harvested and distilled down some useful insights right some useful insights that can actually help you to do your job in in a more effective fashion and so when we talk to customers when we talk to developers we found that you know there were various areas where there were struggles in their you know their development life and they for instance you know they might say well I'm coming at an unfamiliar API I really don't quite understand how to how to use that API but I could really use some assistance or actually and and this is a conversation we've been having more recently i'm reefa miller izing myself with an api i don't quite know what to do you know i'm really trying to get myself back up to speed again whilst using this thing and i want to be effective and so that got us into thinking about how can we do better in terms of not just the completionist but other places too in terms of presenting the right stuff to you so helping you code with confidence right so that you can actually get right into something and the machine can help you out by presenting the things that you're most likely pattern choices right so the power of pattern is really a big theme across the whole of intel acade right that machines can do stuff now can delve into patterns that they were simply not able to do a few years ago okay and all of our code and all of our things around code what I kind of call code metadata all of that stuff is like a substrate there's a big scientific word for you but you know just a place where things can grow or where we can grow that insight and and bring it back to you right so that's that's really the the founding insight was that we believe that that machines can grab grab those insights and bring them to you at your point of need and then we talk about you know how that can help you out when you're trying to find issues so think about anti-patterns think about things where you your your team has done a great deal of work perhaps to to go ahead and fix some problem that's actually a common auntie patent that keeps coming up in every single flippin code review and it drives you nuts and what about if the machine could spot those patterns and put those fixes out there for you so that you didn't have to keep reminding everyone in every single code review that'll be neat wouldn't it and so we talk about that as being kind of how we can help you find issues faster and then we talk about focusing your review so you heard a little bit yes there about how is code reviews can become messed up with a whole bunch of repetitive tedium we were looking at ways that we can relieve that pain as well but all of this it comes down to the capacity of machines to learn huge things across giant substrates that would be really hard for a human to learn and bring those useful insights back to you right you need them that kind of makes sense yeah I think that's that's really helpful so you know it reminds me like 10 years ago when I first started on working on Visual Studio at Microsoft I had this white board in my office and at the very top I had written in big letters the thinking IDE and the idea was that an IDE should be sort of anticipating your next move and make that as seamless as possible and it was sort of a pipe dream and it was more like a vision or more like a Northstar to shoot for but what you're talking about is seems like that it seems like a way that we don't have to deal with this sort of trivialities or the mundane things of programming we can go straight to solving the problem that we were hired to do and there's worry about like I guess like formatting and other such things in a code review that seems trivial right exactly so and and it doesn't have to be restricted to the trivial either that's the thing so you know these can be reasonably complicated things I mean we got some stuff to show you later that's that I think you'll find fun that will help you find actually cut complicated things and repeated patterns that you know you maybe wouldn't even have had time to spot and might have bitten you on the posterior later on and you know that's that's something we we want to make sure that you know we let the Machine loose on that kind of stuff as well so it's not so much just the the mundane and the repetitive but it's also the stuff that is too big for you to wrap your head around because you just don't have time right and we'll talk a little bit about that yeah maybe a bit later when we talk about suggestions all right so that makes good sense so it's both the mundane and the complex so mmm when when Intelli code first was introduced he was it was doing something in my intelligence it was augmenting the analysis and in the beginning I didn't really know what to make of it like I I it was you know my cheese got moved something changed the intellisense had looked a certain way for like maybe two decades or something it was different so what happened there and how how did how did that solve problem how do how do I guess I my big question is how and why did you do two intelligence of what you did and can you explain what it was that you did okay sure I don't know if you're still hearing me okay cool so yeah so what what we did was we actually learned and trained on open source repos and we learned just like the common usage of various classes and what you're seeing sort of as you see those autocomplete pop-ups is you're seeing sort of what it what are those like top views or most used or commonly used types or or functions or methods for that class so it really allows and enables developers who may not be quite familiar or might just forget or not recall what is the right function or the right method to use in a certain circumstance it allows you to sort of provide it provide you with sort of contextual method recall as you're typing so this is very very helpful for a number of scenarios so imagine if you're a developer who's just onboarding to a particular class or namespace this really just sort of gets you sort of helps you sort of assist you as you're as you're typing is also super valuable for even those more seasoned developer who might have not used a particular class in a long time or might just be you know not super familiar with like an internal library for instance with one of our other features team completions and sort of gets you sort of set without having to navigate to the web or have to navigate to stack overflow you just have everything at your fingertips okay so that's really cool yeah the it seems like being able to figure out how to use something based on how other people use it is pretty much what we do when we go and Google something right and or we go to stack overflow to find out like how do I use you know this method and this class from this library that I just installed but now that's just that's just right there in my intellisense list and that's and that's all coming is that all from github or is there any other sources to that and how do how do and how do you determine what sources to choose from okay so we determine which sources to use so there right now are our base completions model which you're seeing you know as you start typing in digital cedar versus video code that is based off of open top open source repos and so those are the repos that hope have over a hundred stars so we we've done a couple things so we've trained our completions model based off of this learning of these open source repos so like seeing these top repos and just learning from those but we've also sort of curated that learning so we've we've actually it's a supervised learning model where we're we're actually like saying which ones are the top even within those top repos what are the top most use types or classes within those repos to ensure that you're getting the contextual usage not just sort of like the methods or properties that are used just broadly they're getting sort of like a more intelligent or more catered sort of experience or tailored experience so I guess to answer your question Mads this is what we're providing for the user is not just sort of a comprehensive dictionary of methods but sort of providing them with the right methods the right properties to use at the right moment and when they need it so we don't want to provide you everything we sort of want to just provide you what we believe you'll actually what will be useful in order to enable you to be productive at the moment when you're trying to use it okay that makes sense so I don't know maybe it was like a year ago I came to I came to you mark and I said hey you know visual studio extensibility is a kind of a complex set of api's so if you've ever tried to rewrite a business to do extension you know that all the you guys there maybe not so well documented and it can be hard to find out exactly how to use them so I went to mark and I said hey can we can we in takes a bunch of sample repositories and github and other apps that use these so that we can give better intelligence using those machine learning models for all these API and and Mark was so kind to say of course and you know what did it take two weeks or whatever and boom it was there in the product and everyone benefited and we actually made it so that Intelli code was now I optional but recommended component when you installed the workload for Mitchell three extensibility so I think that was an example where we took we saw there was an itch problem granted it's an itch it's not the biggest space in the world right Visual Studio extensions but we were able to like tailor and optimize the machine learning for that so mark is that possible if people run their own nougat packages they have some users of those newbie packages can they also ask that you indexed to improve their users experience for there is that a thing well there's a couple of answers to that question Matz and you know I want to start from the top one of the first things we kind of heard from people when when they started to use these that these new starred in Telus and suggestions was exactly what you've said it's like hey you know I use this library or that library right but it's not super common right just exactly like what you were talking about with these extensibility not you know it might not reach the bar of being in enough of the open source github repos for us to pick it up and the in what Katy was referring to as our base models right so how can we solve that problem and for some libraries absolutely where there's there's usage out there we're happy to hear from people and ask your asking us to put certain library sets into our base models and that can be a very effective thing for us to do if we know where there's great samples to be had right so we can train on it pretty much any github repo if it's open and so if we know it's important you can point us at it and we can go at it and do exactly what we did for the various extensibility space but I think I'd want to ask Katy to talk to us a little bit about some of the things that are going on for cases where it might not be something that's for everybody but when it's more about your own internal code bases and you've got internal classes and stuff like that right so that's the other problem that comes up right once people get hooked on this stuff right and what we what we've heard from people is that they kind of like getting these stars but they were upset that they weren't getting them for other classes they were commonly using sometimes those other common classes are actually in your own code and and Katy I don't know do you want to have a bit of chat about what we're doing for that sure mark yeah so so what mark is referring to is a feature that we call team completions and so as Mark was mentioning you can currently get Intelli code start completion suggestions for like from the base model just as you're typing so it's sort of predicting what you're gonna say what what's next but that's based off of common usage and that common usage as Matt and I were talking about earlier is based off of training on open source repos or the top open source repos but what if you're working in an internal library or you're working on code or tight or four types that aren't commonly found in open source repos so what do you do and so for us we have now enabled team completions and team completions not only like augments that sort of base completions model that Mark was referring to with your custom types that it automatically also shares that with everyone who has access to your codebase so so that is the super cool part of like let's say that you're working on in a git repo and I want to train a team completions model so I get dice so I can get those start completions for my own types well once you do that training you've also shared that with with the rest of your team automatically anyone who has access to that git repository automatically gets all of those the start completions for those unique types which i think is is super super cool so yeah I think that combined with the context of your code you can just imagine as as you're typing and as you're developing you're starting to not just code faster but you're also just sort of being assisted along the way so you can sort of stay in that developer flow with having these start completions okay so if I have an open source library for instance or a nudey package that people are using can I then do this team completions for my own for my own set of API so whatever that I've developed and then whoever has access to my github repository will also get the benefit of those completions is that is that what I hear Katey repository let's be very like it will be specific so for right now we've enabled this for just get repositories and so it fits on github or if it's an azure dev ops and it's a it's a get based repository then yes you can have a manual training and then that once that that manual training that team completions model will be attached to that repository and shared with the rest of your team however there was a part that you talked about a nougat package and that's something that we have on our backlog and we've been thinking actually very recently about but we have not enabled attaching team completions models to NuGet packages yet or those are those libraries so we do have that in our mind that we as a top scenario the nailing library owners to be able to train a team completions model and then distribute that with to the rest of their you know library users it also vice versa we also have the idea that we love for a library user to be able to train for a nougat package and then you know with the consent of the nougat package owner of course be able to distribute so we are actually planning on lining that up but right now team completions is just scope to get repositories and I don't know I think that mark might actually have something to add here yeah so I mean Katie's really put it pretty well there the the game is a little bit different so because at the moment Mads you could come to my office or someone could send me an email right or send Katie an email and say hey I really really want my package to be included or my set of packages to be included those can get included today in the in our base model so we have a way to do that for for things that we think are important but obviously that's kind of not gonna scale to the sheer number and variety of packages that are out there and so as a package author as you were saying you know you can't really like we can't have every package author be banging on our door and saying hey can you include me in the base model also that kind of doesn't scale out well in in terms of having the the base model getting bigger and bigger so what we really want to do is to make sure that you know if you're consuming a base model sorry of a no NuGet package rather you get the right map of the right model for that package but that requires all the things that Katie was talking about to be solved in order to solve for that we need your consent as a package owner to go train we actually need something that you may or may not have which is usage right we need sample usage of your code and that's that the model really only learns I spidering across usage not so much looking at the API itself but looking at how people use that API and in all the different contexts that it's used and it's most useful when all of the contexts are expressed in that learning data so it's it's not as easy as it sounds and it's a problem we really desperately want to crack as Katie says it's on our backlog but we haven't got there yet and I'm super interested to hear back you know if there's anybody who's got packages right now what what I'm Katie and I would be loved to be in touch with you about about what that feels like in terms of what would you your ideal workflow be how would that fit in with you would it be just like that you when you publish your new get package the work of doing a training gets done automatically for you and somehow gets pushed up and how do you see that playing out for you would that work well would there be something else that you would want please you know all of this stuff's only gonna work if we can get all of the ecosystem people who are actually playing the game in on how we're doing it yeah so I guess the whole scaling thing makes good sense of course it wouldn't scale if everybody's packages were was in the base model that makes total sense so and scaling is a hard problem to solve I don't envy come up with a good design for that one yeah fortunately Mads the sorry fortunately match the there's an existing piece of scaling called new get write which basically lets us scale packages right so we're keen to follow the patterns that package managers give but we just want to layer ourselves up and on top of that as much as we can that's how our minds are on this at the moment and but if people want to kind of tweak our minds on it we're more than happy to have discussions about that so if you watch this live please give us a comment in the Q&A panel on your right side or if you're watching this on demand on YouTube comments are below please please help us get some insights here for mark and Katie so just to change gears a little bit you are doing Intelli code which is the originally was the augmentation of intellisense and you know but it's become more like and as I said in the beginning every time I asked what are you working on there's always something new and different than what I thought it was going to be so beyond completions or that's what we internally call Intel sense completion what else do you have going on in your team right now what else are you tinkering with mark Wow so I mean there's there's so much so so much and we're you know that when I look at the horizon of what we're looking to do with right we're really trying to help developers to you know I say beyond completion some of these things are actually just extending completions like so for instance you know we're doing some work to make completions even better in places where they're not to extend their scope but we're also doing stuff and Katie was kind of alluding to how did developers learn how do they understand there are lots of steps so there's a time for instance when you don't even know what API or even what library it is that you want to use and typically right now you're going to be out on github it's not get up on the Stack Overflow or being or name your search engine of choice here you're going to be out there searching for the solutions to different problems however but if your goal is a code snippet why wouldn't that be inside vs another one that we're looking at is looking at repeated patterns and you know how we can help you with with that so when you're editing I don't know if you've ever come across this scenario you know Mads where you'll you introduce something new into your into your code you're doing some refactoring somewhere and you know you then have that really tedious task maybe you've introduced to help a function of going ahead and in introducing that in all the places that it applies in your project or maybe even in other projects and particularly if that helper function contains you know functionality that fixes a bug you might even if you forget to introduce that helper function somewhere you might be having hidden bugs parked in your codes that you haven't fixed or maybe your team's developed a new pattern for doing something that helps avoid some trouble you know maybe you've got a particular way of dealing with certain threading constructs or you know you've got a way of catching if blocks and the convention for the way you throw exceptions and blah blah blah blah blah you know teams have these things and they have them for a reason they'd learn these things by grazing their knees and by by actually doing stuff and having trouble hit them and then the team gets together and they figure out some solutions but the real trouble comes when they want when you want when you want to make it basically codify that and make sure that you don't miss it missed opportunities for it in other places and that's where the power of the Machine comes in to help you out to help you figure out where those locations might be so if I can I'd like to share a teeny tiny demo how that might work so cueing your screen and I'll get it up just bear with me for a moment and I will share my visual studio let me know when you're seeing my screen yep there you oh I'm just in the middle of Visual Studio right now this is just a preview release and this is a feature that we call in Telugu suggestions and so what's actually going to happen here is I've got this crufty code here which does a Fahrenheit to Celsius conversion and I'm just going to go ahead and replace it because I've got myself a helper function that actually does that for me and now I've got to go through my whole program and find all the places where that might apply and that's you know not necessarily an easy task because you know the variable names I use might be different there's some slight changes of formatting so a straight-up Find and Replace might not do this but what I find is you might have noticed as soon as I finished that second instance there something has happened okay and over here I've got a new thing okay it says showing Teleco suggestions based on repeated edits it's been watching me as I go okay and we'll talk a little bit more about how that works in a moment but then watching me as I go and when I click on that thing there I see that it's saying okay there's another one of those at line 124 I double-click on it and here's another light bulb and it suggests the exact fix that I need based on the pattern that I was typing ok so if I take that sure enough it's fixed it for me ok so you can see what's going on here I'll just stop sharing my screen now and we can talk a little bit about how that works say the magic there underneath the hood was a thing called pros now pros is a little bit different from your standard machine learning and AI based things so what Katie was talking about with the base completions and the team completions that we've gotten into those things are all based on a machine learning algorithm or an algorithm that works across the relatively large corpus of code and learns the bunch of patterns based on it sort of after the fact in frozen code if you like that code is actually you know learns across at one moment in time what you saw there was it was dynamically learning ok and what prose was doing was it was tracking my ast my abstract syntax tree deltas ok so it looks at my code and it says ok when Mark was typing that thing this kind of change occurred and it was like it was a tree that looked like this and then it turned into a tree that looked like that ok so it was able to deal with the fact that the variable for instance the variable names were different and some of the constructs might be different because of that ok it looks at those deltas and once it finds some common ones it tries to synthesize up a transform program that lets the user get that fix that I was showing to you so the thing that takes you from before to after that's like a transformation program or a synthesized suggestion that is made by example by clustering ok those deltas in the ast S as I go and having learnt that rule ok then it can apply it anywhere in my code that I open up so that's pretty natty I like it I like it a lot because it actually is learning we've talked about how it learns from the you know kind of wisdom of the broad community in terms the work that we have incompletions and then about how we can learn from the wisdom of the narrower community on your team when we're talking about team completions but now we're talking about learning from what you type what individuals type and then you know eventually we're thinking maybe we get that that knowledge out to the team as well wouldn't that be cool if those rules that we found was something that we're actually a transferable asset wouldn't that be any idea anywho this this is something that's just it's a different kind of learning so we're we're not hung up on the idea that everything we do has to be a I in the conventional sense of that word that it has to be learning across a large corpus is that it has to be using big fat models and or even slimline models we will do anything to have the Machine find a pattern for you and help you apply it at the right point of need that's the that's the real key and so that second piece that you saw there is an example of how we're doing that with pros with with Intel occurred suggestions and folks can if they want to try this out they can try this out in any of our recent previews so go download the 16-6 preview bits right now and you can you can try this out just go to the IntelliJ preview box and turn it on it's it's really easy to to try out and we'd love to hear the feedback on that but that's one of the things that we're playing with as a team is to to try and expand the kinds of learning that we are willing to take on alright so you bring up a good point the latest Visual Studio preview which is 16 6 preview something and but Intelli code also works for Visual Studio code right so how do so okay how does people go get the business to do code 1 and is there a benefit one over the other are they or are they the same it sure so the benefits of Visual Studio versus Visual Studio code honestly I think it's a matter of preference so I think that there are a number of developers who are accustomed to using Visual Studio and in Visual Studio right now the feature that I mentioned previously team completions right now we've only actually enabled that for a c-sharp in C++ within Visual Studio so if you're trying to if you're deciding whether or not you want to try to completions right now if you are on vision of the studio code we haven't actually expanded there yet it is on our roadmap and in our backlog but right now if you're a c-sharp or C++ developer and you'd like to have custom completions tailored to your code base you would have to be on Visual Studio however we do have base completions so getting those starred completion suggestions for JavaScript typescript like right now we have C++ and we also have I'm probably blinking on Python and probably blinking on a couple equals equals amel yeah so I think that's about it Samos equal Python JavaScript typescript C++ we have that available in Visual Studio code and the way to get that is you would actually have to go to the visual studio marketplace so like the visual studio code marketplace and you'd have to install that Intel extension and you can also do that directly in Visual Studio code so the other thing I would say is that we also our preview feature that you can actually try out in Visual Studio preview as like Marc suggested previously and as Matt sort of alluded to you can try out all of our latest features which we tend to not always focus on visual studio but a lot of a lot of our PDS have sort of started in the digital studio but you can go to visual studio and you can access a number of our our preview features there so yeah so I don't know know if there's a which one is better I think it is a matter of developer friends and what you are accustomed to working in I do think that visual studio does offer like a very more comprehensive experience and if you are familiar with setting up your developer toolkit their toolset there we just sort of augment that experience all right very cool so when I see mark what you just showed and other things that I've seen until the code do it's like you know it's close to magic and you know and I realized I also don't understand sort of a mental and AI concepts very deeply and so there's a saying by someone that if you don't understand it it's indistinguishable from magic but what is what kind of reactions do you get out there for for people using it or seeing it for the first time what what what do you hear mark well I mean it's it's interesting you know it varies from shock and the magic response to how on earth is it doing that to suspicion sometimes like I'm not sure how it could do that or why it would do that but you know one of the things I think we're always trying to be in the interrogate team is kind of humble about the the technology that we are using and you know it's not always perfect because these things are you know based on algorithms that you do not always produce perfect results with a hundred percent certainty we always want to say that the things that we're producing are either a suggestion or something of that sort and the reason why is because we don't want to want people to think that this is like it's not like static analysis so if you think about the and even that can get it wrong of course as we've as if you've been around static analysis long enough you can know there are false positives there but if you think about the suggestions code that I just showed you there the amazing sort of ability to spot patterns does it get that right a hundred percent all of the time no it does not but what it does is when it does get it right when those suggestions are good they essentially end up being something that can be almost like the analyzer you didn't - right okay it's it's basically because no not many people have taken the time to go and write a linter or an analyzer or something of that sort but when we can actually do this right for you we can really add value and so we're on a delicate balance between trying to make sure that you know we surface the suggestions that are useful to you so for instance in that suggestions code one of the things under the hood that's going on there that we learnt quite early on is we really want to make sure that even AST suggestion Delta suggestions that we get that might be true in terms of the transforms you know they may actually be a correct observation but that which which increase the number of errors in your code those things we don't currently suggest it may be that they're valid and it may be that in future we actually have so a bit more control over that and say actually I'm perfectly happy to have my code to be in a broken state in an intermediate and you know that when you're editing sometimes that happens right that you're you have to go through broken to get to good um but initially in terms of making this useful to people we've beefed up the sweet spot was that we need to make sure we don't cause suggestions that would make the code break now you know that's gonna change over time but you know in terms of reactions from people people generally don't react well to suggestions that make their code break unless they know it's going to do that unless they know what the nature of the thing they're applying is so you know that's one of the things we've heard but and that's part of what's gone into you know the suggestions set up as it stands right now may be the year but also that that notion of humility in terms of the suggestions that we make I think you'll always find that so for instance if you think back to the intellisense example intellisense will show you everything that's type valid for the location that you're you're typing okay when you do a method or a property or an argument those things if they're valid code then intellisense will show them to you this is it the pre Intelli code into other sense right it will show them to you all we're doing is kind of sprinkling some some recommendation sugar some suggestion sugar on top of that right and making it say Oh but we think given your context you might want to do that and notice I'm using think and might they're we're not saying you'll definitely want to do that we're saying you might want to do that so it's very important with these a I assisted tool so that we we make sure we understand that and that we express that in the kind of experiences that we surface so I would say that's that's been true across everything that we've done so far and I anticipate it probably stays that way yeah so it's not like a moment in time like the AI technology has just not evolved enough to be more that we can be more prescriptive saying this is what you want to do so right now we're just saying oh maybe this is what you want to do and we suggest something but it's that just because technology hasn't caught up or I don't know I don't know that that's actually ever gonna completely go away it's because there's such a broad spectrum of things that are possible to express you know we get more precise and more confident and we spend a lot of time obsessing about precision and coverage which are two key metrics that we we measure all the time and really precision is about how often we get it right and coverage is about how many places we can get it right and so the those things are things we bothered we are deeply bothered about we want to drive that number higher so that we get we cover more stuff and we cover it a higher precision that's always goodness but getting to a hundred percent is not necessarily our goal being useful is our goal right being useful to the developer and helping them to you know move forward faster that those those are the goals that we care most about right that reminds me of like it's sort of a mantra that we have here in my family is like never let perfect get in the way of good yeah so much good to be had and it doesn't have to be perfect to add a tremendous amount of value yeah so I've heard like some people be a little bit concerned about AI right like is he gonna take my job like where are we in you know with the AI and machine learning inside Visual Studio like are we getting closer to being able to automate the as a whole as a discipline maybe what are the sort of concerns that you hear from people and and what are your answers to them Katie so I'd love to talk with Mark about this too because I know mark and I talk about this a lot but from my perspective you're so far away from that as a discipline and I think that as Mark was highlighting in his biggest comment I think that like we're really the goal of what we're trying to do and embedding or integrating AI and machine learning techniques into visual studio vision studio code our main goal is to promote common usage and sort of promote those those common practices best practices and we're at the point I think in the in the juncture and the grand scheme of things I think we're very very nascent and we're at the point where what we're doing is providing just helpful contextual examples so that's what the completions Dunne's that's what suggestions as you saw mark demo previously that is what that is doing is providing suggestions that really just sort of like help you remain in the dev environment and and help you sort of like keep in that flow that developer flow and not get distracted by going to you know the web and like searching this and then seeing those shoes that you've been wanting to purchase or seeing that you know $10 USB speaker that you're like I want to get that it helps you keep focused on the task at hand and I think we're just we're we're really far away from automating people's like deb jobs away and i don't even think that that is a goal that we ever actually intended to to reach our goal it has been mainly just like how do we enable developers who already are sort of like a very valuable resource how do we keep them to just keep them focused on on whatever their task is how do we enable them to be as productive as they possibly can and not productive or you know you know the the man or like the business but being productive for their own selves like how do we actually provide them with the tools that as they're learning development and onboarding to coding that they're actually able to see this as like this is actually a fun task there's some sort of like ludic engagement aspect to like just actually just development so I think from our perspective that's sort of our spin but I'd love to like have this conversation with mark as well so I know mark has you know is you know very much like on the edge of the sea to answer all right bargain let's hear it yeah I would this is this is the heart of where my head's been for the last couple years you know that this is not at all about taking away people's jobs and and and as Casey says I mean even technologically we are far from that but it's just not what we're about we are about enhancing the experience of development about making development yeah I mean I dare to say fun right to actually make it less painful and less difficult to stay in the zone to stay in there I love the word ludica one of my great heroes was Bill Hill by the way who sadly passed away and that that notion of ludecke engagement encoding that notion of being you know I'm locked into this space I'm thinking about so if I don't have to be distracted away to some other place in order to go and figure out what I'm doing I can stay in the zone and the tool just helpfully augments me right helpfully augments me in there at the right moment with the knowledge that I couldn't otherwise get it's giving me superpowers basically it's giving giving me superpowers by saying I can now as a developer know for instance all the patterns that I have out there that my team has has developed so I don't have to worry about tripping over that banana skin whilst I'm in the process of figuring out how to it how to implement this great piece of technology that I'm actually implementing my head's about the technology it's not worrying about those other things that I might be missing or you know let's imagine and and I know you know maybe I'm just getting old a little bit but here's the thing we know a lot of api's but we sure as heck forget all of api's as well so I don't want to have to be going back to the documentation to reboot myself into the zone when I hit that piece of code that I haven't touched in three years right I want to be able to know what the common usage is right now so that I'm not you know losing my context losing my vibe really we want to make development more pleasurable we want to give developers superpowers we want to give them that capacity to get more done not just because it's kind of good for business but because it's good for the soul anyway Katie Katie I'm sure you want to come back on that egg sure Mike yeah mark yeah I really wanted to actually like sort of segue this into something that aunt Ella code provides so an example of how we're actually trying to make development more more helpful and also more pleasurable as Mark was mentioning is that they're trying to like reduce the arguments that are had over very like you know sometimes you'd think like trivial things like for example your code Styles that happens all the time or formatting so do we have the tab or do we have like two spaces or like three spaces are four spaces and and things like that are often just like fights or venomously place but conversations that go on for way too long that actually distract from your ability or door detract from your ability to actually just code so how do we actually solve that so I'm actually going to share my screen and show you an example of how we're actually trying to pay developers and development teams from having these sort of back-and-forth arguments about code styles and and code formatting you okay so as you can see my screen I've loaded a solution and and the feature that I'm actually going to demo is a feature called and bird editor config so if you're familiar with editor config files an editor config file is a cross-platform file and there is a common syntax defined syntax that sort of defines sort of the code styles and code formatting conventions that exist within a solution our project so typically what developers would do is they would write an editor config file what happens if you're in a team and you don't actually know like you you just sort of you have this project you don't actually know what the styles are actually already exist there but you have sort of like some people have opinions how about you start from instead of having opinions why not start from and analyzed like an analytic and analysis of your current code base and the current code conventions and the current code styles that exist there and then from there like determine what it should be and have those very meaningful like bring the data to the to the conversation or the debate so so what you can do is you can actually add a new editor config file that Intel code but it's all code will do in the background is it's actually analyzing that solution and it has now generated an editor config file so instead of having to go and define all of these rules and intelecom is actually just defining this for you so if you if you see this is what aunt Ella code has produced in the editor config file so I've already opened up a file it's called paint object constructor and something that you'll notice is that you'll notice here that it's suggesting me I've already sort of like loaded up the line I'm sorry but it's suggesting that I actually take an action and actually make a fix and that is based off of the define coding conventions and that have been defined in the editor config file that Intel code has already generated for me on my B on my behalf and so because this lives in the solution so you'll see the editor config file here once I commit this this will automatically be shared with the rest of my team and so as you can tell I could actually introduce this but I can actually take action on this suggestion but I also wanted to show you that what is the actual rule that is providing me with this suggestion and if you'll notice if you can if I can go down there there is a rule that says that you prefer methods that we practice with this and and so I guess what I'm trying to say is that the scenario that is this would be very very impactful for and useful for is a scenario when I'm in a team and we just have had a lot of conversations back and forth about what should be the common style or the common coding practices for my team and often they just people are bringing their opinions to the conversation and based off of their own history but why don't we take the code as the main artifact and we say here's how here is how after I've analyzed our code base these are the styles that are already exist within my codebase or within the solution within this project and from there then bring this to the conversation and say Intel code has generated this editor config file that is based off of what exists the styles that exist in my my code base in our code base let's actually see if like do we actually want our code base to our code to look this way or do we want to have do we want to change it in a different way so this it actually not only promotes just sort of common or the best or the comment or the historical Colston Co styles but also gives you sort of like that starter for that conversation and it also reduces that time that you're going back and forth about debates you did just say this is what the codes this is what sort of exists commonly in our in our code do we want to exist differently do we want it to be different and the cool part about it is once you've actually have this as a find editor config it fits is c-sharp in this case the Rosalind analyzer will start providing you with warnings and pushing suggestions for you to change that is pretty cool okay so in Teleco does editor config formatting as well so it's really a broad set of features that your team is doing so is it fair to say that Intel ecoute is is not a feature it is more like a team that work on certain type of problems market yeah that's absolutely right Matt we we work on the the set of problems where we believe we can bring this kind of pattern understanding to bear to give you good useful productivity features that augment your developer workflow right so we're all about that so we're in a sense where a set of a I assisted development tools that we're trying to apply across a broad spectrum whether that's envious or envious code whether it's to do with things that are happening at edit time whether it's to do with things that are happening even as Katie was just showing you know that editor config artifact can play out at CI build time as well so you know we don't really mind where we add the value as long as it's helpful to developers and helping them to accelerate but our cool thing is to distill down the pattern wisdom and bring it to you to you at the point of need right so that's that's our motto if you like to to try and get things done that way yeah so we're not just one thing we're not just about intellisense we're about anytime we can provide you with helpful insights based based on patterns that's that's the deal okay so so you're mentioning this but you said that the like you're basically doing a lot of work up front and then you present it to the visual studio user as they need it does that mean that the overhead of running the machine learning and AI engine doesn't happen in real time on the developer machine CPU and takeaway performance that is an awesome question and in fact the answer is complicated so in some cases the answer to your question is yes we offload for instance in creating those machine learning models and one really exciting development that we should talk about actually is that we've been doing some enhancement of the completions model with with with deep learning those things are high horsepower activities right that we want to we want to make sure that we keep those things on the on our service so it doesn't gum up your machine right we were we don't want you to be having to run learning locally if you don't know if you have to but sometimes we we do a little bit of work on your local machine it really were trying to optimize that as much as possible and the training where it's necessary to do training happens on on remote machines where the big horse their lives or we keep the training process or the the algorithm to a point where it can learn very very efficiently so you saw when I was doing the suggestions work that yeah when I was typing away there there was analysis going on you know as I was typing as it turns out that that algorithm is running locally on the user's box and and we've done a lot of work to make sure that that actually remains highly efficient in terms of memory usage and CPU usage so that we don't swamp you and don't take away from your your editing smoothness right we don't want to be doing that we don't want to be flattening your battery we don't want to be doing any of that kind of thing particularly in these days when we're working remotely more you know you've got to be laptop friendly right and that the reality is that you know it's horses for courses as we say in England right we you basically you pick the right the right tool for the right job and so when we are doing things that are extremely complex and when we need to do things like do deep learning models and so forth chances are you're gonna find us doing that on a server somewhere on your behalf so we don't eat your machine CPU and battery where it's appropriate we will sometimes do local work as well but we will always work hard to make sure that the it's not something that's gonna impact you too badly so kind of not a simple answer but you know hopefully it makes sense yes thank you so much it totally does and it's wonderful that we can get great AI capabilities without users using our battery on our laptops so okay we are almost at the end and I want to just end this with a quick question to both of you so let's start with Katie Katie what is it that excites you the most for the future of Intel the code that you're going to work on in the foreseeable future with luster she's muted there's such a great question that's yeah that's such a large question um what most excites me so I have mainly been focused on the completion space and so for me there's a number of goodies that are uh parsley use that I will wait to present on those or talk about them too in depth but I will say that I'm very excited about working really closely with some some early customers who are just interested in dog booting and figures and just like learning from them about these upcoming experiences that were working on so I'm being very coy and not being very forthright about what we're working on but I will tell you that it's really really exciting and in the completion space and I'm looking forward to just learning and hearing from our customers about these new experiences because I think that they will really sort of take what we're yeah so I think that it will be great yeah awesome and Mark same question for you yeah absolutely I mean customer customer input is supervisor to us and and I'm really interested to hear other places where people have tedious tasks that they would like us to take out of their way but I'm personally you know very excited about the ways we're going to be able to spread out the knowledge that that's in your team and get that out to everyone in your team so they can take advantage of it I think that's that's going to make a huge difference to people as they go forward and we've definitely got some good things you know coming in that domain and and also new ways for developers to express their intent in a more compact way so you know whether that's by you know typing something once and getting us to do something again or or whether there are just other ways to say what they want the machine to do for them I think there's lots to be done in that space and watch this space we have lots to say it build so come watch out talk better as well awesome well thank you so much both Katie and Mark for for joining me year's a day I hope the viewers out there had a good time and learned something new I assured it so so thank you so much we're at the other line it is it's been an hour and I hope I'll see you again next week Thursday morning at 9:00 a.m. Pacific time where we will talk about the UX lab that we have here in Microsoft that we use in Visual Studio to interview customers and see how they do eye tracking and and learn a bunch of cool things and how we apply that and what are some of the learnings we have from that when does it work and when doesn't work really well and I think there's something in that that you can apply as well at home so make sure to tune in next week thank you so much
Monday, 21 October 2024
ASP NET Razor Into the Razor'verse
alright everybody we are back when and talking about asp.net racer take it away are you guys doing good Oh take it away sir ready to go yeah all right so I'm gonna talk about razor today and there are a lot of razor things to cover so I'm ready to go ahead and switch to my my screen here when you guys are we're all set sir all right so hello net Kampf hopefully everybody's enjoying the show so far my name is ed Charbonneau I'm a developer advocate for progress and let me get a justed here there we go I'm a developer advocate for progress software a Microsoft MVP and today we're going to talk about razor into the razor vers razor is an ecosystem that has expanded over the last few years and includes many different razor technologies so we have razor the engine itself the syntax razor views HTML helpers razor pages raise your tag helpers blazer and it's razor components so we're gonna start at the top level but we are gonna deep dive into each one of these things we only have a short period of time so let's get going the first thing that I want to cover is the syntax itself so razor the syntax is a template markup syntax based on the sea shark programming language the nice thing about razor is that we don't have opening and closing tags with razor we use the @ symbol to open up our template and it intelligently finds the end for us so if we look at the old way of doing this in web forms you can see it's a lot more verbose than using razor if we look at something a little more modern like angular we still have this very specific angular language that we're using to define our templates in our markup where razor is just using c-sharp and markup so there's some benefits to razor here and there's even more with the ability to do complex expressions so we open up an @ symbol we can do all sorts of things in this example we're doing some math and just writing out an out into our HTML we also have control structures like for each if then statements try catches all of those things are valid within our c-sharp syntax or a razor syntax here's an example of an if statement and we can branch out and write out different portions of HTML to our page using razor this way so let's talk about razor execution really quick it's actually a complex thing happening behind the scenes so razor generates c-sharp code from the template if then compiles that code into a dotnet assembly it loads it into memory and then execute that compiled code so that's the razor syntax that's a quick overview let's jump into razor views in HTML helpers next so razor views our streamlined way of writing code focused templates in dotnet there return from a controller action as a view result and the content is generally made up of HTML and components that are HTML helpers now other component models are valid here like tag helpers and razor components but typically with views you'll find HTML helpers being used this project template comes from file new project if we click on web application and specifically that Model View controller application we're talking about the view portion here so razor views in that template so that's razor views in a nutshell we're gonna talk about HTML helpers next so HTML helpers are the component model for razor views they're invoked as methods within HTML razor views they encapsulate code and HTML so we're building components using this this structure at the end of the day these things turn into an HTML string and that's really important to remember here and we're gonna get into the reason why it's important later but the main takeaway here is these things turn into HTML strings so keep that in mind so this is what an HTML helper looks like and how we use it in a razor view we call at HTML and that identifies that we're info being a helper and then we call the method on that extension method on the HTML class now we pass in our parameters and output the type of helper that we were looking for in this case we're doing an action link so we get a nice anchor tag with the path that we're specifying in our HTML helper creating these is actually fairly simple we just need to extend my HTML helper as an extension method and we've returned I HTML content so let's take a look at what that looks like if we look at the function signature signature it's very simple we take in IH tml helper we output IH tml content and we have an example here of a hello helper we're gonna write out a span with a message inside we're actually going to break away here and do a quick demo and we'll view that HTML helper in visual studio so let's do that let's break over to visual studio and in this solution I have three projects and we're gonna start with the razor view project and this is identified specifically by saying that there is a controller model and view folder so this is an MVC application and we have razor views so I'm gonna open up the index page here the index view will zoom back out and we can see that we have our razor mark up and we've got a couple lines of HTML a mark up here and two things I want to point out specifically we have that HTML helper that is at HTML hello and we're passing in the value world and I also have a tag or a piece of razor markup that is at this get type base type so I'm gonna discover what the actual type is that's resolved for this view so that's gonna be interesting first let's open up our HTML helper and take a look at how that was built so first of all we're returning an eye HTML content and the method name is going to be hello and we're passing in a HTML helper as an extension method so that's what this keyword is for we're extending the eye HTML helper interface with method called hello and passing in the message job parameter we're gonna write that out into a span an HTML span and that gets turned into an HTML string so this is the basis of an HTML helper which act as components in a razor view so let's give this a run I'm going to ctrl f5 we don't need a debug I just want to see what this looks like on the page so we're gonna load this up in the browser and our application loads and we have hello world this is our HTML helper being executed and we also have that segment where I said at this so tell me what this thing is and what is the base type so this is actually the razor view is a razor page of T so a razor page takes some sort of type in this case it's an object that object is actually your model being passed into the razor view so interesting stuff there let's break out again to a folder view so what I'm gonna do next is a little crazy I'm gonna dig into the bin folder for this project and inside of the bin folder we're gonna find a project views dll file I'm going to use a free tool called telluric just decompile to open up this razor view and let's go ahead and see what was actually compiled from a razor code here so I'm gonna dive in if you see me dismissing a window here this is actually trying to decompile any dependencies that are on that object don't need all the dependencies decompiled I just want to look at the specific razor view so inside of this razor view this is what was compiled from that code that we wrote and we have our our class of view home index that inherits from razor page so that's where the razor page came from of tee object also interesting inside of this is that we automatically generate some properties here so we have an HTML property so remember in our code when we wrote at HTML that's actually where that property is being extended with our extension method but what's really important is at the very bottom here so we have a task at the bottom called execute async and what this does is actually renders the string based on all of the markup that we wrote in our razor library so we have write literal and write and in here you can see our actual HTML helper being executed all of this stuff gets turned into a literal string an HTML string that we can view in the browser so that's very important to know because later on we're going to talk about rays or components and things are going to be much different so let's go back into our presentation and we will talk about the razor views and sorry razor pages in tag helpers next so razor pages was introduced with asp net core it's a page focused approach versus model-view-controller like the previous template so pages incorporate their own controllers actions and routings inside it's in a it's able to be integrated with MVC so these things aren't mutually exclusive you'll find that's a common trend with all the things I'm talking about today the content is actually made up of HTML and typically tag helpers so tag helpers are new to asp net core we're going to talk about those next but we can still use HTML helpers and even razor components in a razor page will show that last if we do file new project and choose web application we will get a razor pages application this is different from the model-view-controller application as we'll see in a minute if we look at them side-by-side the asp net MVC application has controllers models and views or a razor pages application has just a pages folder and inside of that pages folder each page has their own code-behind file so that's how they're primarily different the razor page versus of view is also written differently so we have an at page directive this identifies that this is a page in a razor pages application we also have an at all directive that ties into the code-behind so this is where the code vine comes from this is where the page model is represented so we can set properties and things as you see in the example here we have a message that is used within our markup on the left-hand side now also unique to raise your pages is we have an on get method these methods actually correspond to HTML or HTTP methods so get post put in delete so you'll have on get on put on post on delete and those things are used in place of controller actions so the the page concept is more of a vertical slice and we're able to do everything in the code behind so the component model for razor pages is actually tag helpers and tag helpers our asynchronously server-side processed pieces of HTML these you these use tags and attributes much like HTML does which helps eliminate context switching between HTML and C sharp they're also designed for a unit testing in mind I don't have time to show that today but it is something that is a benefit of tag helpers over HTML helpers so HTML helpers versus tag helpers when you're writing them there are some fundamental differences between the two now one of the things I like to point out when talking about these two types of component models is HTML helpers are nice they have nice fluent syntax but when you go to add things like HTML attributes such as a class you have to do some special things so when we want to add a class which is a normal thing normal operation to do in HTML we have to do something like this we have to new up in add-on of this object then we have to escape the word class because that's a reserved word in c-sharp so things start getting a little messy when we have to do this HTML helpers have this problem tag helpers alleviate this problem by using tags and attributes directly so this same example below we're producing the same output but with very minimal effort the tag helper portion of this is actually the a sp4 attribute so that identifies this as a tag helper and Razer knows how to handle this and they output the same thing and what's nice in the second instance here is our class when we define it we actually get intellisense within visual studio and we don't have to escape it and create those anonymous objects and those types of things if we look at a more complex example like a teller at grid we have a nice fluent syntax with the HTML helper but if you look at the tag helper it looks a lot like HTML and inside of a big page this doesn't really stick out and there's no context to switch between if we want to control the scope of tag helpers within our raiser pages we have special directives to bring those things into scope or remove them so we can use the add add tag helper directive and there's built-in tag helpers in asp net core all the things that you need to build a form are there and if you look at something like the telluric UI for asp net core there are both asp net HTML tag helpers and tag helpers for both sorry for both razer tag helpers and razer HTML helpers this is a mouthful guys there's about 60 UI components there that support either type of type of model so an example of that would be a big picker and you can see these are very easy to read and understand so let's jump into a raiser pages demo and we'll decompile that one at the end as well so I'm gonna pull my Visual Studio project back up here and want to switch projects over to raise your pages and we're gonna dive into the raiser pages project and right away you'll notice I only have a pages folder now the code for our index page is actually represented in the code behind and we'll look at the mark-up as well so this is the raiser page for our index page the mark-up is in this CS HTML dots yes file behind it and you can see I have an on get method that's not being used so we're not actually doing a whole lot of work here but it is nice to know that it's there most of this page is written in HTML and I also have a tag helper on my page here this is a some tag helper so we're gonna talk about custom tag helpers for a moment so let's jump over to custom tag helpers and we'll take a look there and then we'll go back into our demo oh sorry that that actually got removed for time concerns we're actually going to dive into the code instead of some slides here so in our tag helper it's a little bit different than writing an HTML helper so instead of writing at HTML we're gonna target a specific tag and we do that through HTML target element this is a directive that we can use to target something inside of our markup so I have a tag helper called dotnet - comp that I'm going to be targeting with this tag helper and when we build a tag helper we need to override or inherit the tag helper base class and override the process method when we do that we're able to take in content and write it back out as HTML so we're gonna take in some parameters we have a property called name we're gonna take that in as a parameter and then we're gonna write that out to a string and that string is going to say property the the name property loves dotnet comp we're gonna ignore some errors here visual studio is not playing along for dotnet cough but anyhow once we're done we're gonna say we're going to set that HTML content and then we're going to render that out to the browser so we're consuming this custom tag helper here you could see it's highlighted it says dot net comp I'm passing in my name and we're gonna render it that out to the browser so we'll ctrl f5 and again this is the component model for a razor page and we're going to write out ed Charbonneau love's net comp that's our custom HTML helper let's take a look with inspect and you can see we're writing out a span in that text that was produced by our tag helper gets emitted there so let's take one more look here we're gonna go back into the folder view and we're gonna find our dll file again so we're gonna go bin I'm in debug and we have our project dot razor or project views dll we're gonna decompile that I'm gonna ignore any dependencies once again I don't need to decompile the entire universe I just want to see the one page that I've written some custom code in let's see what we get here this is the compiled version of that razor page and in that page we have a static class or a public class of pages underscore index but notice here it's inheriting from page so a razor views actually inheriting a razor page razor page is just a page there's some similar properties in here you'll find hTML is here so we can still do HTML helpers and down at the very bottom once again we have this asynchronous task called execute async which turns everything inside of that razor page into a literal string so again keep that in mind that's very important that is the main takeaway that I want you guys to have today so we're gonna go back and we're going to close just decompile and next we're gonna start talking about blazer so blazer brings with it razor components so razor components is the component system for the blazer framework now can still be used in asp net projects which we will see in a moment but for the most part keep in mind that the Razr component model came from the blazer framework now blazer and razor components use the razor syntax they are a component architecture versus HTML generation tools they create what is called a render tree which is a dom abstraction i'm going to show you a little bit of that in just a moment there file extension is dot razor vs. dot CS HTML and one of the reasons that we have this distinction is because how different they are in execution so razor files are used to generation and these special dotnet classes that implement a render tree so what is a render tree well in a typical JavaScript or jQuery application we're responsible for writing directly to the Dom Blaser does that work for us and it does it through a difficult job a script application we use a selector using jQuery in this example we might find some elements in the Dom remove them and replace them so this is an expensive task for our browser to do so for removing things from the DOM and then scrapping all of that and writing it back there may be some things that were actually unchanged in this process but we've gone and removed it and re added it to the bra the browser anyway so this is a very efficient model of operation pleaser does something different so Blaser creates a Dom abstraction or a shadow Dom so it has a copy and object graph as you if you will and it can operate on this object graph much like it would directly in the browser so if we will remove elements using Blaser it will do it to the render tree first and then when it adds things back and notices that some elements may not have changed it only goes to the browser with those changes so there's a difference and says only update the things that have changed in the browser so this is a system that is very efficient and we don't want to circumvent that so Blaser has all of these wonderful features the component model and the render tree are some of the key features that I want to talk about today so we're gonna go into a blazer application and first I just want to mention that with these components we also have all of these available with telluric UI for Blazer so let's jump into a blazer application and see the difference between the views razor views and razor pages and now how razor components act within the razor environment so I've got in my project here a razer components project in my solution and again you'll notice that we have this pages idea so we don't have model views and controllers so this kind of is a the next step in raiser pages but then it does a little more so we have all of our pages and components inside of this folder here because pages and components in razor or a blazer are the same so I'm going to open the index dot razor file and we'll also open the cup the counter razor files so these are components with page routes so these can act like pages we can call them from route in our browser but they also still maintain the ability to be components so they are both so if I go back to my index page I can reuse my counter component so I can call a counter here and now I have that counter component which also has a page route on my index page as well as it being its own counter component and page so I have that reusability there and the counter component is made up of HTML rays or markup in c-sharp there is no JavaScript here so we don't have to write JavaScript to build a component architecture for blazer and razor components so let's run this application we'll see what it looks like and then we'll do a deep dive again and see what the differences are between what we saw with razor pages and razor views earlier so we've got this nice component architecture I can use my counter on my index page I can also navigate to it as a route so it's acting as both page and component let's go back into our application and one thing I want to point out before I do the deep dive is that our razor application here if we go under pages we have a host CS HTML file so this is a razor page that is using and I'm gonna focus on this line here it's using an HTML helper in a razor page to render a razor component so we've got all three technologies here just mashed up together and we were awaiting at HTML render component async and then we are rendering the the app component which is the container for our blazer application so we're using razor pages and an HTML helper to bootstrap a blazer application how interesting is that let's go to our source code now I'm going to go open a folder view and we're going to go D compile our application again so I'm going to go under the bin folder and inside of the bin folder instead of opening the views folder I'm going to open the actual application folder because the Razr components are not views so they actually get compiled into the main application DLL so we're going to open this up with just decompile we're going to look at the guts of that counter component I'm gonna ignore all the dependencies once again I'm gonna dive into razor components DLL and under pages I have counter we'll open this up and this is completely different from razor views and razor pages so what the main takeaway here is we're actually inheriting from a component based architecture and this counter component becomes a class that uses a method called the build render tree method and this build render tree method actually is responsible for building that Dom abstraction that I talked about earlier so it's not writing directly to a string it's not writing this as HTML anywhere so when you're writing components for the Blaser framework you don't want to go in and do manual Dom manipulation a lot of people when they start using Blaser they ask how do I write raw HTML in Blaser you can but you shouldn't so this is why you shouldn't because you're going to skip past this build render tree method and you're not going to have that efficiency of the system doing updates for you so the build render tree actually adds the content to the this object graph through these methods so we can see add markup open element add content all of those things and it uses us to keep track of that object graph so we don't really need to know how all this works in great detail just remember it's there so you're not writing things in your application to go in and manually manipulate that Dom let's zoom back out here and I am free to take questions and hopefully you guys found that interesting so we got the top level of what all those technologies is and then we dove into the source code and saw what was actually compiled front of all those racers views that's probably something you don't do every day so I I hope that you guys found it interesting all right thanks so much yet I think we have time for one question one question Oh quickly so a question was asked how do you avoid the bad patterns of web forms with razor pages how do you avoid the bad patterns of web that's a kind of a broad question I'm not sure what bad patterns were talking about but I would assume things like viewstate which a viewstate doesn't exist in Blaser the way it does in web forms so there's no viewstate for us to manage what is held in State in the render tree is managed by Blaser so we don't have any control over that so that's not something that we need to worry about web forms has the idea of an abstraction around state that doesn't exist in Blaser we handle state in Blaser through dependency injection and plane class objects just like we would in any other type of net application so that that concern really isn't there's no parallel for it to kind of make a comparison ok so then a quick question if you are familiar with web forms and you want to dive straight into razor pages and Blaser quickly what would your Learning Path be so the learning curve for Blaser in my opinion is pretty small because if you're already a.net developer it's using all DET dotnet technologies so i'd say go to blazer net and click on get started and just follow the first few examples there on building your first blazer application there's a nice to-do list app in there that you can build and the component architecture architecture in blazer is so dead simple that I think people will gravitate to this very quickly alright awesome thank you so much thanks so much thank you guys and enjoy the rest of net comp thank you so much yep now we're gonna get Geoffrey Palermo up talk about Azure DevOps so we'll be moving things around and really quick we were talking about legacy stuff check out this Visual Basic for that's you can get a workout just lifting this this is nothing but books see it's a box we still say in the box in the out of box experience that's right all right shows in the box we will all see you guys shortly
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...
-
hey everyone welcome to Microsoft Connect my name is Nina Zakharchenko I'm a senior cloud developer advocate at Microsoft ...
-
It's lunchtime, and this is Brad Anderson's lunch break. Here in Redmond we're visited by some of the smartest peo...
-
[MUSIC]