Skip to content

ekohilas/refactoring-for-fun-and-profit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A repo for resources of the talk.

Resources on the project refactored can be found here

Evan Kohilas

Conference Slides Video Notes Length Year
PyCon Australia 🔗 🔗 🔗 30 min 2023
Kiwi PyCon 🔗 🔗 🔗 45 min 2023

Abstract

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!

Description

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.

Cheatsheet

  1. Test (with integration tests)
  2. Format (with Black)
  3. Lint (with Ruff)
  4. Type hint (with MonkeyType)
  5. Refactor (with PyCharm)
  6. Abstract (with Functions and Classes)
  7. Seperate (with Single Responsibility Principle)
  8. Simplify (with KISS, DRY, and Pythonic Python)
  9. Stop (with Pragmatism and YAGNI)
  10. Document (with structure, flow, and comments)
  11. Output (with logging)
  12. Profile (with Scalene)
  13. Think (with "There must be a better way")

About

Resources of the "Refactoring for Fun and Profit" talk

Resources

Stars

Watchers

Forks