Effective PyCharm Transcripts
Chapter: Why PyCharm and IDEs?
Lecture: Why choose an IDE?
Login or
purchase this course
to watch this video and the rest of the course contents.
0:02
Let's expand on this idea of why an IDE generally makes developers much more productive. I'm going to give you 12 reasons why I think that's the case.
0:14
First of all, the entire project, all of the files and all of the different languages are brought together in an IDE like PyCharm.
0:23
We could be working on a web application, it could have a Javascript file and in that Javascript file, there might be some functions or even classes
0:31
that we're going to use in say a script block in our Chamelon templates, and PyCharm knows about all those different things,
0:40
it can give you completion, even re-factoring help across all these different languages, across hundreds of Python files,
0:47
across different languages, it's really great. So this ability to understand the whole project, not just a single file,
0:54
as not just keywords, but actually as an abstract syntax tree understanding the structure of all these different pieces of code
1:01
and putting them together, this is super important and allows you to write small code and navigate between them, between different files
1:09
instead of jamming everything into one huge Python file. That leads to really high developer productivity
1:16
if you can navigate and understand code really well, you type "something." and then boom, here's a list of all the things that it does
1:26
even if it happens to be defined somewhere else or somewhere not entirely clear where it comes from
1:31
that is super helpful, so you'll see the IDE really helps you write faster code by leading to better understanding of the structure of the code.
1:40
I kind of touched on this little bit, but you'll have smaller files which means fewer merge conflicts
1:49
it's easier to know like over here, the purpose of this file is to do this one or two things, not jam it all together,
1:57
so I think the fact that we can navigate and understand across these files really well is super important.
2:03
In PyCharm you have this concept of run configuration so for example, on the project that runs the training website
2:10
it has, of course, a configuration that will run the Pyramid web application that starts up, that is the website.
2:18
It also has unit tests, that it will run, it can do code coverage and things like that, that's another configuration that it knows about.
2:26
There's a bunch of little utility scripts and stuff that do various things like back up data or transform data
2:32
or things like this in the web application, and those have their own configurations, maybe with builtin command line arguments already passed to them
2:42
so this ability to configure all of these different ways to run and analyze your code are really powerful.
2:47
Because PyCharm understands the whole project, it can re-factor across a whole bunch of files and re-factor even things like docstrings and comments,
2:57
if I rename a function and there's a comment that talks about the function name,
3:00
I can have it rename that function name in the comment, that's really cool. Similarly, because it understands everything
3:06
it gives you much more realistic and complete autocomplete or intellisense that is try to go call a function, it goes boom,
3:14
here's what all the functions that are available say on this class, or for this given function, here's what the arguments are,
3:21
this one takes a thing called URL and that's a string, it takes a date and that's a datetime, something like this.
3:28
It has good understanding of virtual environments, so we can create a number of different virtual environments tie these to our run configurations
3:37
and have clean, reproducible isolated applications every time we open up our project to make it go. There is a really nice package management UI
3:48
so this is like pip, but there's also a UI version it shows you all the various versions of what you have,
3:53
it will show you whether they're up to date or if there is an update for it, it'll let you search for things that are related to what you're doing.
4:00
I find I don't use that that much these days, because I am pretty comfortable with pip and just finding things,
4:07
but when I was new I found that really helpful still every now and then it's kind of nice to just go pull it up and search through what's available.
4:14
One of the really great things with the PyCharm is that it has, there is probably an official term for it
4:18
but I call these "helper fixes," it's a little light bulb that'll come up saying
4:20
"You know, you called random.choice, but you didn't import random at the top, so your code is going to fail, but don't worry,
4:28
I know that if I put import random at the top, then your code is going to run, so just hit a key stroke and I'll fix it for you."
4:36
There is all these little fixes like this, like, "You're trying to call this function on a module, it doesn't exist,
4:41
would you like me to write the function for you, and then you go fill out the details?" Or, "I see that you are using some external library in a file
4:50
but it's not in your requirements.txt, shall I add it?" All these cool little "helper fixes" are super awesome even if you know what you're doing,
4:58
the fact that you don't have to spend time thinking about it it's just a single keystroke as you type means you can stay in flow and keep on writing.
5:05
All right, great, source code integration, right, get github and various other source control systems as we'll see when we get into that,
5:14
this is really great if you don't want to leave your environment to just do source control you have a visual source control as we'll see,
5:20
in the editor, in the project space all sorts of stuff. The database tooling is super cool in PyCharm,
5:27
so it's really easy to understand various relational databases and if you're even working with something like SQLAlchemy
5:34
that generates the database, there is still really great tools to help you understand and explore
5:40
and even change the database once the table is being created. We talked about package support, this is the ability to create new packages
5:49
to create the setup infrastructure or scaffolding so that you can install and register your package and things like that.
5:56
And finally, the unit testing component is really great if you're doing unit tests or even integration tests
6:02
you can write either pytest or a regular unit test tests for those and then run them in PyCharm and get things
6:10
like code coverage and all sorts of stuff. There is tons and tons more, and that's what we are going to cover in this course
6:16
it's all the things that I haven't even talked about yet, including these, of course. So, why wouldn't you want all of this stuff at your fingertips?
6:23
I honestly don't know, I think you probably do, that's why you're in this PyCharm class
6:28
and we're going to talk about how you make all of these things sing, and do exactly what you want and way more.