Visual Studio For Beginners - 2022 and Beyond

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
with so many people using vs code these days we sometimes forget about the visual studio ide which stands for integrated development environment despite supporting only a handful of languages it still has a lot to offer to people interested in c sharp or c plus plus but where and how do you get started hi i'm victor and today on height above sea level we'll be taking a tour around visual studio [Music] before we get started if you want to talk more about this kind of thing be sure to follow me on twitch at height above sea level where i do some live coding sessions as well as try and answer some of your questions as best i can we'll first need to make sure that you have visual studio installed so head on over to visual studio microsoft and over here you'll see three options visual studio visual studio for mac and visual studio code if you have a mac then you can try visual studio for mac but this is the one i'll be downloading visual studio and this comes in three options community 2022 professional and enterprise community is a free version and it's free for individual developers academic uses and open source professional and enterprise are paid so go ahead and download community click on community and you should see a download at the bottom of your screen bottom left screen click on that and it will say visual studio installer do you want to allow this app to make changes to your device go ahead and click yes and since i already have it installed it won't have to download or install so yours is going to take a little bit of time to do that but just be patient and it should show you this screen as you can see i have visual studio community 2022 version installed but this is what's going to show if you have none of these installed so there's enterprise professional and the older versions 2019 that are here as well so let's say professional 2022 is the one i wanted to download so i'd click install so this just follow the same step if you have once you've clicked on the link to download community 2022 now you have a couple of options for web and cloud let's say asp.net if you're a web developer if you want to do a desktop you can have xamarin and if you're in gaming you can do game development with unity and this is exactly the same screen as i have right here in modify so what you're going to do is this is the one you're going to need net desktop development because we'll be working with a console application but if you're a web developer you can go ahead and do asp.net web development and if you're into unity and game dev download the game development with unity which i do plan on using later on with more videos so if you are interested in following along with those in the future you might as well download this this game development with unity once you've checked at least.net desktop development go ahead and click install while downloading or download then install whichever one works for you and then it will download and uh it'll be ready so once all that is done and you have a shortcut like i do down here click on that and microsoft visual studio 22 2022 should show up like this and so this is the first thing that you'll see it might ask you to sign into your microsoft account which if you want to you can feel free to go ahead and do that but once all that is set up this is what you should see so what we're going to do now is we're going to create a new project we're going to create a console application so like as you can see i have it here because i use it recently but if you don't have it recently you can come over here and type console and it should give you the options down here so console app this is the one we're using dot net core because that's the latest version and make sure it's this green c sharp because we'll be writing this in c sharp this is visual basic and it's a console app but this is not what we will be using we'll be using c-sharp so with this selected click next and this is where i will name the app so we can call it my first app and a little bit of insight is that a little bit of helpful information is don't put spaces because if you do this visual studio will automatically just put underscores for you like this so this is what it's going to look like if you like the underscores you can do it that way but i prefer to use this thing this format called pascal case where the first letter of every word is capitalized and if you're not familiar with pascal case and camel case i have a video up as well it's called naming conventions every programmer should know that you can check out and it should bring you up to speed so check it out if you have time but moving on you've called it my first application or my first app this is where it's going to be saved you can see it in your c drive for me c drive users vector source repos and this is the solution name solution is just a container for your projects and your projects are where you write your code you can leave this unchecked go to next and this is dot net six so there are other versions of dot net like net five dot net framework dot net standard and so on and so forth but dot net six is the latest version and as you can see it has long term support so this is the one we're gonna be using but there are previous versions just so you know and i think you can find them dot in visual studio 2019 but this is the one we'll be using once that is checked and as you can see dot net core c sharp line lines mark windows so it's multi-platform click create and just give it a second or two and here we are so this is visual studio running this is the console.writeline hello world it writes hello world to the console and we'll look at that in a second so before we do that in previous versions you may have seen something like this like a class called program like that and then you had a static void main like this then maybe string array and then something like this odds so this is the old version of doing it another doing it but how the older.net versions the template looked like it had this program class and this method called main that main method is the entry point for every application even console applications so and all the code that you need to write in a console application would go in here but since this is dot net six they went ahead and made it so that anything you write in this space is as if it's being written inside here so it's all going into the main method and that's why we don't have it if you want to learn more about that you can press left control and then left click or any control and press ctrl and left click and that will take you to this explanation all right but as you've noticed some of my colors may look a bit different from yours and that's because i'm using a custom theme i call it the sakura theme and i made this because i like the colors and it is available for patreons on patreon once i have that set up the link will be in the description below so if you wanted this theme then i will have that available for patrons and uh yeah if you like it let me know in the comments below now moving on let's take a look at visual studio so we'll start with the navbar up top right here so most of these work just like in other programs that you've used before like file new let's say a microsoft word you've done this before you're making a word document you can say file new new word document but for visual studio you can say new project just like we did before a new repository a repository is a place where you store your code and it can be local it can be online in a in a place like github and then you can open a project or solution a particular folder with code files you can clone a repository cloning a repository is making a clone of a collection of your code whether that's online or locally but most of the time people use this online you can add a new project these are self-explanatory close save you know like when you're saving a work so you don't lose it print exit closing it recent files just opened file is pretty much self-explanatory edit you can undo control z is the same you can go to another file remember a number of uh a number in the code and a line number in the code you can find and replace just like you did in regular programs cut copy paste duplicate delete and all the shortcuts are here on the right side so if you ever forget or you want to move a little bit faster you can use these shortcuts go to advanced bookmarks outlining these things you won't use so much but i'm just letting you know now just so i can build a little bit of a foundation and get you started now view this is where if you ever forget or if you ever lose accidentally close one of the windows just come here and search for it an example of a window is this right here to my right the solution explorer let's say i opened a project and this was missing let me not close it there we go so i'll be like where is the solution explorer it's not there so i come up here view solution explorer there we go this is where most of your files your folders and your classes will go like you see this program class that you have here i can save that for a second and then open it again there it is so if you want to see a window this is where you go if let's say you're working with database sql server object explorer there it is you can close it i can find it here again any window the terminal the team explorer but the thing you'll be working with the most is the solution explorer and as you progress you'll work with get changes repository but that's for later on this is just an introduction and speaking of git here's a get window if you want to look at the repository again repository is where your code is stored it's like a collection of where you store your code your code if you do that online or locally and if you have any local repositories that means it's saved on your computer not online like these are the ones i have or you can commit means adding saying making a change and saying that i'm ready to add this to my code but this is you don't need to worry about this for now but just have it in the back of your mind that this is where your repository will be under the sketch window project you can add a class this way add a new item a new item is just an ambiguous way of saying maybe you want to add a class maybe you want a controller if you're working with web development or if you want to add something else so item is just ambiguous you can show all files and create a new folder create edit project file you can look at the properties of this project and that's all anything related to this project right here you can find inside this project window build when you want to build a solution you can come here or you can just press ctrl shift b building a solution is like telling the the computer hey i've written some code and i want you to look over it so i want you to run this code so once it builds you will look at all the lines of code and it will say if it's perfect if it's okay it will say okay the bill succeeded but if the errors will say excuse me there's an error over here there's something wrong over here and i need to look at that before i can continue execution so please change it and anything related to that errors warnings you'll find that in the build and you can also rebuild most of these units use that often so build is the one that you should remember debug like the name suggests this is for when you're looking for the bugs in your code maybe you had a typo or you missed a semicolon you can come over here to debug you can start debugging if you press f5 and what this does is when you're debugging once you you can put breakpoints breakpoints are just places in your code where you want the code to stop execution so you can study the the variables such as the number the state or what have you or the errors so if you put breakpoints like this maybe i can show you if you press f9 f9 this is a breakpoint so if there's code above this it will execute but it will stop right here and then i can inspect what's going on over here and you can also remove the breakpoint with f9 again and back to debug again you can start without debugging which is almost like you're just starting the application to see how it works the same way you can open an app on your phone or you can start a game that's you start you're starting it without debugging you also test the unity profiler the performance profiler is where you if you want to look at where the bottlenecks in your application like you've written some code and it's working it's running a bit slower on some places and it's running back on the other you can use the profiler to see where those errors are those slow areas are and what you want to do with that information once you know what's the problem stepping into and stepping over our stepping overs when you want to manually execute the next line of code stepping into is like you're going into a code block to see to see more about it where it's defined and what are the other variables it uses and options as well test if you want to test this for unit tests so unit tests is code you write to test your code if you've written some code to test your code this is where the test will show up but we're not doing anything with tests but if you do so in future this is where it is analyze i haven't used analyze so much you can code cleanup i think it's just like refactoring the code the way it can but i've never used it that much tools is where you go to change your options like if you can change your theme over here speaking of things again mine is called the sakura one uh you can change you go to options options you can look at fonts and colors you can look at extensions you can look at keyboard shortcuts anything you want to customize just go to tools then options and you'll find it extensions are like small programs that you can use visual studio 2022 or any other version of visual studio to make things a little bit easier like let's say there was an extension that every time you do an opening bracket it types the closing bracket for you that's built into visual studio but let's just let's just assume maybe or something like that or maybe if you want to write like you can see this is a intellicode if it says it's predicting that i want right console.writeline and what i'm doing is i'm pressing tab like i type console i press tab like it shows me twice and that's written for me let's say that that could be an extension so you can find those here window again self-explanatory if you want to split the window you can have it like this with top and bottom or you can remove the split you wouldn't really use this too much or you can pin the tab like this click here you pin the tab and unpin it help is if you need help all right i hope i'm not going too fast but if i am let me know well let me know in the comment comments below if this is helping and if i need to slow down in future videos but if i'm doing okay let me know in the comments below as well all right let's go over to the solution explorer now this is where most of your classes will be like we have a program class and remember class is just where you store your code all the connected code is stored inside a class and a class is like the building block of each application so this is where your project is the code like the program class which you use to write things on the console what you're going to do just now so if you press control and f5 remember to run the application without debugging it will write on the console hello world so let's try that control plus f5 see what will show on the console so this is the console right here as you can see hello world and that's what's up here you can go to the console again there it is and you can change this to anything like hello sir ctrl f5 to run the application choose a loser and i can say hello madam and i can duplicate this with control shift no no control plus d first need to highlight it like that control plus d duplicates the line press enter just to make things cleaner and i have helosa hello madame hello sir then i can duplicate one more time to hello there control on f5 to run the application and here you are your first application is written on the console hello madam hello sir hello there there you have it you've written your first application now you know let me add hello world just so we can have the world-renowned phrase hello world there you have it that's your first application and a little bit of insight on visual studio that's all out for you guys let me know what you think have you written code before why are you learning to write code and what's your inspiration for learning to program do you like visual studio over vs code if you've been programming before or do you have no preference let me know in the comments below also be sure to follow me on twitch if you want to talk more about this kind of thing live and stream and if that doesn't work come hang out on discord just click the link in the description below and become a member of the water tribe today thank you so much for watching and as always from me to you deuces [Music] you
Info
Channel: Height Above Sea Level
Views: 85,279
Rating: undefined out of 5
Keywords: visual studio for beginners, visual studio, vs code, programming, visual studio ide, visual studio tutorial, visual studio tutorial for beginners, visual studio 2022, console application c#, console application visual studio 2022, .NET 6, console application, how to program in c#, coding, code, learning c#, beginner, vim, sublime, notepad++, using statements, game dev, indie game development, indie game dev, game programming, programming in unity for beginners, unity3d
Id: VcU2HGsxeII
Channel Id: undefined
Length: 19min 36sec (1176 seconds)
Published: Tue Jan 11 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.