Refactoring for fun and profit - Evan Kohilas (PyCon AU 2023)

preview_player
Показать описание
(Evan Kohilas) 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!

python, pycon, australia, programming, conference, technical, pyconline, developers, panel, sessions, libraries, frameworks, community, sysadmins, students, education, data, science

Videos licensed as CC-BY-NC-SA 4.0

PyCon AU is the national conference for the Python programming community, bringing together professional, student and enthusiast developers, sysadmins and operations folk, students, educators, scientists, statisticians, and many others besides, all with a love for working with Python.

Sun Aug 20 11:15:00 2023 at Hall A

00:40 - Intro
03:30 - Formatting
04:19 - Pragmatism
05:03 - Linting
05:43 - Abstraction, Interface Segregation, & Dependency Inversion
08:42 - Is there a better way?
09:10 - Refactoring using IDEs
10:51 - Benefits of typing
11:58 - Adding types with MonkeyType
12:47 - Documentation through typing
14:47 - Documentation through structure
17:12 - Benefits of Python's amazing argument system
19:00 - Single Responsibility Principle
19:47 - DRY Principle
20:53 - Caveats of Utils
21:21 - Is there a better way?
21:42 - KISS Principle
23:09 - YAGNI Principle
23:40 - Benefits of testing
24:13 - Refactoring for testing after violating Dependency Inversion
25:24 - Profiling using Scalene
27:33 - Profit?
27:53 - Resources
28:08 - Outro
29:26 - Question: What would you do to ensure that you don't accidentally break things, when refactoring with no tests?
31:23 - Question: Is there a format for docstrings that are a good replacement for typing, since setting up typing is not always an option?
33:19 - Question: Do you prefer to omit types and instead use docstrings to provide context for complex nested types?
Рекомендации по теме