|
|
|
14:16 |
|
|
transcript
|
7:01 |
And we're live. Welcome everyone to... No, dude, this is not a live stream, Cecil. This is a course. Visual Studio Code for Python Developers, man. This is a course? We're recording a course right now? Yes, yes. I know you're used to doing live streams, but we're doing a course now. Oh, okay. So what course is this? Tell me, remind me. Visual Studio Code for Python Developers. Oh, that's right. Yes, that's right, that's right. Hi everyone, welcome to Visual Studio Code for Python Developers. What am I supposed to do now? Now we're supposed to talk about their instructors, Cecil. Your instructors for this course are... Me and you! Dude, we're recording a course! No, you. Oh, you want me to talk about me? Okay, go ahead. I'll talk about me. Hi everyone, my name is Cecil Phillip. Developer advocate and big, big fan of Python. And that's my picture here. Is this the right finger? Yes. There you go. And that's my social thing. So if you want to reach out to me on social media at Twitter, at Mastodon, and Bluesky, and all the things, you can probably find me at this... Handle? Is that what you call these things? Yeah. Some of these different places. But super excited to be here, super excited to talk to you all. And I am joined with my buddy, Brian. That's me, looking like a doofus, as usual. Yes, I am Brian, Brian Clark, go by Clarkio on the internets. You can find me on Twitter, and I'm Brian Clark. You can find me at that handle, either underscore Clarkio, because the name's taken, or just Clarkio. And yeah, I am a Python enthusiast, I would say. Cecil and I have live-streamed learning Python before, and that's what we were joking about before. And I've been a developer for many, many years. And I'm a developer advocate now as well. And I'm excited to jump into this course and teach you about using Visual Studio Code for Python developers. Assuming you're a Python developer. I hope you're a Python developer. I hope so, too. So, we talked about... What the course is, who their instructors are, but who's this course for? Python developers? Is that it? I think so. But I think even more importantly, why we're doing this course, because one, we're both fans of Python. But we're also both fans of Visual Studio Code, right? And in some weird universe, there must be a place where people like the two of those things and want to put them together. Right? And so, then there's the question, how do Python people Python on Visual Studio Code? So, we thought it'd be a great... I think it's a great way for us to kind of take two of those things that we're really passionate about and put them together and create a resource that will be hopefully helpful for all of you. So, if you're new or maybe you're a seasoned Python developer or maybe, you know, maybe you're an architect, but like you've never used VS Code before. Maybe this is the new thing for you, right? Everyone's learning something new. So, hopefully, regardless of whatever path that you're walking, hopefully you'll learn something from what me and Brian are going to share with you during this course. Yeah. And speaking of... What you'll learn being that you're in the right place, let's talk about what we're going to cover in the course. First up, we're going to help you get set up. Okay. If you don't have Visual Studio Code, if you don't have Python already, we're going to get you... Walk you through that process very briefly, just to make sure we're all starting off on the same page. Next up, we're going to be talking about exploring the editor. So, getting acquainted with the visuals of VS Code and how you navigate around there and what the names are of different components within the UI. So, you're going to be talking about the UI of Visual Studio Code so that you know what those terms are, you know what we're referring to throughout the rest of the course, and you're familiar with it and up to speed with all that. After that, we're going to jump into editing the code. So, what's the experience like writing Python code in Visual Studio Code? And how do you go about making sure that that is up to the most optimal settings and situation in order to be able to do that successfully and efficiently? Then we're going to be talking about managing environments. So, we want to talk about that real quick. Yeah. So, one of the things that folks that if you're familiar with Python, you might have heard about virtual environments or even setting up your workspace, right? What are some of those things that you wanted to do? And maybe you already have a pattern that you'd like to use already today. How can you do that with inside of VS Code? So, we're going to try and show you how to get everything set up so that you're, you know, have the best chance to, you know, do the workflow that you're used to using the tools that we're going to show you. All right. And then next, it's going to be running in debugging. Cecil, tell us more about that. Well, if we're going to write the code, I'm going to assume we're going to want to run it at some point. Yeah. Well, if you run it, if it doesn't work, you probably need to debug it too, right? So, how does that work in Python, right? Like, how do we engage with the debugger and, you know, set breakpoints? How do we use conditional breakpoints? How do we look at some of the debug output and, you know, some of the other diagnostic tools that are inside of Python that'll help you make sure that your applications are running the way that you're expecting them to? Very good. And if you get it running, there's... This is the next thing you're going to need to be doing, right? To make sure that what you are running and using is working as expected, right? Nobody test their code, Brian. Come on. Oh, man. You got me there. I'm guilty. Nobody does that. I'm playing. You all should test your code. Don't listen to me. Test your code. Please do. And we're going to talk through some of the different, well, testing support in VS Code for Python. It's not going to be an intro to testing, but it is going to show you how to run your test, probably look at some code coverage. And again, how to, you know, use some of the navigational features inside of Visual Studio Code to make sure that your testing workflow is as efficient as possible. Excellent. And last but not least, we're going to be talking about source control, where you and I are going to demonstrate together what the experience is like checking things in, making changes, committing changes to our code on a project that we're both working on and what that experience is like for a Python project using source control within VS Code. Visual Studio Code, right? Yeah, I think one of the things I love about programming and even just being in the open source community is how we can collaborate with each other. And I think Visual Studio Code gives us tons of great tools that allow us to collaborate. And one of those is source control, right? So, you know, I think it's important for me to know that if there's a bug, I want to look at the line of code and be able to blame somebody and be like, oh, OK, I wrote this. My bad. Yeah. All right. So that's what we're going to be covering. You're going to what you can expect in the upcoming videos is a combination of either myself and Cecil together talking about a topic of choice within the what we're going to cover here. But also sometimes it'll be us as individuals teaching you about that particular topic within that module. So that's what you can expect throughout the rest of the course. In the next video, we're going to tell you what you need to be prepared, like prerequisites, that type of thing in order to get started with this course. And then after that, we'll talk about some resources you'll be able to use or throughout the whole course. course. Awesome. Sounds good. See you in the next video. Sounds good.
|
|
|
transcript
|
5:04 |
Welcome into this next video. We're going to be talking about what you will need in order to be able to follow along with this course. First up, obviously, you're going to need the most important thing. What is that, Cecil? A computer. Yeah. One of the first things that you're going to need for this course, and we should have installed or we're going to talk about how you can get it installed, is Python. We are going to talk about Python and VS Code, so hopefully you have Python installed already. If not, we have some other videos later on in the course that are going to talk about how you can get it installed. But for those of you that are pretty new or fresh, Python is a programming language, and it allows us to do a lot of cool things like build desktop applications and microservices and web apps and web APIs and tons of cool stuff. So, again, we're not going to dive into how to use Python or the syntax and the semantics. But we are going to talk about how you can be productive using Python inside of VS Code. And speaking about VS Code, I'm guessing we're going to need to install that too, right? Yes. So you will need to get this in the getting started module. You'll be able to go into detail on all of this, but I at least want to give you a high level overview of what Visual Studio Code is. It is an editor. It is not necessarily an IDE, but through its plugins and extensions, you will be able to kind of view it as on a spectrum of like whether it's an IDE or an IDE. It is not necessarily an IDE, but through its plugins and extensions, you will be able to kind of view it as on a spectrum of like whether it's an IDE or an IDE. but through its plugins and extensions, you will be able to kind of view it as on a spectrum of like whether it's an edit, more of an editor or an interactive or integrated development environment. That is, because of the rich development experience you'll get with a lot of the plugins that are available to you in the VS Code marketplace. So VS Code is a piece of software. It's a desktop client, but also it could be used in the web, for VS Code.dev and it's built with web technologies. So things like JavaScript and Electron help make it possible to be used cross-platform as a thick client application, but then also in the web, in your browser, like I was mentioning before, it is open source. So if you went to github.com/Microsoft slash VS Code, you can follow along. You can build it from source if you wanted to, even it's completely free and, you can, you know, keep up to speed with the latest releases and, and the development. Activity on it directly in this open source repository. So now that we know what you're going to need, like Python and VS Code, I mentioned editors and IDEs. What Cecil, what's the difference for folks that aren't familiar with that? What's the difference between the two? Yeah, I think that's an important thing for us to like take care of off the bat. And for folks that are in the Python space, if you've been around for a little while, you might even have heard of a couple like PyCharm as an example. And PyCharm is a really good, Python IDE, right? IDE standing for integrated development environment versus an editor. And now one of the things that you get from your IDE versus your editor is, well, you usually get a lot deeper support for introspection and debugging for, you know, a lot of analyzers, linters, all these different types of things. And they're usually already pre-packaged and bundled and ready for you to go. Right? Python itself, again, it's, it's very focused on Python. We talk about this Visual Studio Code, as you'll see as we go on, it's a very extensible editor. It's good for editing code, and you can add extensions to it. You can customize it, you can tweak it, you can set whatever settings you need to set, so you can do what you want to do. But it is not an IDE, right? So again, out of the box, you can expect to have things like templates or syntax highlighting for your templating languages and all these different types of things from your IDE. And you might have that in your editor too, but usually your editor has so much better support, even support for deployments, version control, all kinds of things, but with so much more additional features. Like what Brian mentioned a little while ago, VS Code is free. It's free, it's open source, and you could download it and compile it and tweak it yourself if you wanted to. Versus something like PyChart, well, you do have to pay some money for it. They do have licensing available for open source projects and students so that you don't have to pay or pay as much for it. But again, IDEs and editors are different, right? And they serve different purposes. So again, we're going to focus on the editor, right? Which is Visual Studio Code in this course. But PyChart is a really great choice if it has the features that you need it to, you know, to build your application with. Yeah, and really quick to close that out, there is this awesome blog post on LogRocket about PyCharm versus VS Code that goes more in depth if you want to know and understand that better on a deeper level. You can go ahead and check that out. We'll share the link in our resources, which leads me perfectly to segue into the next video where you're going to be able to find out what other resources we have available for you to use throughout the rest of the course to help you along the way. So tune into that next.
|
|
|
transcript
|
2:11 |
Everybody. Before we actually dive into the meat of the course and start talking about the editor and customizing it and debugging and source control and all those other cool topics we're going to cover. First, I think it might be important for us to look at some of the resources that are available to you as you're just getting started with the course. As you're looking at the screen right now, what you should be seeing is the GitHub repo for the course. So VS Code-Python-Course. And so inside of here, you should find pretty much everything that you need to follow along as you're watching some of our videos. So you can imagine that the source code will be in there because GitHub, that makes sense, right? And then we'll also have a full roommate that'll have links to resources, keyboard shortcuts that we use, settings and commands and things of that nature that we're using as we're going through the different chapters of this course. Yes. Anything else you think I'm missing, Brian? No, we'll have links to download VS Code in there. We'll have links to the extensions that we're talking about and we'll show you and work you through. So anything basically it's one link you need to worry about the GitHub repo for this course and then everything else will be within there to make it simple and easy for you, the viewer here watching the course. In addition to that, though, if you want to go and learn more beyond the course, one of the things you can do is go to VS Code's official documentation. They have documentation on their website for specific languages. And how? They set things up with that particular language for VS Code. And there's one for Python, of course. So you can go through here. It's a very high level type of documentation through it that you can, which links off to more things and goes into other topics that we're not going to be covering in this course. Things like Jupyter notebooks and whatnot that goes a little bit further in depth within the Python ecosystem than what we're going to be covering. You can check that out in addition. But again, the main resource you want to use is the GitHub repo. The GitHub repository. That's it. Right. And I'm going to be inside of that documentation site, so you should stick here because we're going to have a lot more fun in this course. Absolutely. All right. Well, next up for you, you're going to be moving on to the next module getting set up. Cecil and I are going to walk you through that whole process.
|
|
|
|
14:54 |
|
|
transcript
|
0:32 |
Hey everyone, welcome to chapter 2 of the Visual Studio Code for Python Developers course. So in this particular chapter, Brian and I are going to go through some of the things you need to do just to get set up to start taking this course. So we're going to talk about, you know, Python and, you know, getting Python set up in your machine, different distributions of Python. And also how you can get Visual Studio Code installed and set up in your machine. And also talking about like the different versions of Visual Studio Code and when you may or may not want to use them. Looking forward to it. Let's get right into it. Let's do it.
|
|
|
transcript
|
9:04 |
In this course, we're talking about how to use Python in VS Code. So ultimately, at some point, we should install Python, right? Like we should get some version of Python. Nah. You don't need it. No. Oh. I mean, we should at some point, right? Okay. All right. I guess so. But here's the thing. Here's the thing, right? And I see what you're saying. But here's the thing. There's so many different iterations of Python. It becomes hard for people to know like which one exactly should they install. Yeah. So I figured why don't we spend some time in this video kind of going through what are some of those different versions of Python and then, you know, some of the reasons you might pick one versus the other. Does that make sense? That makes sense. And I'm excited about that. That sounds good. Because I don't know all the different versions of Python. I just know Python. And you know what? And you know what? We'll talk about that too. Because what does Python mean? Now we get into like this whole philosophical question. Oh, wow. Yeah. I don't know. What is Python, right? What's the meaning of life, Cecil? Is it Python? What's the meaning of life? Is Python the answer? Maybe Python is the answer. Okay. But this is the first one we have. So one of the more common distributions of Python is called Anaconda. Now, this one is primarily used by a lot of folks that do data science, machine learning, that type of work. And that's because when you install this distribution of Python, right, we call these different versions distributions. It comes with like a lot of different versions of Python. It comes with different Python packages, you know, tools and utilities and stuff like that, like included in the box. That means that I don't have to go out and install a bunch of other stuff. I can just download Anaconda. And you see, I got stuff like Jupyter Notebooks. I got Pandas. I got all this stuff that's just kind of included. So it's easy for me to just start, you know, playing around with Pandas or creating graphs and like finagling with my data. So that's one of the reasons why a lot of folks like to use this particular distribution. That's interesting. That's interesting. A lot of AI based stuff. I like that it comes packaged with things. I love the names of stuff like Pandas, you know, and Jupyter. And Anaconda. Yeah. So this might be for somebody who's starting out with Python, though, this maybe is a little bit overkill. Not maybe, maybe not overkill is the right word, but it's a little bit over the top for somebody just getting started in the beginning and maybe looking to use Python with VS Code. Would you say that's the case or no? Or what do you think? Well, I would say it depends on what you call beginning. Okay. So a lot of folks that are beginning Python, they may be folks that maybe are using Excel or you're used to using some other tool for data analysis. So you know what you're doing, right? But maybe you really want tools to kind of help make your job a little bit easier. So like something like having a notebook and working with cells and stuff like that is natural for you. So now you have to learn Python to do it. So for you, maybe having to install all those additional packages. Maybe that might be overkill for you versus just, oh, okay, I just have it because I just downloaded the thing and it has everything for me. So as I'm saying, like, you know, all of these different distributions has like a purpose. And it kind of depends on it kind of depends on what your purpose is, right? Like what exactly you try to do. All right. That makes sense. All right. So I see. So that's Anaconda. The next one we have is Micro Python. What's the purpose of this one? So this one is for folks that are working with like microcontroller, you know, like those little boards. And, you know, you get your little solder. Yeah. Internet of things. Soldering iron. Yeah. Internet of things and IoT and that kind of hardware stuff. IoT stuff and, you know, plugging in sensors and controllers and all these types of stuff. But you need a very small version of Python because, again, those devices have very limited memory sets. You know what I mean? And, you know, very limited processing power. Yeah. So you want to be able to have something that's very lean and able to run in like those types of architecture. So Micro Python is a great way to do that. And it's a great way to do that. And it's a great way to do that. And it's a great way to do that. And it's a great way to do that. Yeah. Yeah. Yeah. Yeah. Micro Python is a great option for doing some of that type of stuff, too. Okay. Cool. Cool. All right. Next up, we have Iron Python. Iron Python. So this one and the next one, the next two are going to be really interesting because so Iron Python is like Python for .NET developers. Right. And some folks might be like, well, why do I want to do that? Yeah. And then, well, I mean, for a lot of folks, there's a couple of reasons. One, you might want to have like some type of interoperability. When I talk about interop, I might have like a thing. Yeah. Like a Python library that I wrote that I want to use in my .NET application or .NET DLL that I want to use in my Python application. Okay. Or I've seen folks that have done inline scripting that would allow me to like write some, you know, small little scripts, maybe in Python, interpret them and run them on the fly in my .NET application. So there's a lot of different use cases for why folks might want to do this. You know, also, too, because it's running, this version of Python is going to be running on the .NET CLR. So now the way that we think about it is, you know, I'm going to run this version of Python. Now, the way that we think about threading and, you know, multiprocessing and some of those types of things are a little bit different than it would with some of the traditional, you know, Python idioms. I got you. Now, this one, if we look, this one is up to Python 3.4. Now, the current version of Python, I believe, is like 3.12 at the time that we're recording this right now. Yeah. So as you can probably see, there is some gaps between like the current version of, you know, the default installation of Python and where it's running. But again, if you're not really needing those, you know, cutting edge features, then, you know, this should be fine. And this would be really great. Again, if you're trying to like just interrupt or integrate into an existing application. Okay. And you mentioned this other one, Jython is essentially similar to, it serves the same purpose as IronPython, but for Java. Yeah. Python and Java. Okay. So now when we talk about Java, we talk about like the JDM. Right. The Java Virtual Machine. Right. And for folks that are familiar with Java, maybe you are, maybe you might not be, the JDM runs lots of different languages on top of it. So Kotlin is an example that runs on the JDM. Scala runs on the JDM. Groovy, which is a different scripting language, runs on the JDM. And now we also have Jython. So that means that, again, we can pull in Java jars and packages and all these types of stuff and write Python code to run with those things too. So again, if you have any of those types of, it's a great way to run. If you don't have any of those type of interrupt scenarios, then it's a great option. That makes sense. And I'm talking about the version gap a little bit again. Here, this one, the current release only supports Python 2 right now, but they are working towards supporting Python 3, at least at the time of recording this. Right. Something else to keep in mind. What's great about these things too is that, you know, both this and IronPython, they are open source. So if you're interested in getting into language interrupt and writing compilers and parsers and all these types of things. This might be a good option for you to like contribute back to some of these projects to help make that community better. Yeah, for sure. All right. Last but not least. Python.org. It's just Python. Just Python. It's just Python. This is what I was expecting you to tell me about. And, you know, maybe we should have started with this one, but this, it's just Python, right? This is the default distribution of Python. You know, it's, you know, hosted on Python.org. It's written in C. You know, runs on tons of different archives. It runs on tons of different architectures. And for most folks, when you install Python, you know, this is generally the version that, you know, most folks are going to be able to use. So if you're interested in like diving into this one and seeing how to install it, you can go ahead and head over to downloads. Hit that little download button in the menu bar. And you could pull it down for your system, right? It runs on Windows, Mac, Linux, and tons of other architectures as well. Awesome. All right. So this is all about getting different versions of Python. For the purposes of this course, we're going to be using throughout 3.11.3, I think, to be very specific. But if you need help getting you, the viewer, need help getting installed, Python installed on your system, you can look no further than right on this platform where you're watching this course. If you go to talkpython.fm/installing-python, you'll be able to step through this guide, this article here that will walk you through doing that to make sure you get it installed properly on your operating system. operating system and verify that it is ready and available for you to start writing python exactly and like i said before like this one's gonna help you get the default or the python version distribution written in c the one that we showed at python.org on your machine if you're interested in getting anathonda or iron python or any of those other ones make sure you go to those websites and it'll let you know like the instructions and the steps you need to take to handle those awesome well now that we know about the different types of python distributions that are there which one we're going to be using in this course and how to get it installed next in the next video we're going to talk about getting vs code set up on a machine very briefly giving you an idea what to expect in doing that so let's head on over into that what do you say cecil let's
|
|
|
transcript
|
4:48 |
So Brian, we just went through how to install different versions of Python, different distributions of Python, right? Like try to understand what version we're going to use in this particular course. But I kind of feel like we should tell people how to get Visual Studio Code installed too. That might be an important thing for us to do. So could you help us out with that? It's just a little important and I'd be happy to help you out with that. So to get folks started, if you don't already have Visual Studio Code installed at this module here, this video is going to help you out. You want to go to code.visualstudio.com, which is what we're looking at right now. And here you're going to be presented with a lot of information. But one thing I want to call out that may not be exactly apparent because right now it says download for Windows. It's picking up that I am running on a Windows machine right now as we're recording this. But VS Code is available for Windows. macOS and different distributions of Linux. Your mileage may vary on there, but you get the idea. It's meant to be cross-platform supported on all major operating systems and Linux distribution. So keep that in mind if you're looking to install it. You don't need to worry about jumping to a different operating system for the purposes of this course. You use what you want to use. Get Visual Studio Code. Now, when you come here, you can click the big blue button to download it for your operating system that you're going to be running on. But you don't need to worry about jumping to a different operating system for the purposes of this course. You can click the big blue button to download it for your operating system that you're going to be running on. But that's going to give you what's called the stable build, which is typically the blue icon that you see when you're installing it. But if you wanted to, you could potentially open up the door to... You want to get a bit adventurous. Cecil, are you feeling adventurous, man? I mean, I live on the edge. So what you could do then, since that's the case, is you can actually install the Insiders version, which would be... The way you know the difference between them is it has a green icon. And what the Insiders version is, is you're getting more frequent updates ahead of time before the stable. So you can get more frequent updates ahead of time before the stable release. Now, why you might want to do that? Well, I, like Cecil, like to live on the edge and get the latest and greatest features that are coming out in VS Code and be able to test them out and try them in my projects. But I also have found that running both... You can run both side by side, by the way. But running in Insiders, I rarely ever ran into issues where I would have to stop using that and actually switch over the stable. Like maybe two times that's happened in nearly a decade or however long I've been using VS Code. I want to say it's almost... How old is VS Code? I don't know, but it's pretty old, okay, at this point. And over those many years that I've been using it from the start, two times have I ever really had to shut down Insiders and then just reopen the project in the stable build. So try out either one, whichever one you like. If you want to see the difference between them, you look at the icon here. It's green. Okay. That signifies that it's Insiders to me, the Insiders version where I'm going to get weekly or daily even updates in the bottom right hand gear. Or for me, it's the bottom right hand gear. Okay. So that's the bottom right hand gear. But for others, it might be on the left hand side. And then if I'm in the Insider or standard stable version, it'll be looking like this with the blue icon. So just calling that out if you're interested in checking out different flavors of Visual Studio Code. But you click on that, it gives you the corresponding executable for Windows or DMB or DMG rather for macOS and so forth. And you just step through the little installation process and you'll be off and running with Visual Studio Code on your operating system. So the only one thing I want to point out with that is, and like Brian said, we like to live on the edge, right? And so we often would have both the, I guess, the stable version and the Insiders version on our systems. Sometimes when your Insiders version updates and, you know, the folks that build the plugins and the folks that build the editor aren't the same folks. And so sometimes, you know, updating to like the bleeding edge version might make some of your VS Code extensions freak out a little bit. I'm just like, it's okay. Nothing bad is going to happen. It's going to happen on your computer or your machine. But you can expect that, again, when you're living on the edge, sometimes things are going to happen, right? And so that's usually why I like to have both. I have like the Insiders version and the stable version. So I can kind of see how the worlds are different, right? And look at the updates, but also see how like my extensions react to that as well. Yeah. It's great you bring that up because there's actually a third flavor of Visual Studio Code, if you will, that you can potentially use. It's outside the scope of this course, but there is a web. So if you're using something like GitHub Codespaces or some type of cloud development environment, it can leverage most of, if not all of Visual Studio Code, just like the one that you would install on your operating system, but in your browser. And you get a lot of the conveniences of that without having to pollute your local, you know, machine that you're working on necessarily. So you can check that out. That's also there under VS Code.dev if you want to go learn more about that and find out ways you can leverage Visual Studio Code.
|
|
|
transcript
|
0:30 |
All right, folks. Well, hopefully after watching this chapter, you've learned everything you need to learn about getting set up with Visual Studio Code, different Python distributions, and having that set up on your machine. If you have any questions at all, always feel free to message either Brian and I. You can reach out to us via the Talk Python folks, and they'll make sure they send any questions and queries our way. But now, we're going to move on to the next chapter of this course, and we're going to learn a little bit more about how we could customize and get set up using Visual Studio Code.
|
|
|
|
1:08:51 |
|
|
transcript
|
2:14 |
Hey there and welcome to this module on exploring the editor with Visual Studio Code and I want to talk you through what we're going to cover in the module so you have an idea of what to expect. First of all, we're going to take a look at and get a general overview of the user interface so that we can get acquainted with it and how it works and where things are within that space. After that, we're going to take a look at the activity and secondary sidebars. These are the bars that come up on either the left hand side or the right hand side, depending on your preferences and configuration. You can hide and show those throughout your developer workflow. After that, we're going to take a look at the command panel, which is your gateway to doing anything and everything all from the keyboard to jump around between different actions and customizations right within Visual Studio Code itself. We'll take a look and understand the Explorer and workspaces, the Explorer being the area where you can open up folders and files and. Have visually see what you're working on and workspaces allowing you to logically gather things together or aggregate different projects from different folders together into Visual Studio Code. Once we're done with that, we're going to talk about the status bar, which is something that gives you active information about the current state of things when you're working on a project. So things like the file you have open the current cursor position and line that it's on stuff like that within the status bar. Then we'll talk about the terminal, which is going to allow you to run commands or navigate around different directories, things that you normally would do in an external terminal. But this one is built into Visual Studio Code. After that, we'll talk about settings. We got to be able to customize our editor to our liking. We got to tweak things, make things visible that we want visible, hide things that we don't want visible and stuff like that. Shortcuts and whatnot that you'd like to be able to do. Speaking of, we'll talk about common shortcuts that you can use to keep your workflow efficient and productive. And then we'll talk about the default settings. So if you're using a default setting, you can use that. So that you can jump through your projects, get your things done as fast as possible. After that, Cecil and I are going to talk with you about extensions, the themes that we recommend that you can check out. That'll help you and enhance your overall experience developing within Visual Studio Code. And then that will close things out for this module on exploring the editor Visual Studio Code.
|
|
|
transcript
|
5:23 |
Visual Studio Code has a user-friendly interface that consists of several components designed to enhance your coding experience. Understanding these UI components will allow you to navigate, edit, and manage your code and projects effectively while using Visual Studio Code. The menu bar is located at the top of the Visual Studio Code window, right up here. That's where we see File, Edit, Selection, View, Terminal, Help, and all those options there. It provides access to different menus such as File, Edit, View, Go, Debug, Terminal, and Help. Each menu contains a set of commands and options that you can use to perform various actions within Visual Studio Code. So if you need to open up a new file, open up a folder, save things, share, close things, all that kind of stuff is happening from the File menu along with some of the other menu options that you have here. Next up is the Activity Bar. This is positioned... along the side of the window and it's typically, by default, on the left-hand side. It consists of icons representing different functionalities and aspects of Visual Studio Code. Common icons in this bar include the Explorer view, which we have open right here, Source Control, which is this one right here, the Run and Debug view, Extensions, and Search. Each icon corresponds to a specific view or feature that you can utilize within your development workflow. After that, we have the Editor Group. That's where you see the current file that I have open right now, api.py. The Editor Group is the main area of the window where you open and edit code files. Visual Studio Code supports multiple Editor Groups, allowing you to work with multiple files simultaneously. Each Editor Group can contain one or more tabs representing individual files, as you see here. api.py is an individual file represented under its current tab here, right there. You can switch between these two tabs to see which one is the most important. You can also drag tabs around to rearrange them or split the editor so two files are side by side. Below the Editor Group you'll see the Panel area, which is where the integrated terminal, the problems view, the output, and the debug console all live. You can resize that panel by dragging the top edge up or down, depending on how much room you want for it. Over on the right-hand side, we have the Secondary Sidebar, which is hidden by default but can be turned on from the View menu. The Secondary Sidebar is handy for keeping a second view open alongside the Explorer, like the Source Control view or the Outline. You can drag any of the views from the primary sidebar over to the secondary sidebar so they sit on the right while your code stays in the middle. At the very bottom, we have the Status Bar, that thin strip running across the bottom of the window. The Status Bar shows you contextual information like the current branch in Git, the line and column your cursor is on, the file encoding, the line endings, and the language mode. You'll also see indicators for problems, warnings, and any background tasks that VS Code is running for you. A lot of those items in the Status Bar are clickable, so for example clicking the language mode lets you change the file's language association. Visual Studio Code also lets you customize the layout — you can hide and show any of these areas to suit how you like to work. So that's a quick tour of the major pieces of the Visual Studio Code interface and how they fit together. In the next videos, we'll start drilling into each of these pieces in more detail.
|
|
|
transcript
|
6:18 |
One of the most powerful components of Visual Studio Code is what is called the command palette. It allows you to access and execute various commands within Visual Studio Code. It's a versatile feature that provides a quick and efficient way to execute commands, which range from basic editor operations to advanced features and even extensions. You can open up the command palette using a keyboard shortcut, such as Ctrl-Shift-P on Windows and Linux or Command-Shift-P on Mac. Another way you can open up the command palette is by going to the View menu and clicking on Command Palette. Once the command palette is open, you can start typing to search for a specific command or feature that you want to perform. As you type, the command palette will dynamically update and filter those results, displaying any relevant commands or suggestions to you. So, what can we do here? In order to execute a command from the command palette, you just select it from the filtered list and press Enter. Or you can click on it if you'd like. So, as an example, let's say we want to close the current file that we have open. Say Close Editor. And what's nice about this is it also shows you any keyboard shortcuts that are associated with that command so that you can, over time, learn to memorize that particular keyboard shortcut instead of having to go through the command palette for that particular action. In this case, I'll hit Enter or I'll click on that one. And it did indeed close the API. If I bring up the command palette again, now I want to open a file. I hit Enter on that file. And I can choose API.py. What I find to be really great about the command palette is that even if I don't know exactly what the command is or action that I want to perform, if I start typing out what I'm looking for, it'll filter those results and give me a better idea of what might be possible. So, in this case, I want to edit settings for the command palette. How can I find those? Well, I'll bring up the command palette, Control-Shift-P, and I search for settings. And then I can see all the different options that have that keyword in it. And in particular, I realize, oh, I want to open the settings UI. Now, once in here, this is what we're talking about. We want to update some of the command palette settings. So, I'm going to search for command palette. And here we can see, let's close the bottom panel there. We can see the different options. So, we can see the different options that are related to the command palette in VS Code settings. So, we showed those two examples. And a few more examples of using the command palette that you might want to leverage it for is maybe changing the editor layout for you. So, in this case, you see I have a tab open for settings and another tab open in the editor view for the API.py file. What if we wanted to split those? Well, Control-Shift-P, and I look for split editor. And hit enter on that. And now we can see it did indeed. Split the editor. We have an editor group on the right-hand side with the settings view open. And then I can close. It looks like it duplicated in this case. And then I have the API.py on another side. Another option would be, which I personally prefer, is toggling which side of Visual Studio Code the activity bar shows up on. So, I'm going to search for activity bar. And you can see, we can focus on it or toggle the visibility of it. We can hide it completely. If I hit enter again, you'll notice when you bring up the command palette, it shows your recent command that you executed in that history. So, you can quickly jump between them if you need to go back and do something or revert something that you did. Toggle the sidebar, primary sidebar position. So, right now, that's on the left-hand side. And as I was mentioning before, my personal preference is to have it on the right-hand side. Now that you can see it's over there. The reason, really quick, sidebar on this. No pun intended. Why I want that on the right-hand side versus the left-hand side is I personally often move around my UI components or hide and show UI components. So, in this case, I like to hide and show this sidebar view so that I get more real estate to see my code. So, you can click on the currently active view to hide and show that. Or you can press control B or command B if you're on macOS. And that will toggle it on and off. In which case, you can hide and show it. In which case, you notice the behavior now. It's not as jarring on my eyes when I'm hiding and showing that versus when the sidebar is on the left-hand side. So, I'm going to press control B a few times and you'll see the code jumps. The positioning of where the code starts for me to read jumps quite a bit. And since I do that a lot in my personal workflow, I prefer it on the right-hand side. And maybe you will, too. One last really cool example of the power of the command palette that you can use it for. Is checking out extensions, too. So, control shift P to bring it back up. I'm going to search for extensions. And I have some options here. We can check for extension updates. Disable some of them. But I want to install, let's say, an extension like this. And it brings me right to the extensions view. Another thing you can search for is a lot of times people want to change the color theme of Visual Studio Code. You can start customizing it to your liking and be more visually pleasing for you. Well, I can search for theme. Click on this preferences color theme. And all within the command palette is when I'm doing this. And I can toggle through all the different options that are installed in my instance of Visual Studio Code. Some of these are built in. Some are ones that you can install separately. Which also can happen directly from the command palette. You see this top option. Sorry for the flashing there. Browse additional color themes. I hit enter on that. And now it's searching the Visual Studio Code marketplace. For all the color themes that are available out there. So maybe I want to search for Night Owl is one that I really like by Sarah Drasner. And here is the chance where I can actually see a live preview of that searching from the marketplace. All within the context of Visual Studio Code and the command palette.
|
|
|
transcript
|
7:42 |
One of the main features and functionality that you will be using within Visual Studio Code is the Explorer view and what's called workspaces. So right here on the left hand side, you can see from the activity bar, I clicked on the Explorer view and then that loads up in the primary view. Now, here you have some options. There's icons at the top that allow you to perform actions within the Explorer view and within the current context of the root folder of your project. So I can create a new file within it. I can say I want it to be like test.py if I wanted to, to create something new there. You can see it opens up automatically as soon as I create that in the editor view. Some other options that we have in these icons within the Explorer view is to create a new folder or maybe behind the scenes separately in your Windows Explorer or in Finder on macOS. You add another file within here that doesn't show up for some reason in Visual Studio Code. You can say, hey, I want to reload. Refresh. The Explorer view. I'm clicking on it right now, but nothing's changing. You can see that. And let's say things get a little unwieldy and I have too many parent child folders opened up and it's become too unwieldy to try and manually close all of them. Well, there's a collapse all folders in the Explorer view option like that. So that's the Explorer view. In a nutshell, you can also see at the bottom, there's a couple of little sashes too. So here's the main view in the Explorer view, the current root folder that I have open. But in addition to that, there's the outline. Which when you have an actual file opened up, Visual Studio Code will recognize the type of file it is. In this case, a Python file and give you a general outline of the structure of that file. In this case, we just have the API, which is a very simple file. So it's not showing a lot. But as you get a larger code file open, this will help you navigate it a little bit more easily. And last but not least, and this is something that has saved me at least once, if not twice. Now, where I've accidentally deleted something in a file that I forgot about and later needed to come back and restore it. Visual Studio Code will keep like a shadow copy of your files for you. And you can restore back to those times or the state of that file at that time, essentially. Just really saved my butt, to be honest. You know, excuse my language there, but it has. For instance, I had an ENV file, environment variables file, and that I deleted the API key that I needed and I couldn't find it or generate a new one. And that helped me restore back the API key value that I wanted. All right, so that's the Explorer view. Now, next up, as that kind of goes hand in hand with the Explorer view is a concept called workspaces. This is something that took me a little while to get my head around. But once, hopefully the way I explain it to you now, it'll be really quick and easy for you to understand. Essentially, a workspace is a way that allows us to organize projects effectively. Within Visual Studio Code. So in this case, my project, I just have this one root folder, which is for my API, the podcast API. But maybe I had a front end component to this overall project that's in a separate folder structure or a separate repo that I clone down to this machine. And I want to be able to work on that project at the same time as my API project and jump around quickly. And that's where workspaces come into play can act as even though they're not physically in the same folder structure. They can be connected virtually within Visual Studio Code using workspaces. The way workspaces are made available within Visual Studio Code is a number of ways. Well, one, one of the most prominent ways is through the file Explorer menu or the file menu. In here, you can see there's a couple of options related to that are related to workspaces. I can open a workspace file from a file. I can add a folder to the workspace. I can save my current setup as a workspace. Cause right now. It's not technically a workspace because it's just the one folder that I opened up. We can turn it into a workspace. And last but not least, you can duplicate a workspace. So maybe you have it configured a certain way that you like it, and you want to add a little bit more for a certain workflow that you have. Maybe some settings specific to that workflow. You can duplicate this workspace as like the template to work off of and configure it a bit further to your needs. But getting a little bit ahead of ourselves there. Let's talk about how we can create a workspace. So what I'm going to do is with the current project that I have open, I'm going to create a workspace. So I'm going to say save as workspace. I can give it a name and decide what, where I want to save it. In this case, I'll just put it directly in the root project where you save this workspace file doesn't really matter as long as you know where it is and where you can get to it because it acts as a manifest for you to describe where other projects that need Visual Studio Code needs to reference and pull into it. So I'm going to put it in here and I'm going to click OK. You'll notice Visual Studio Code reloads now and this top area or sash, if you will, within the Explorer view now has that workspace keyword in there instead of just the name of the folder that I had open, which was base. You'll also notice that now base that folder is a collapsible region within the Explorer view. So may not really look too different, but this next step is what's going to really show the. Power of workspaces for you. So in this case, talking about the example I was going through before where I have this API project, maybe I have my UI front end project in a separate folder. Well, I can right click in the Explorer view and I want to be able to see it within here. I can say, hey, I want to add that folder to this workspace by click on that. And let's just say for demonstration purposes, this is the folder that has. My UI in it and I click OK, and now I can navigate both of those. Within the same instance of Visual Studio Code. Again, this is like a virtual directory that references multiple other directories that are not necessarily connected. So let's say I made a mistake, though, this as you can see, this is just a essentially an empty folder that I added in here and I clicked on the wrong one. I need to remove this from my workspace. I right click on that particular dropdown and say remove folder from the workspace. Now we're back to just that base folder that we needed from before. So one of the unique things about a. Workspace is you can configure your Visual Studio Code settings to be saved to that workspace so that whenever you load up this project again or the workspace again, Visual Studio Code will apply those setting changes separate from when you open up a different workspace or a different project within Visual Studio Code. Demonstrate that will one let's take a look at what the code space file code workspace file looks like. It's essentially a JSON file. It describes the folders that should be included as part of that workspace and any settings associated to it right now. So you can see it's just empty. But if I go in and let's say maybe for this project, I want my font to be different size than what I have by default font size. I'll search for that in my settings view right now. It's set to 18. I'll click on workspace in here. And. Let's change that to 22. And I hit save. And now you'll see that one, the font size changed and it saved it into the workspace. Folder or workspace project file. All right, and that essentially summarizes workspaces that can be a powerful tool for you in those larger, more complex projects that you might be working on within Visual Studio Code.
|
|
|
|