Advent of refactoring
I made a video series!
going through a whole bunch of code refactoring concepts, focussing on web development in Django/Wordpress.
- Renaming Things
- Extract Variable
- Extracting Functions
- Extract (class) methods
- Converting a function to a method class
- Moving things around
- Guard Clauses
- Composition & Inheritance
- Data to JS
- Generators & Separating concerns
- Positional to Named arguments
- Extracting blobs of text (SQL, HTML, etc)
- Functions that create functions (closures)
- callbacks into functions
- try catch
- wrapper functions
- python decorators & context managers
- (django) QuerySets & Model property methods
- Building data attrs in the database
- Building complex class heirarchies
- Lookup tables replacing if chains
- Taking advantage of polymorphism
- Using validation libraries
- Using dataclasses for cleaner data access