A repo for resources of the talk.
Resources on the project refactored can be found here
Conference | Slides | Video | Notes | Length | Year |
---|---|---|---|---|---|
PyCon Australia | 🔗 | 🔗 | 🔗 | 30 min | 2023 |
Kiwi PyCon | 🔗 | 🔗 | 🔗 | 45 min | 2023 |
Ever been in a situation where you've hastily written a bunch of code, just to make something "work"?
Have you then trembled with fear, looking at your single, thousand line file, with global variables, multi parameter functions, and zero classes, not knowing where to start?
Or do you question why changing your complex code and fixing bugs takes so long?
Then come and learn about how refactoring can not only be fun and educational, but also profitable!
Often in programming projects, we find ourselves building layers and layers on top of a starting idea, without having been able to think about the long term design.
And that's fine! But unless push comes to shove, we often don't get the time or incentive to sit down and clean it up, especially if it all works.
In this talk, we'll discuss why you should care about good pythonic code, and how refactoring can not only be profitable, but also a fun and educational experience!
We'll look at easy to use tools and techniques that Python offers to make the process of refactoring faster and future proof for you.
And finally, we'll cover some design principles and methodologies for you to keep in mind, alongside understandable real world examples.
- Test (with integration tests)
- Format (with Black)
- Lint (with Ruff)
- Type hint (with MonkeyType)
- Refactor (with PyCharm)
- Abstract (with Functions and Classes)
- Seperate (with Single Responsibility Principle)
- Simplify (with KISS, DRY, and Pythonic Python)
- Stop (with Pragmatism and YAGNI)
- Document (with structure, flow, and comments)
- Output (with
logging
) - Profile (with Scalene)
- Think (with "There must be a better way")