C# Tutorial For Beginners & Basics - 1. Installing Visual Studio 2022 & Quick Tips

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys this is teddy welcome to my youtube channel in this video i'm going to be doing a very very long awaited video this is a video that i've been looking forward to making for a long time and i'm almost getting butterflies just thinking about the anticipation leading up to this video um i am a professional c-sharp developer i love c-sharp sharp has provided me with an insane living that i can only you know dr like i could have only dreamed of like the lifestyle that i live now and i'm such a proponent of c sharp because there's so much opportunity in it like there's so many jobs there's so many high paying jobs and i honestly just love exposing people to c sharp and showing people this enthusiasm because it really gets people excited and i think it's also when people get excited about programming because you're going to open so many doors in your life that you're not even going to be able to handle it and the fact that i am able to actually get out here on the internet and teach people how to learn c-sharp is literally mind-boggling and i went all out on my setup i've went all out on my mic just so that this can be hopefully the best course that you have ever seen on c sharp and i'm gonna make it weird i'm gonna make it fun and we're gonna have fun through this whole entire thing and i want you guys on this journey as we climb to the top of the c-sharp mountain and hopefully you will all you know get jobs and realize your full potential which is what programming is all about so let's go on this journey i've even uh i've got a whole gaming pc that i've uh wiped i wipe to clean a whole entire gaming pc so we're literally starting from scratch on this one we're installing visual studio on image on a clean machine clean setup and i'm going to be right here with you guys and we're going to crush this thing together so first things first um you're going to need visual studio i've thought about making like a visual studio code tutorial but if you're trying to become a professional c-sharp developer you're going to need visual studio if you are somebody who has a lower power pc and pc power is a big thing um vs code might be something you want to look into but if you have eight gigabits of ram solid processor you're probably not going to have too much trouble with running visual studio what is the difference between visual studio and visual studio code visual studio is going to have everything that you need to be a professional c-sharp developer that includes uh more industrial i call it industrial grade debugging you've got lots of extensions you've got all types of diagnostic tools and everything like i said everything's going to work straight out of the box it's the great thing about visual studio is that you can get all the tools in visual studio code but with visual studio a lot of the things that you're going to be doing as a professional c-sharp developer are done with a gui it makes things easier it is a little bit more complicated to learn but i'm going to give you guys a couple of hit a couple of hacks couple tips so that when you're out there you know doing your thing you don't get too tripped up and i'll almost include a visual studio tutorial too here in a second so let's just go ahead and dive in here we're going to pull up just pull up google chrome any type of any type of browser will work and let me see here um oh nice little green so let's go ahead here and type in name teddy google chrome's gonna take me through all of this i don't even know what this is but just type in visual studio [Applause] download yep this is the one that you want you don't want mac you don't want visual studio code you probably want visual studio code for javascript but for c-sharp development you're going to want to download visual studio you're going to want to click visual studio community unless you are already have a job and they're going to provide you with that when you get a job they're going to provide you with all of this so you're not going to have to pay just use the um community edition that we have right now and this has changed this not this used to not be as complicated so we're kind of learning together guys i don't know um okay yeah here it is right here what was i thinking okay silly me all right so we've got the installer the great thing about visual studio is that a lot of this is just going to be automated like this is all going to be done for you um it's relatively straightforward but i'm going to go ahead and kind of walk you through it so you're going to get right here oh sweet there you have dark mode so you want asp.net web development you want azure if you're going to be working a professional environment you probably i would install azure for now just in case but you're going to need this if you start working or if you start working on serious apps you're probably going to need azure i'm a python hater i've you've already seen some of my other videos on why you should not code python because i coded in python for years and never got a job in it another story for another time node is the same story node is the exact same thing i always err on the side of don't download download these separately because whenever i have downloaded a clean install with either one of these like it just never really works like that great and we also want net desktop in theory you really don't need net web development but for all intensive pers purposes if you're a self-taught developer like i was and you're trying to get a job you definitely want to start looking at web development and net but if you really just don't want to install anything i guess you could just go with the desktop although i would not recommend it you could also do mobile development if you want to do mobile development too tons of xamarin jobs but for this video we're just going to stick with the relative bare essentials and go ahead and hit install so as that's downloading i guess i will just talk about what is dot net what is you know what are all of these terms so if you probably already heard of c sharp dot net is going to be more so it's a framework that you're going to be using it's almost like dot-net is an all-in-all and concept encompassing umbrella to where you can down or to where you can build desktop apps you can build web apps and you can actually build mobile apps as well and there's tons of other things that you can do but think of.net is almost like a framework that gives you the tools to make your development life a lot easier so let's say you want to code some type of networking utility instead of having to dig into the internals and do all of these crazy um things that include you know designing like your own network protocol or something you could just have the net framework all of that would be done for you and it's more abstracted like i said in programming you're standing on the top shoulders of giants like very rarely do i design any of my own software most of the time i'm using other people's software and look at it like that don't get so freaked out and programming that you know i'm gonna have to design like my own um you know networking protocol or you know i'm gonna have to design like my own program to make my own desktop applications all of these tools are given to you in visual studio and it's going to be easy to do there's also talks too many people want to know you know what makes c sharp you know why do people even code in c sharp c sharp is going to be a good medium between a very uh abstracted language like python and a very low level uh uh programming language like c or c plus plus so you're going to get a lot of the abstractions and productivity that you get with python like you're you know you're not going to have to dig into the internals as much but you still get the flexibility or in the robustness and kind of the uh preciseness i guess the word would say of a lower level language and you kind of get that middle in between ground so this also has to do there's also a term called the clr like what is the clr you're going to see that term a lot so in a normal programming language the compiler does all the work and it transmits it and or it turns it into byte code but with java and c sharp you also have another little layer there or another little part of the sandwich as i call it to where first you have code then it's computed through the clr and then the clr turns around puts it into the compiler and then the compiler turns it into bytecode and that's how you get the ability for c uh sharp to be run anywhere that's kind of the jvm with java too so if you've ever heard of the jvm um the clr there they are different like i'm not gonna you know i'm not an expert on these things they are different the jvm is different from the clr but think about like that it's an extra little you know middle piece of the sandwich that makes it so that you don't have to write like this crazy low-level code and you can actually just uh write very abstracted code that's very powerful and can be run anywhere so here we go we are downloaded we are at 67 so kind of running out of things to say kind of get a little bored here so in this case i'm just gonna cut it out gonna wait till it actually downloads and then we will jump right into the code okay so we have installed visual studio next thing that we need to do is simply just open it like there's nothing there's no real secret you just open it so uh my camera died in the process of making this so i actually have like a couple open but the main thing here is this is just a splash screen i really wouldn't get too you know hot and bothered about this one what you want to do is you just want to create a new project next thing you're going to be brought to this little screen right here this is where you choose what type of framework that you want to use like i said mentioned before dot net framework gives you major capabilities when it comes to creating web websites mobile can't do mobile because i didn't install xamarin if you want to make mobile apps you're going to have to go back to that install screen like i showed you and download xamarin because i didn't actually install it there's also cool there's like blazer down here blazer may do a tutorial on blazer but for this for these circumstances what all that we need is we just want a good old console app and if you're familiar with hello world or any type of console app that's uh you know it's relatively simple and if you don't know exactly what it is i'm going to show you so we're just going to call it hello world tutorial because i already have one hello world app for where my camera died so going in here we're going to be using dot net six probably wouldn't fool around with this one um if you're using net 6 or net 6 or previous you're going to be shown a i'll show you exactly what it looks like uh pull pull it up here um see yeah i actually googled it just so i could show you guys beforehand so this is what you're going to be showing if you download before.net 6 you're going to have this little thing.net 6 doesn't actually have this um this is an entry point for the program so with dot net six you're actually not going to have any of that and you are just going to have what i'm about to show you um so so more on this so an entry point as it's sometimes called is where everything starts it's almost like the point of conception with you know the ovary and the egg and you know if you take in sexual education you know what i'm talking about it's like the point where everything starts in the app and even large apps like even if you had like at my work there's a point where that app actually executes and this part right here is what that is it's the point of origin for the app and for you to actually execute code before this you had to have it within this function so kind of a confusing topic and it takes a while to like actually understand like how this work like you can understand how this works like just from me explaining to you but to understand understand how this works takes a long time so we're just going to kind of it is something you don't even need anyway so when you first start visual studio it's a lot to take in like i'm not uh you know even gonna like seeing this for the first time can make your eyes glaze over but one of the first things that really trips people up is most people are used to visual studio code i'm i'm actually used to visual studio code so i just bring this over here um and i think that that looks a lot better and actually get rid of that because i you never use that and down here is um where you can uh manipulate your package so packages and net are kind of like node packages or um node modules or like when you type in npm install um there's nougat or nuget some people call it so a new jet package is almost like an npm package in node.js or it's almost like a pot like when you do like pot like python where you have to bring in like um cv or something or you're bringing in some type of module it's the same exact thing but it's got a nice little gui and um you probably a huge portion of your life is going to be spent in this right here so one thing that people really kind of like get freaked out about is what's like a solution in dot net in the microsoft world your whole entire project in order for it to uh work well with visual studio it's going to be wrapped in what's called a solution because in any programming environment you're going to have multi like in this one we only have one but if you work in multiple uh or if you work in a production environment you're gonna have many of these and this solution is like what wraps all of these projects into one and it helps you keep track of them so the solution thing like uh throws people off a lot uh many people are wondering like what is this like what is the dependencies you never are going to usually fool around with the dependencies mostly when whenever you are looking at a c-sharp program this is going to be the most important part uh cs is what you're going to actually be writing code in and what is actually going to be um you know manipulating the program or like what you're actually going to be coding in so what is like how do you actually get this thing to start like what does it entail really and even in a web development in a mobile environment the way that you get your program to run is you just go up here and you click that's pretty much it so we're going to click it it's going to run and you're going to see a bunch of gibberish here but really what's going to happen is this just this window is going to pop up you're going to see hello world and that is pretty much it it's um it's a console application it's not sexy and for most like 95 percent of people you're probably not going to be using the console application that much like console applications are mostly for your uh learning purposes like let's just put it that way so we'll go ahead let's go in here and let's type let's do something a little bit cooler than hello world so we've got all of this uh up here you've got your new console template which will tell you a little bit about what it is so console right line like what is a console why do we even have like why do we even have a console and why is it even called why can't you just type in print to screen or print like python does um c sharp is a older it's a lot older of a programming language and i think a lot of this stuff is just left over from uh previous you know i think there's a saying like steve jobs like one time i heard steve jobs say that if you look at programming enough a lot of times you'll see the bedrock and this is kind of like the dinosaur bones of the past age of when people actually were worried about console apps like you had to print stuff to a console and back in the 80s or back in the 90s a console application was probably a pretty big deal before nowadays when we're so leveraged and we have all these crazy mobile apps so a console is another chunk of code so we go in here we type in console writeline and we're gonna make this one insult us so we're gonna say you are a noob we're yeah we're ultra elite so double zero you are a noob one important thing that you're going to have to realize about net or c sharp is that you need semicolons if you don't put a semicolon after each statement it's not going to work and it's going to give an error so let's go ahead and let's see what it looks like when it gets an error so if you get an error you're going to get this screen you can click don't show this again but i just click no and that's when it's going to show an error for you and it's even going to tell you down in this part right here what was the actual error and it's going to tell you the exact same thing we need a semicolon and give it a minute it will check it boom and let's take a little bit hopefully it works i don't see why it wouldn't okay i honestly don't know why this isn't working could just be okay there we go yeah i don't know sometimes it just messes up like that i honestly i don't i don't know what that was but so you type in this console right line right here this is going to pop up in the debugger and that's pretty much it so next thing i'm just going to give you guys a couple more tips here if you ever like mess up this right here and you can't get it the way that you want it you can just type in reset and you can just type in reset window layout and it will automatically uh reset everything for you um once again there's no hard and fast rule about how you need to actually lay stuff out you can lay it out however you want to and that's there's you're not going to have to worry about any type of like standardized way that you should actually lay all of your stuff out so that's another thing another very important um tactic that you want to learn is you want to learn how to debug debug is very and crucial debugging is so crucial in uh development so in this case we already have the debug it's going to debug by default if your computer is very slow you can debug uh you can start without debugging or you can start with debugging if you want to start without debugging and you don't want to have that debugger um you can go ahead and press ctrl f5 but for this purpose let's go ahead and let's make a couple variables so bar test bar and we're going to pass in just some quotes and we're going to type in noob make sure that we have a semicolon because you cannot start it without a semicolon and then we will go into here type in our console.writeline you can tab tab to accept it and we're going to go ahead and the intellisense works phenomenally so we're going to pass in our variable right here and we're going to debug it simplest program to debug and this is very important uh i've never seen anybody else teach anybody like how to debug so when you debug what it's going to do is it's going and this is amazing like uh these tools are absolutely phenomenal so you're going to go in here and it's going to give you it's going to tell you like what all these values are and it's really awesome because a lot of times you can see all types of really cool uh values like you can't see when the program is actually running so i implore you to just kind of go in and check out some of uh just to debug something just like get get a little curious you know let just see you know what's going on with the program and debunking is going to be the perfect way to do that and the way that you do it is you make sure you set your button and then you go up here and you go to as you want to execute it you type in step over and then it's going to step over into the right line and once again it has executed we are a noob it's okay takes a while to become a master i should know it took me two years to become a programmer uh but yeah we are noobs but that is okay we are going to keep going and hopefully our computer won't insult us anymore and we can finally move on to doing better core things and learning some more so hopefully oh another thing another great trick that i'm going to teach you guys is like how do you actually like inspect things like what do you want like if you want to see like what's in this right here what do you do all you do is you go to you right click and you go to definition and you can see what's in like you can actually see kind of the source code you can't see the whole entire thing i think a lot of the stuff is they have yeah they just give you a summary they don't actually let you like go in and see exactly what it is they could but you can see a nice little summary of what it is and you can kind of whoa like what's all this cool stuff this is all extra think of this as you go into the options section and you can kind of see like what's going on behind the scenes and you can add like your own properties and be like hey what if i want to pass in an object oh sweet like i could pass in an object or you know what if i want to you know do some other thing what if i want to beep hey i can beep and you would have never known that if you didn't go in there and actually like look into the if you didn't go to like look at the definition and i'll show you guys how to do that one more time just for uh yeah and you can also press you can also peak it if you don't want to actually lose your place and go to definition and another thing is is that there's also go to impul if you click on that and it doesn't go anywhere next thing you want to do is you want to go to impul and implementation and it will also hopefully do the exact same thing there's a little bit it's a little bit more complicated than that but just so i don't confuse the beginners just cook just do the impul and you're going to be good to go but anyway that's going to be my beginner c-sharp tutorial i really hope that you guys enjoyed this video stick around because there's going to be way more coming we're going to be doing variables next i hope that you guys enjoyed this video if you did smash that like button make sure to subscribe make sure to check out some of my other videos love you guys and as always thank you for watching
Info
Channel: Teddy Smith
Views: 162,083
Rating: undefined out of 5
Keywords:
Id: 67oWw9TanOk
Channel Id: undefined
Length: 26min 25sec (1585 seconds)
Published: Fri Dec 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.