Eve: Building RESTful APIs with MongoDB and Flask Transcripts
Chapter: Setup and tools
Lecture: VSCode editor

Login or purchase this course to watch this video and the rest of the course contents.
0:01 We are going to write some code in this course
0:03 so we need some kind of code editor, right?
0:05 Well, when it comes to coding,
0:08 a Python developer is left with a number of options.
0:10 Now, I won't get into the text editor versus IDE debate, not today, at least.
0:17 Personally, I happen to work on different platforms and languages
0:20 so depending on the task at hand, you can find me doing Python on Vim
0:23 or C# in Visual Studio when I am on Windows.
0:26 So yes, I'm using minimal text editors as well as IDEs,
0:30 Vim is so wound up in my muscle memory
0:32 that even when I am on Visual Studio I still use Vim key bindings.
0:36 Lately, I also had been doing both C# and Python,
0:40 and Javascript to be honest, on Visual Studio code.
0:44 For this course, I am going to use Code.
0:46 It is a fantastic, open source editor widely adopted by the Python community.
0:51 It runs on MacOS, on Windows and on Linux.
0:55 It is free, very stable and also actively maintained.
1:00 I find it to be the perfect compromise
1:02 between a pure text editor like Vim,
1:04 and a full blown IDE like Visual Studio or PyCharm.
1:08 Of course, you're free to use your preferred editor or IDE,
1:11 but if you want to follow me as I type my code,
1:14 you may want to download and install Code.
1:17 You never know, you might end up liking it a lot.
1:19 Getting Code is simple, you just have to go to code.visualstudio.com
1:24 and hit this big download button here
1:28 where you can pick your preferred version.
1:31 As I mentioned already, you can get it on the Mac, on Windows or on Linux,
1:35 just make sure that on Linux, you get the correct version,
1:39 depending on your distribution.
1:41 You can also click on this button here in the upper right corner
1:44 you will get basically the same links and options.
1:47 Once Code is on the system
1:49 we want to get it ready for Python.
1:52 So let's activate the virtual environment that we created
1:56 when we installed Eve in a previous lecture.
1:59 Source, and here we are,
2:08 as you can see, our virtual environment is active now
2:11 let's pip freeze so we know which packages are installed,
2:18 yes, Eve is there, ready to go.
2:21 Now, we need a folder where we want to work and write our Python scripts,
2:25 so let's create it,
2:30 and then let's move into it, right,
2:36 now, we can launch our editor
2:39 we'll use a dot to instruct Code that we want to work
2:43 on this very folder where we are sitting right now.
2:49 And here we go, as you can see, Code is ready for us,
2:53 and it is already on our folder, as we can see here.
2:57 Before we can start coding in Python,
3:00 we need to install the proper installation.
3:02 So let's go over here, to the extension tab and click on it.
3:06 As you can see, we get a nice list of available extensions, for Code.
3:09 Yes, there are a lot of them, actually,
3:13 they are probably are in the order of the hundreds, if not thousands,
3:17 you name a language, a stack or a framework
3:19 you probably will find two, three, five extensions for it.
3:23 It is really a huge number and what's even more interesting is
3:27 that they are sorted by number of installs,
3:30 and as you can see, the top one is Python,
3:32 let's click on it.
3:34 On the right pane, we get a lot of information about the extension,
3:37 quick start, link to the documentation etc,
3:40 but, look at the download number here,
3:43 at the time of this recording, we are at almost 6 million downloads,
3:47 it's a huge number I believe and it tells a lot about the adoption rate
3:52 of Code by the Python community.
3:55 And next, look at the release,
3:59 this is actually a Microsoft release, so it is an official extension
4:02 and there is a little story here
4:05 because actually the guy who started working on this project
4:07 started it as a community project on github,
4:10 then, as the adoption kept growing
4:13 Microsoft reached out to this guy and they ended up hiring him,
4:16 so now he is a Microsoft employee
4:19 and the extension itself is an official extension by Microsoft.
4:23 Now, this is interesting for a few reasons,
4:25 but I find it is important because it tells a lot
4:28 about the commitment of Microsoft into open source, Python and Code.
4:33 So let's install the extension, click on this start button here,
4:37 it will take a while, and done.
4:40 Once the extension is installed, you need to reload it, and here we go,
4:45 Python is now installed and we are ready to go.