OK, so in this lecture, we're actually just going to be talking about where we're going to write the
code for C++.
So where do you write code?
You probably have written some documents.
It may be in like Microsoft Word or, you know, Google Docs or something like that or just Notepad
app, something similar to that.
And it's very similar for code.
You can use some very basic kind of text editors for writing code, or you can use some like really
fancy integrated development environments, which are programs.
They're basically software that is designed to make your coding life a lot easier.
They do a lot of heavy lifting for you, and there's a lot of really fancy features that help you debug
code, and you can even kind of help you write code faster and in a more streamlined way.
So we're going to be going over all these different things today because I want everyone to have the
flexibility to be able to code in whatever environment they want.
Maybe they don't want a really big or overwhelming I.D. You know, it may or may not be overwhelming,
but there could be a chance that when you open up an I.D., you're like, Wow, this is really confusing.
It feels like I'm driving a spaceship or something like that.
I don't want anyone to be held back from the learning experience of the course, but it's really about
learning about programming and algorithms and things like that.
Less about the editor.
So I don't want you to be hung up on like figuring out how to use your editor.
So I'm going to be covering as much as I can about each editor, how to use it, how to debug in an
I.D., how to debug in the terminal, how to write code in the terminal, how to write code in a lightweight
text editor and of course, how to write code in an ID as well.
So today's lecture is just going to be all about where do we write code?
What are all the options that I have?
Where do I go to download these things?
Are they free?
Do I have to pay for them?
How do I set it up?
And I try and answer all these questions in this lecture.
So with that, let's go ahead and get started.
I have three different styles of locations to write code software to use to write code that I'm going
to explain to you today.
And there are a bunch of different versions of each one of these types of editors that I'm going to
talk about.
I just picked three.
I picked my three favorite ones.
So you don't have to use any of these, but I'm going to show you where to download these and how to
use them.
So you have a few different options.
You, of course, can go get your own, you know, versions of these your own.
Like brands, if you will, like if you want a different companies.
Text editor, a different type of text editor, you can totally do that if you already know of one that
you want to use.
You can go do that.
I cannot cover all the different text editors that would take me forever, and I feel like it would
seriously detract from the purpose of this course.
But I am not going to leave you hanging.
I'm going to go over at least a few different options so you can feel comfortable coding in an environment
that you like.
You can also use all three to and that might be good, so you can kind of expand your knowledge and
skill and have you know how to use different editors and stuff like that.
So we kind of have the whole spectrum covered here.
I'm going to go over on these three different things.
First, I'm going to talk about a command line based text editor called them.
I also have a graphical version of it here, too, but I'm going to be focusing on the command line
for it.
Then in the end, that's kind of the most primitive one.
Yet it is really great and loved by many programmers and developers because you can write code really
fast and it if you know how to use it at a very highly skilled level, you can navigate around a file
very quickly and write code very quickly.
So it's pretty cool, and that's why I wanted to introduce it.
And so that's kind of the start on the very left side, the lowest part, if you will, in terms of
like how fancy we're getting.
Then in the middle, there's something called Visual Studio Code.
I would consider this a lightweight I.D. idea standing for integrated development environment.
It's somewhere between a basic text editor and an ID somewhere in the middle there.
People love Visual Studio code.
I really do love Visual Studio Code.
I would say that if you're struggling on which one to choose at the end of this video, I would just
say go with Visual Studio code just because I think it there's lots of great documentation online about
it.
Tons of people use it and just really love it.
And it's pretty easy to write code in and it doesn't take a ton of getting used to yet.
You can customize it a lot and you can make it really, really fancy if you want and add additional
plug ins and stuff like that.
And then the kind of other end of the spectrum is going to be like a big, fancy indie called Sea Lion
from jet brains.
They also make IDs for the Python programming language, which is this right here pie charm.
I just have the community edition of this, and I think they also make one for like Java and JavaScript
or something called Intel.
I don't have that on here, but that's I've heard that's also really great.
So let me kind of talk about each one of these individually, and I'll show you where you can, where
you can get them and and download them.
So first off, I'm going to look at something called them.
And this is something that you can access from the command line once you install it, and it's going
to be similar in Windows, Mac or Linux, so whatever operating system you have, you will be able to
go to your terminal like if you are in Mac, your bash shell, if you are in Linux or your command prompt
here in Windows and just type them and press enter.
And that will bring you into this.
You notice it, says VM, which stands for I improved v.
I was the older version of it.
It is a pretty old ed, but still really loved by the programming community.
So what's up with him?
It is a really cool editor, but for beginners, it does take a while to just get to a point where you
can comfortably navigate around in it.
It uses some weird keys, so it has these two modes.
One that's called insert mode and one that's called command mode right now.
You're kind of you get into it and you're like, Well, what do I do?
I don't know how to get around what I'm typing keys like.
I type some keys and like, Oh, what happened?
Now I'm in insert mode and I don't know what's going on.
You know, you type some keys and it doesn't really like, do anything.
So what you do is you press I to go into insert mode and that lets you start typing.
So now, you know, I can type some stuff.
I press the escape key that brings me back to that mode that I was just in called command mode.
Command mode is for navigating around.
You can see that my cursor is moving around right here and I can press high again, and now I'm in insert
mode and I can start typing at this point where my cursor is.
So the thing is, is that to get around when I'm going back and forth like this, I'm actually pressing
the h key to go left and the key to go right.
And you actually.
If you go to another line and start typing some code, when I go up and down between lines, I'm typing
that J and the K so k to go up to go down.
So it's kind of a little confusing.
You need to learn how to use the keyboard to navigate around this environment, but there's a lot more
keys that you can press to do things very quickly, like you can just quickly delete a line like that
by just pressing RD twice, and that also copies that line.
There's just a lot of cool key combinations that once you learn them, you can write code super fast
in here.
And it's it feels pretty nice if you're if you become kind of a power user of them, you can just write
code incredibly quickly.
And it's a great experience because you just feel like you have so much power and control over your
environment that you're writing.
Code in a cool thing, too, is that you will be able to set up that Vim Navigation in visual studio
code as well.
I believe there's a way to set that up.
I don't have it set up, but I think there is a way which I might actually look into so I can tell you
how to do that.
But yeah, it will take.
It's a little bit of a learning curve to be able to write code in here.
That's why I don't want you to be forced to have to use this.
But if you do want to use it, just know it.
You can write code really fast.
You can also customize it.
I will show you how to customize certain color schemes in here and stuff like that right now.
It just looks like gray code.
So even though you might not understand the commands.
That I'm writing in here, I will show you
just what the colors look like.
So I'm going into a C++ file right now and you see that I type this and it's actually separating things
by colors, which is pretty cool.
This is me typing some C++ code right now.
And you can you notice it just it looks kind of visually appealing to and you can also
do like
some.
You can change the color scheme.
So
colors in, uh.
Color scheme, did you know?
Oh, no, it's just a color scheme, that's what it is.
Color scheme, desert, I think color scheme.
Blue, dark blue.
OK, here we go.
Al Ford, OK.
So you notice that the I had some color schemes there.
I can change the the color.
Any industry, so that just changes the colors.
Kind of cool, that just changes it temporarily.
If I go, I actually didn't save that file, so actually it was already touched.
Yeah, I can save it.
So you notice now it goes back to my original one.
This is something that you can edit in this VM rc file that exists on your computer.
You can go and actually set the default colors and stuff like that and customize your your editor here.
So that's just something I wanted to show you all.
If you saw some weird commands there, don't mind that I'm going to go over how to navigate the command
line and stuff like that.
This is me just kind of showing you what the various coding environments look like, so you can choose
one to be able to download.
OK, so let's move on to the next one, which is going to kind of be our in-between a primitive and
fancy, which is Visual Studio code.
So I think I already have like a simple program written in here in C++, so you can just kind of see
what it looks like.
I'm not sure if it'll bring that up.
It's actually blank right now, so I don't have the program, but it also does some color like highlighting
and stuff like that.
And you notice it just it's slightly a little a little more fancy.
So you notice like I type one curly brace here and it does two curly braces.
It kind of just set things up for you because it, you know, it knows what you're doing.
It knows that it's C++ and it's it's going to it's going to make it a little easier for you to write
code.
It's got a lot more going on here.
You can download extra plugins that do more for you, like they help you write code.
It does have a debugger that you can set up for various programming languages.
You know this, I have this terminal down here, so I can close out of this, I can actually bring up
this integrated terminal in here, so I can kind of like write code and look at my code and then run
it in the same kind of window.
So I could be writing code in this area here and then here it brings up Windows PowerShell, and I would
actually be able to navigate to the same directory that holds my code and I could compile and run my
code to and run commands in here because this is like a full on instance of PowerShell.
So it's pretty cool.
This is something that can be as basic or advanced as you want.
You can really customize it and make it more fancy by adding these plug ins and things to it.
So just know that it still is highly customizable and but still can be pretty simple if you want to
keep it simple.
I will be going over all these.
Like I said before showing you kind of how to use each one of them, you can kind of.
When we get into the part of the course that talks about debugging, you'll notice that in both Sea
Lion and in here, you kind of have a similar thing where you can set little dots here to be able to
tell the program to stop suddenly.
And you can kind of examine what's happening when the code runs and stuff like that.
So that is a cool thing when we step it up a bit.
It has kind of a built-in debugger if you set it up, and that is a really powerful tool, as we'll
see in the future.
So just kind of what Visual Studio code looks like.
It's it's pretty cool.
You can open multiple files here at once, too, which is nice not to say that you can't do that and
when, but it's just a little more user friendly and here.
In this graphical kind of.
Ed, so you can you can add another file you notice there's like this this tab right here, like a welcome
tab, you can go like new file and you notice that we have a file here.
And we also have a file here where I can have another C++ file right beside it.
And I can kind of toggle back and forth between these and write write code in both of them and jump
back and forth and do things.
And then I could run either one of them and stuff like that.
So.
So pretty cool.
Pretty nice looking.
So that is that's kind of your middle option there.
I also should point out that I do have this graphical version of them to that that you can install,
I showed you the command line, but you can.
I pin this to my taskbar, you can click that and it brings up kind of this graphical version of the
film editor as well.
So now we move on to kind of a big idea, which is that integrated development environment I've been
talking about.
And so there are other ideas out there that you could use.
I use this one because I really like it.
I love chip brains products.
You know, like I said, like pie charm here as well.
So let's take a look at this.
So it is a.
Got a lot more going on it, and it's just going to bring up like a program here.
This is from a more advanced.
Portion of the course, which we will talk about algorithms and stuff, so you can kind of ignore the
code here, but I just want to kind of show you what it looks like.
You know, a lot going on here.
I can bring this over.
It has.
You know, all the project files here, so you can have like a big, big project and a list out all
these files similar, you could do a similar thing here in Visual Studio Code.
But what makes it so nice is mainly as powerful debugger.
So.
You can have a terminal here.
Or you can, you know, basically have like this little.
Kind of debugger thing where you can go through and like check like errors, and it's it's pretty nice.
Like, for example, this is something we haven't gone over yet, but you can basically like set set
these little points in which you can debug things.
And kind of, you know, started up and it will just like, stop here for you.
You can go and in and kind of step through and examine things and look at your code and look at like
data going through your code.
And it's just, you know, it's got a really powerful debugger, which I really like.
So that's what makes this kind of the reason why I love Sea Lion is just because they're debugger is
so, so nice and easy to use, and it's just the graphical nature of being able to click around on things.
And examine, you know, memory stuff like that.
It's super nice we'll be looking at different debunkers, we'll look at this one and we'll look at a
terminal based debugger as well.
So you don't have to only use this debugger, but I just kind of want to show you what it looks like,
what the environment's like.
You know, it also like completes code for you a lot of times because, you know, if you've already
kind of typed something out and it recognizes it, that I talked about Visual Studio code being able
to have that.
If you install like some plug ins, but here you don't got to install anything, it's just it's all
there for you.
So, you know, you can just kind of press tab and it will complete things for you.
It also will make suggestions and things.
So, you know, it's pretty cool, like it can change.
It can kind of change some code.
For you, sometimes it will highlight highlight certain things you see like a light bulb pop up here
and you'll be like, Oh, do you want to replace this piece of code with something else?
And I can click Yes, and it kind of changes it into something else for me.
And, you know, if I don't like it, I can.
I can go back to how it was.
And you know, these are just kind of really cool fancy tools.
We can do a lot of stuff for you.
It helps you code better.
You know, it'll it'll give you little options to change things.
It will give you suggestions on on spelling or if there's a more efficient way, you could implement
some type of C++ syntactical thing.
It'll help out a lot.
So really powerful development environment.
So terminate that, so let's let's look at how to download these things, so I've got them pulled up
in the browser here.
I'm going to look here for Visual Studio code first, so you can just go to Code Visual Studio dot com
slash download.
You notice that they have it for whatever operating system you want.
You have all these versions of Windows you can download it for and then you notice there's multiple
distros of Linux here like, for example, you know, Red Hat, Debian two and all that.
So you can download it for for one of those two and then Mac, of course, here.
So that's where you can download Visual Studio code.
Sea Lion is going to be here on the Jet Grain's website, so you can kind of just Google that link.
Download Sea Lion Safari, click on one of the first results, but you want to come here to get brain
scan their website.
They're the ones that make a sea lion pie, charm and intelligence.
And you can just download it here.
You notice they also have it for Windows, Mac and Linux.
So you notice it says it includes an evaluation license key for free 30 day trial.
So depending on your situation, you might have to pay for this.
That's why I don't want to limit you to only this and want to show you those other options as well.
But it is great.
I think it's worth it if you're really serious about writing a lot of code in big projects in the future
in C++.
I think that it is is totally worth it if it just makes your life a lot easier when it comes to writing
C++ code.
So you can download that here, if you're a student, you might be able to get it for free by using
your student email so you can kind of look into that on your own.
You can kind of search like, you know, getting sea lion as a student and probably walk you through
how to do that.
So let's head over to them.
You can get them here if you don't have it before you just go and try and download it.
If you have Mac or Linux, you should check to see if you already have them the way that you can do
that.
For example, if you're on Mac, this is not a Mac, but you could go up to the little like magnifying
glass search icon up here and then you can type terminal once you bring that up.
So TR m and then should probably autocomplete for you and that will bring up your terminal, you know,
which will be your command prompt kind of like this.
And then once your command prompt is up, you can just type them and press enter.
And if it's installed, it'll bring it up.
If not, then you know you need to install it.
Same thing for Linux.
Go into your bash shell type, then if it brings it up, then good.
If not, then you have to install it and you can install it here on this website.
Vim dot org.
You notice that the Mac one you might want to use homebrew, which is right here homebrew is a great,
great tool on Mac for installing a ton of packages and stuff.
It just makes your life super, super easy.
So I think that using homebrew can help you a lot, so I might look into that.
If you know, even if you already have, it would be good to have homebrew to install a lot of different
stuff.
So I want to point that out as well.
Linux Yeah, you probably have it, but of course they have some stuff right here for a Unix based systems,
you know, that includes Linux, so you can follow these links and and install that on Windows.
I would use this standard self installing executable, and you can just leave all the default boxes
checked and just follow the instructions during the installation and just keep clicking next.
If you're new to this and you don't know what's going on when it's listing information on that installation
process, just accept all the defaults and go through and install it.
So, yeah, that's kind of all three of these, and I think that you could choose any one of them.
I just wanted to kind of lay those options out for you.
And no matter what one you choose, you will be able to go through the course just fine.
So pick whatever one you think meets your needs and I will see you in the next lecture.