Effective PyCharm Transcripts
Chapter: Refactoring
Lecture: Your turn: Refactoring
Login or
purchase this course
to watch this video and the rest of the course contents.
0:01
Refactoring is a place where PyCharm really shines. You can see it actually working much better than most editors.
0:10
Here is a chance to take some existing bad code and apply the refactoring tools to make it what I would consider better.
0:17
So, let's look at the steps we're going to go through on github. Over here on github, your turn 4, there is a couple of things,
0:26
we have our read me with the instructions, and we have the smelly podcast as in it has many code smells within it.
0:32
So smelly podcast is what you are going to work on to take and transform into a better version if for some reason you want to see
0:40
what the expected result was supposed to be here is the expected final version,
0:44
but obviously, don't start with that, there will be nothing to refactor. So we'll come down here and we're going to open up that project
0:50
and use some of the code smells to guide us on how to fix it. So we're going to use the large method smell here,
0:57
the large method, and some of the refactoring tools around that and we're going to use what I am calling the large module
1:04
Kent Beck and Martin Fowler and those guys were in object oriented world where they talked about large classes,
1:10
but I think PyCharm probably has a large module smell concept as well. And then, this thing that I am naming variable absence
1:17
where we just have these really complicated expressions like this we had some variables but names, we wouldn't know what that means.
1:24
So you're going to use the refactoring tools on that as well. And once you're done with this, I think you'll see you have a much nicer bit of code
1:31
and you can do this with really doing nothing but deriving the tools that run the refactoring you won't actually have to write really any code at all.