 Coming up next. Accelerate your C++ environment with Erica and Mary. How are you doing my friends? Hello, great. Fantastic. We'll take it away. All right. Well, I'm Mary Luparo. I'm Erica Sweep. We are both program managers in the C++ team, and for the next half hour, we'll take you through a tour of everything that's new and exciting with Visual Studio 2019, your C++ developer. Throughout the session, if you want to delve deeper into some of the specific topics, we have ak.ms.links that you can follow, and if you have any questions, hashtag this 2019 on Twitter, and we'll try to get to all of the questions, some of them even in the session later on. All right. So, the first thing you'll see when you open Visual Studio 2019 will be the start window, which basically brings together all of the entry points that you commonly use when you use Visual Studio. So, whether you are a get first user, or you like browsing on this for your solutions, or you often open the same ones, start window brings them all together and kind of streamline that experience, and rest assured that after you make the selection in this UI behind this window, you will get the Visual Studio UI you are familiar with. Now, before I continue, I want to warn you that if you are a happy Visual Studio 2017 user, or Visual Studio 15 user throughout the session, and really throughout the day, the thought of upgrading to the 2019 might cross your mind, and change sometimes can add some stress, and even when change is good. So, before we jump in and talk about all the new things we're doing, I want to take a bit of time to tell you about the work we've been doing inside the product to make sure that Visual Studio 2019 upgrade is stress-free and pain-free for you. So, the first thing is that you can install the IDE side-by-side with any other version of Visual Studio, and you can switch back and forth between the two IDs at any time while you explore the latest IDE. When you're ready to make the switch, you can install Visual Studio 2019 IDE and bring all of your source code into the IDE without having to also upgrade the tool set. That's important because in large teams, upgrading the tool set sometimes requires some coordination. So, if you're using 2015 or 2017 IDE compilers, with the 2019 IDE, you can install those on the machine and continue building your projects in the same way used to with older IDEs, and once the whole team is ready to come, you can consider upgrading the tool set as well. Once you do consider upgrading the tool set, with 2019, it has never been easier to upgrade your tool set because of binary compatibility. If specifically you have third-party libraries that are built with previous versions of the tool set, for example, 2015 or 2017, you can take your source code, build it with 2019, and then bring all these binaries together, and your application will continue to run as expected. And last but not least, if any of your third-party libraries are open source projects, the best way to acquire these libraries is through VC Package. VC Package is a popular C++ package manager, and it brings full support for the Visual Studio 2019 tool set. If you're not familiar with VC Package, these are the three commands you have to run to get started and have one of the open source libraries fully set up on your DevBox, ready for consumption. I hope this reasons give you the peace of mind and the comfort that upgrading to 2019 is pain-free, and now we can delve deeper into some of the improvements we're making. And we'll start with the MSBC tool set. So we have a new version of the MSBC tool set in Visual Studio 2019, which brings improvements in four important areas, conformance, build throughput, runtime performance, and code analysis. And we'll delve deeper into these. And we'll start with conformance, where the new compiler tool set builds on the success of the previous version and comes with a full C++ 17 conformance in the compiler, as well as the most complete C++ 17 standard library implementation to date. But we didn't stop there. And we're currently, the team is actively working on adding C++ 20 support. The C++ 20 standard is a huge standard for C++ developers, and it will be likely approved later on next year. The team is already working on adding support in the compiler library's IDE. And we already have some functionality in the update that you're getting today. And we continue working on this and future updates of Visual Studio will add even more C++ 20 features. So stay tuned. When it comes to build speeds, this is an ongoing area where we make lots of efforts to improve. And in 2019, the focus is the linker. We thought the way we manage debug information and with the work you're gonna get in Visual Studio 2019, whether you're using the debug full or debug fast link switches, you can get up to 2.4x performance improvements in link time. In addition to that, if you wanna speed up your build even further, you can install the credit build and with, you can get up to 16 cores of parallel builds for free. Another thing that you get for free by recompiling your source code with the latest MSVC tool set is the runtime performance improvements made by the addition of new optimizations or improvements in existing optimizations. So in our internal benchmarkings, we've seen improvements of up to 2.8% by just recompiling your source code. And these are just the things you get by default. There are additional knobs inside Visual Studio 2008-19 that allows you to get even more performance improvements. For example, OpenMP, CMD extension, more aggressive inlining, and the reduction in size for exception handling. These are all things that you can turn on by specifying specific switches. And for more details, you can go to the aka.ms link below. Code analysis also comes with fresh checks. And in addition to the concurrency checks, for which I have an example on the slide over here, code analysis assists you with writing coroutine code as well as aiding in finding lifetime issues with dangling pointers or references or use after move checks. In summary, this are the improvements in the tool set in conformance built throughput code analysis and runtime performance. And what you're getting is the best C++ compiler tool set available for targeting Windows. Overall, Visual Studio gives you the best tools for developing Windows applications. But Visual Studio does not stop there. Many of you also target additional platforms. And when you do so, you move to a different operating system sometimes or a different developer environment. And really with Visual Studio 2019, you don't have to do that. Inside Visual Studio 2019, you can target all of these platforms from the comfort of a single ID. It's very easy to get started. And if you are using C++ tools that you're familiar with, you don't have to stop using them. For example, Clang Format. If you're using it today, you can continue using it because Visual Studio has built-in support for Clang Format. And the same way, if you're building with Clang LLVM or GCC, Visual Studio has support for all of these compilers, not just MSBC. And once you're inside the IDE, you get a familiar and rich experience, the top intelligence and refactoring operations, build integration, as well as state-of-the-art debugging. But really, there's no better way to show you this than through a demo. So Erika, you wanna take it away? Yeah, we can switch on over to show my screen now. So as Marion mentioned, with Visual Studio 2019, we have simplified the start window experience. To the left, you can still view your recently opened folders and projects. And to the right, you have four entry points to getting to your code. You can clone or check out code from an online code repository, open an existing Visual Studio project or solution file, open a local folder, which supports any folder containing C++ code without ever generating Visual Studio projects and solution files, or create a new project. The new project dialogue has also been simplified. So it is easier than ever to filter templates by language, target platform, or project type. In this demo, I'm gonna be working with a cross-platform CMake application that runs on both Windows and Linux called SuperTux. So if I was starting from scratch, I could search for the CMake project template, but I already have a copy of the project saved locally on my machine. So I'm gonna open it using the open folder experience. Visual Studio has native support for CMake, which means that you can open any folder containing a CMakeList.txt file and have a full IDE experience without ever generating Visual Studio project and solution files. To the right in my solution explorer, you can see that my file structure mirrors the layout of my files on disk, but Visual Studio also supports something called CMakeTargetView, which is a more CMake-centric way of viewing your code organized by target and allows you to build a single target at a time, run code analysis on a target, or run code analysis on a single file to name a few options. In Visual Studio, all of the CMake configuration that is normally done via the command line is moved into a CMakeSettings.json file, but with Visual Studio 2019, we have introduced a CMake Settings Editor as an alternative to editing that file directly. So here you can see, I'm prompted with a few properties for me to edit that'll make it easier for you to get started with CMake. There's some general ones like configuration name and type, some command arguments that are passed directly to CMake and a new section called CMake variables and cache. So I've already generated my cache, but if I were to click here, I will be prompted with a list of all the CMake cache variables available for me to edit. And you can use this functionality, like you might use a tool like the CMake GUI to help diagnose issues with your CMake lists. Advanced variables per the CMake GUI are hidden by default, but I can click here to see the full list. And I can also filter variables by name. You can also use this functionality to modify the value of any variable you see here by simply clicking the value column and modifying it. Modified variables are automatically saved to the CMake Settings.json file and variables defined there are ultimately passed to CMake via the command line. So the only piece of configuration I needed to do to get this working for Windows was to pass CMake the path to my toolchain file. But if you're using VC package, then VC package now automatically integrates its toolchain file with Visual Studio so you can bypass this step completely. If you haven't heard of it, VC package is a command line package management tool for C and C++ libraries that runs on Windows, Linux and macOS. And I was able to install all of the dependencies I needed to get SuperTux working on both Windows and Linux using VC package. So quickly, all of the dependencies you see here could be installed with a simple command, VC package install library name. To the left, we have a configuration manager where you can easily toggle between existing configurations or add a new one. We have template support for targeting IOT devices, remote Linux machines, MingiW Windows machines, and now in Visual Studio 2019, you can target an existing cache. So for a normal CMake project in Visual Studio, Visual Studio will generate and manage all the details of your cache for you. But now you have the ability to point Visual Studio to an existing cache that was generated outside of the IDE and so that you or your preferred tools have complete control over your cache and your build tree. So for example, if you have a script that automates the way CMake is invoked, you can continue to use that alongside Visual Studio. I have already set up a Linux configuration targeting a Linux VM. So I'll go make that my active configuration, select the startup item, and wow, this is running quickly in the background. You can see that the CMake settings editor for a remote Linux configuration is almost identical to the one for a local Windows configuration with a few additional properties exposed that are specific to our remote build. So for example, remote machine name, CMake will automatically pick up on any remote machines you've configured in Visual Studio, but if you need to add a new one, you can easily do this in the connection manager and click add. We don't have many restrictions on the distro that you're connecting to. All we require is SSH, working C++ tool chain on the remote machine, GDB, and if you're using CMake, then a relatively recent version of CMake also on the remote machine, but with Visual Studio 2019, Visual Studio will now automatically detect if the machine you're connected to doesn't have CMake installed and can automatically deploy those binaries for you to the remote machine. So it looks like this is done. So now if I toggle over to my VM, I will see Supertex, but this is now a graphical application running in my VM and I only have 15 minutes here with you. So I'm gonna go ahead and switch right back to my Windows configuration. So I'll select city six to bug. Again, the startup item. And so you can see that Visual Studio allows you to target multiple platforms easily from the comfort of a single IDE. The Supertex game that I'm using is an open source project. You can find it on GitHub. And again, I used VC package to install all the dependencies I needed on both Windows and Linux. So it looks like this was done building. And now we see Supertex. Hopefully you can hear it too. So story mode. I'll play it a little bit. Still in debug mode, so it's a little slow sometimes, but once the game starts, it's usually good. All right, so this is Supertex. Similar to other games you might have played before, but a good one. I think I'm actually gonna go into the options menu and turn the sound up a little bit. So options, go down to sound volume. And as I'm toggling through here with the arrow key, it looks like these volumes are not in order at all, like they're supposed to be. In contrast, you can see that these music volumes are increasing in order. So I think I'm gonna try to figure out what's going on there. So control T brings up go to all, which is a way to easily filter your searches to lines, files, members, types. So I'm gonna use F to limit my search to files and navigate over to the options menu.cpp file, which is where most of the logic surrounding the options menu takes place. And it looks like I have to do that I have not yet done to sort the sound volumes. So here I have a vector of strings called sound volumes and I'm just gonna sort it. Sound volumes. So normally, IntelliSense memberless suggestions are sorted alphabetically, but with Visual Studio 2019, we have an entirely new experience for C++ developers called IntelliCode. And IntelliCode will use the context of your code to suggest the most relevant suggestions, put them at the top of your list and indicate them with a star, as you can see here. So here I'm being prompted with begin and then as I continue coding, I'm prompted with end, which shows that my IntelliCode suggestions are changing based on the context of my code. IntelliCode trains over numerous real-world projects, including open source projects on GitHub with over 100 stars, and for this reason can give great suggestions for commonly used libraries. I'm also gonna pass in this less than volume function, which is also a part of this code base. I can quickly preview what that looks like for you as my comparison function to sort. It's also a part of this options menu.cpp file. So I'll go ahead and set a breakpoint here, which should be hit when I go into the options menu and make sure that this is working. So options, and all right, good, I hit my breakpoint. So now I can leverage something called Just My Code Debugging. And Just My Code Debugging automatically steps over calls to system, framework, or other non-user code. So when I press F11 here to step into, I'm automatically gonna step into the less than volume function instead of stepping into vector or the implementation of stored. So I'll press F11, and I'm brought straight to a less than volume or user code. I'll step out of that, press F5 to continue. And oops, it looks like my sounds are now in order. All right, so the next productivity feature that I want to show you guys today is called template intelligence. So C++ developers using class templates or function templates can now leverage the full power of intelligence within their template bodies. So you can see here inside of this template, I'm not getting memberless intelligence. But if I go up here and specify a sample argument of a roadblock, then you can see I'm getting relevant memberless suggestions like get level or get type. I can also hover over R and see the R as a roadblock. If I wanted to go back and specify a different sample argument, so now I'll say snowman. Then I could leverage this drop down menu, which shows me my most recently used sample arguments and makes it easy for me to toggle between them. Visual Studio 2019 also now has quick info on closing braces. So if I hover over any closing brace, you can see I'm getting information on the first line of this if statement, of the for loop and of the function itself. The last thing that I'm gonna show you guys today is some improvements to our code analysis. So code analysis will now run automatically in the background on file save or whenever you open up a new file. So you can see here if I scroll down that I'm getting a code analysis warning indicated with the green squiggles that is warning me to use null pointer rather than null. And so for this specific code analysis rule, we have implemented a quick fix. So if I click show potential fixes, Visual Studio will show me what this change would look like to my code. And then if I apply the change, it'll make the change to my code in this instance. This particular code analysis rule is actually not on by default. And so I can show you how to manage your code analysis rules for a CMake project in particular. You can manage it using this ruleset file. And here you can inherit from different rulesets or manually specify exactly which rules you want to be turned on to give you either warnings or errors. So you can see here, the only one I've turned on right now is this use null pointer instead of null warning. But here I could easily customize that for my project. And for CMake, you do have to pass this ruleset file as an argument to CMakeSettings.json as a code analysis ruleset in order for CMake to pick up on it. And that's about all I have for the demo portion today. We can switch back to the slides now and show a full list of what's new. So yes, this is the full list of everything that's new with Visual Studio 2019. I only had a chance to talk about some of it today. So if you have questions about some of the things that we didn't cover or some of the things that we did cover, you can reach out to our team via Twitter or to either of us or check out blog posts. A lot of these new features have blog posts accompanying them showing you what's new and how to use them. There's two features in particular that I do want to call your attention to that I didn't have time to show today. One of that is Live Share for C++ Developers and another is a 64-bit out-of-proctor bugger process. Both of these features are covered in sessions similar to this throughout the day. So as a C++ developer, I would highly recommend that you go check out those two sessions as well. And that's about all that we have for the session now. I think we can transition to Q&A. Q&A, thank you, great demo. Fantastic, now the last time I wrote C++ was a very long time ago. Like I feel like I'm the first time I learned to drive stick ship. I feel like that's C++ and only experienced like good programmers can do that. So I'm gonna ask questions that come on and then I'm gonna try to ask questions from my own small brain when it comes to C++. For cross-platform C++ build, will VS 2019 maintain duplicate copy of source code, one in local and another in a remote machine? Consider I try to build for Linux platform for Windows environment. Yeah, so if you're targeting a remote Linux machine, you can copy over your sources and it's usually on by default except if you're using an existing cache. But basically that's also a part of the editor. So if I go down to the advanced settings here. Let's get your screen on there so people can see what you're doing. There you go. I'm back in the CMake settings editor. My Linux configuration is active right now and there's a checkbox here that says copy remote sources to the remote machine and also the copy sources method that defaults to R-sync. Fantastic, so here's the thing like, and this is, I saw this a while back. You're able to actually write C++ code in Visual Studio and debug it in a Linux environment. And not just debugging. I think one important thing to call out is that while we're moving the sources, the build actually happens on the remote machine as well. So it's not a cross compilation experience where you kind of have to move the whole Linux environment onto the Windows machine to get those binaries created. Like everything builds on the machine as if you were building the command line, whatever experience you're familiar with inside, building on the Linux machine you can bring it inside Visual Studio and Visual Studio can automate that for you. Did you want to add anything to that? I feel like you wanted to say something. Oh no, I was just in agreement with what Mary was saying. Fantastic, she's in agreement. All right, here's another question. For VS 2019, can we have one solution containing both CMake and C-Sharp projects? That was not possible in 2017. So that's a very interesting question. The CMake, so CMake as a tool, built by Kitward does have some support for C-Sharp projects. You can interoperate between C++ and C-Sharp. Now, when you bring those solutions, those CMake projects inside Visual Studio, you're not gonna get the assistance you're familiar with for C-Sharp projects. So that's something that we're considering as one of the suggestions that we can improve the Visual Studio experience right now. For now, you will have to switch between solutions and the native CMake experience to get also C-Sharp, like nice intelligence and debugging capabilities. Awesome, another question. Do I need to install build tools in remote machine for building cross-platform C++ applications? In VS 2019, consider I am building app for Linux from Windows, do I need to install GCC, G++ remote machines? So yeah, as Mary was saying, we're really just driving the build on your Linux machine. So we do have a couple of dependencies there working. Yeah, GCC, GDB, R-Sync, and SSH are the dependencies that you will need on the Linux machine that you're targeting. These are really good questions that we're getting. I'm so glad, because I would ask dumb things like, hey, you know, how do you manage pointers? Is that still a thing? Yeah. They're laughing at me. Don't manage. They should be laughing at me. Does cross-platform compilers come with VS 2019 installation? That's a good question. We do have one GCC cross-compilation tool set that ships with the Linux workload, but that's specifically targeted for ARM. And beyond that, you can add any cross-compilation GCC tool so that you have and configure them inside Visual Studio. So we don't limit to that, but there's only one coming in in Visual Studio. Awesome. Did you want to add anything? No. Okay, good. Sorry, I assume the question was for Linux. Yes. Because for Windows, we do ship cross-compilers for targeting ARM64, ARM x86 x64, and we have the full metrics of architectures that we support for Visual Studio. Like they're inspiring me now to go and do something in C++. You should. You should. Probably catch my machine on fire is what I'll do. So let's do, yes, 2019 claims C++ 14 full support, but actually lacks an obscure C++ 11 and later feature pragma. I was gonna say the same thing. What's up with the underscore pragma, capital P? Underscore pragma doesn't come up often enough. We should talk more about it. So we do have support for many of the C++ 17 features in the product. We do consider that we are in the compiler, we have implemented all the features from C++ 17 and beyond. We should follow up on that particular feature. Maybe they ran into a bug that they assume doesn't work or maybe that's something that's still on the backlog that we should basically clarify the state of. I'll follow up offline on Twitter, maybe. Absolutely, yeah, we wanna know. Like I don't even know what it does. I remember pragma with hashtags. Yes, pragma. We didn't call them hashtags, pound prep. From Keith, what do we have to do to get our G test to show up in the test explorer? So all you should have to do is get a build and as soon as the build ends, test explorer will go collect all the binaries from the build and populate test explorer with those tests. That should be true for both whether you're using MS build projects or using CMake projects. Fantastic, so I'm gonna go and do some C++ things in Visual Studio. I honestly love the debugging stuff that you showed, like clarifying what the T was and then having, that was amazing. What should I go start with? I haven't done C++ in a very long time. I had a very bad experience in college with C++ because my professor, I did the Minimax algorithm which is AI old school and he was measuring memory leaks and I failed it. I gotta see, yeah, and so it's burdened me ever since. So what can I do to go back and how can Visual Studio help me with C++ if I'm a newbie? I think it's the right time to go back because with the new standards, C++ 14 and C++ 17, the language has changed significantly. So like dealing with memory leaks is a lot easier now if you use area eye wrappers and smart pointers. We do have tutorials on Visual Studio.com so I'd recommend anyone to go in and try the hello word and the calculator tutorials that we have on the Visual Studio docs. And hey, if you ever get stuck, ask us questions. We're here to help. We always try to improve Visual Studio to make it as accessible and approachable to people that are just getting started to learn. So, final words? Yeah, no, we have been working on our gains third experience and so hopefully there's some tutorials out there if you are new to C++ and with some of these changes, 2019, things are easier for someone who's new to Visual Studio, new to C++, new to CMake, whether it may be to navigate and make sense and be more productive with Visual Studio. Well, thank you so much. I feel a lot more confident. I might go do something and see, I might go reimplement that Minimax algorithm. I might, I really am.