Effective PyCharm (2021 edition) Transcripts
Chapter: Why PyCharm and IDEs?
Lecture: What well cover
0:00 Let's jump right in by talking about what we're going to cover during this course we
0:03 have so many things we're going to focus on.
0:05 We're gonna start with our very next topic right away after this by talking about why
0:10 You would want to work with an Integrated Development Environment often shortened to IDE's.
0:14 That's what PyCharm is.
0:16 There are many of these out there.
0:18 There's also more light lightweight editors and we're going to see the trade offs that you
0:22 Might choose. We're also going to talk about how you go learning all the features
0:25 Of a large piece of software like an IDE.
0:28 Then we're going to focus on Projects. In Python
0:32 So often we have a loose set of files that are contained in a directory or
0:36 larger projects, multiple subdirectories and that structure and those file names mean things.
0:42 They don't just organize the code but they actually control what could we write?
0:47 What are the name spaces? Well the name spaces are the modules.
0:50 The modules are simply the folder names and things like that.
0:53 PyCharm has great support for working with code.
0:57 Not just as a standalone Python file but to treat your entire collection of files as
1:03 a single application. You often hear about people talk about what we're gonna use this
1:07 Python script to do that thing.
1:09 People don't talk about Scripting and PyCharm.
1:12 I think more in terms of applications.
1:14 Right. And that's projects are sort of the heart of this here.
1:18 The part you're going to care the most about will be the editor and of course
1:21 we would start there if we didn't really need to talk about projects first,
1:25 the editor has so many features and so many things that it can do for us
1:28 It can write code, it can find errors.
1:31 It will highlight code and it will also integrate many of the other things that we're
1:36 going to talk about later. Databases,
1:38 Source Control, all kinds of stuff.
1:39 So the editor is really going to be featured throughout the entire course but we're going
1:43 to spend chapter just drilling into the cool features of the editor itself.
1:49 Source Control is omnipresent in PyCharm.
1:51 It has support for all the popular types of Source control SVN, Git and many
1:57 many others. So when you work with your code,
2:00 you'll see that in the editor we see things about the source control status of the
2:04 code that we're working on. And it also has built in support for things like
2:08 GIT Hub said Git also Git hub itself for example,
2:12 working with issues in Git hub.
2:13 Working with poor requests. You'll see that you can look and say here's the list
2:17 of pull requests. Let me just click this button and try that pull request out
2:21 as it would be if I integrated it in my editor.
2:24 Rather than actually going to GitHub and doing all the steps to try out the
2:27 PR. All sorts of cool Source Control Integration stuff.
2:30 We're going to talk about it. There Refactoring is one of my favorite topics.
2:33 People so often get hung up about writing software.
2:36 Exactly right. And when you're getting started,
2:39 you often don't know what is exactly right.
2:41 You don't fully understand the problem space and all the little nuances until you're part way
2:45 down the road. So instead of overthinking it and trying to plan out for all
2:49 the possible eventualities, you just write your code,
2:52 you get it working if it needs to change, you
2:54 Re factor it. Often Refactoring might mean changing the code by hand and hoping
2:59 you get it right. But with PyCharm,
3:01 there are many, many tools that allow you to re factor it in a way
3:04 that's completely safe not find in files and replace text but understand the abstract syntax tree
3:10 and actually only change the symbols that are truly the same thing.
3:13 Not just have the same text.
3:15 Databases are a super important part of many many applications.
3:19 And PyCharm has really cool support for it.
3:21 You can create databases in here,
3:24 you can connect to them do queries against them.
3:27 The query console has auto complete and understands not just the SQL keywords,
3:32 but even the schema of your tables and their relationships and create diagrams and understand the
3:38 relationships between tables within our database.
3:40 And there's even one really cool trick that brings many of those features actually to embedded
3:45 SQL within your python code. So if you have a string in python that happens
3:50 to be represented a database query,
3:52 you'll see you get all kinds of support for that as well,
3:54 which it's completely mind blowing. Python is a really important way to build web applications
4:01 and PyCharm of course supports that.
4:03 We have great older frameworks like Flask and Django as well as fancy new ones like
4:09 FastAPI and others,
4:11 PyCharm has amazing support for all of these frameworks and you'll see not just the
4:15 Python side but the website as well.
4:17 The HTML, the templates like Jinja or Django templates,
4:26 All kinds of cool stuff for building server side.
4:28 Web frameworks, all sorts of cool stuff for building service side web app,
4:32 but it also has support for front end frameworks like Vue.Js and React and so
4:36 on. If you're working on a single page app or something like that,
4:42 even though it's called PyCharm,
4:48 One of the things I really like about an IDE is if something goes wrong,
4:51 you can set a breakpoint and say debug this in my editor.
4:55 You don't have to jump into some terminal and see things line by line or do
4:59 a bunch of print statements. The debugging support PyCharm is top of the field
5:02 there's really, really awesome support for quickly understanding what the state of your application
5:07 is, and moving around and even changing it to explore different situations. While a group of
5:13 files in a directory can represent an application.
5:16 If you want to create a library,
5:18 you distribute around over PyPI and other mechanisms,
5:21 you really want to create what's called a Python Package.
5:24 So these are the things that you PIP install.
5:27 And PyCharm has special support for working with existing packages and creating new packages that
5:32 you can put onto PyPI.
5:34 When our code is slow, we could try to figure out what's wrong trying to
5:37 make it faster, but usually the right thing to do is run a tool against
5:41 it to see where it's spending its time and then go to the spot where it's
5:45 spending all this time to make that one part fast.
5:47 Our intuition is often wrong about where we need to spend our time and energy to
5:51 improve the speed and the tool that we use for that is of course Profiling and
5:56 PyCharm has really cool support for both feeding reports as well as visual representations of
6:02 where our code is slow. If you want to write reliable software and especially if you're
6:06 working in a team, you need to have Unit tests and PyCharm has amazing
6:11 support for all the popular Unit test framework has built in Unit tests.
6:15 It has PyTest and many others on top of that.
6:18 It has a unified test runner that lets you do things like run a test run
6:22 many tests run just the failed test and even just continually run the test against your
6:27 app as you develop it. Very cool stuff.
6:30 We're going to see in the testing chapter,
6:32 If you are in the data science side of the world,
6:34 you are very likely going to be working with Jupyter notebooks and the data science tools
6:38 like 'Numpy' and 'pandas' and so on.
6:40 We of course have Jupyter support in PyCharm.
6:43 But there are other things, there's other support for you as well in PyCharm
6:47 when you're working with a scientific tools like 'Numpy' and 'Pandas'.
6:51 There's also a couple of other things that I don't know where they fit.
6:54 They don't belong to any of these particular categories,
6:56 but they're worth talking about and they're worth spending a little bit of time on.
6:59 So we're gonna spend a final chapter here just doing like kind of a grab bag
7:03 of awesome features and tools that you should know about that don't fit clearly into profiling
7:08 or web or whatever. And finally we're going to see how to take Py Charm
7:13 as it is an extended to be even more.
7:15 There are many, many plug ins that we can add to PyCharm to make
7:19 it exactly like we want. You wish it had Vim key bindings Well you can
7:23 get the Vim plug in, you wish that it had AI- based refactoring
7:27 support well, you can get a plug in for that.
7:29 There's all kinds of cool things to extend the type of files that understands and other
7:33 capabilities. We're gonna do a little quick survey of some of the cool plug ins
7:36 that you can get for PyCharm.
7:38 That's it. We're going to talk about so many things,
7:40 There's so much to cover as you go through this course.
7:43 I think you're going to really see how PyCharm can do more and more for
7:46 you as you work on your Python apps.