filmov
tv
Python Refactoring: From Functions to Classes for Efficient Coding
![preview_player](https://i.ytimg.com/vi/btBFH5GKd-k/hqdefault.jpg)
Показать описание
---
Welcome back to another Pybites refactoring video!
In today's video, we show you how to transform a set of functions into a class. This example will demonstrate when and how to use classes effectively.
We'll explore how a class maintains state, encapsulates data + behavior, reduces code repetition and can even improve the performance of your code.
By the end of this video, you'll have a clear understanding of refactoring techniques that can make your Python code cleaner and more maintainable.
Chapters:
00:00 Intro
00:23 Functions with repetition and using global scope
01:21 Writing a class and distinguishing config and user data
02:15 Make the functions methods
02:43 Using the instance variables in the methods
05:02 Fix the method calls
05:31 Making an instance to test this + IDE autocomplete
06:30 Calling the methods
07:01 Removing the setup repetition = less code + could be more performant
07:50 Wrap up
Resources:
Check out our dedicated refactoring playlist for similar videos:
---
Liked this video? Please give it a Like and subscribe to not miss any future videos. 📈 🙏
Welcome back to another Pybites refactoring video!
In today's video, we show you how to transform a set of functions into a class. This example will demonstrate when and how to use classes effectively.
We'll explore how a class maintains state, encapsulates data + behavior, reduces code repetition and can even improve the performance of your code.
By the end of this video, you'll have a clear understanding of refactoring techniques that can make your Python code cleaner and more maintainable.
Chapters:
00:00 Intro
00:23 Functions with repetition and using global scope
01:21 Writing a class and distinguishing config and user data
02:15 Make the functions methods
02:43 Using the instance variables in the methods
05:02 Fix the method calls
05:31 Making an instance to test this + IDE autocomplete
06:30 Calling the methods
07:01 Removing the setup repetition = less code + could be more performant
07:50 Wrap up
Resources:
Check out our dedicated refactoring playlist for similar videos:
---
Liked this video? Please give it a Like and subscribe to not miss any future videos. 📈 🙏
Python Refactoring: From Functions to Classes for Efficient Coding
Quick Python Refactoring Tips
Super Quick Python Refactoring Tips
Refactoring Object-Oriented to AWESOME Functional Code
25 nooby Python habits you need to ditch
Brett Slatkin - Refactoring Python: Why and how to restructure your code - PyCon 2016
Refactoring Python Code: Refactoring Through Splitting Up Functions|packtpub.com
Mastering Python Refactoring: Simplifying Code with the Dictionary Dispatch Pattern
Python Live Stream 10 hours part 222
Build w/ Python 4: Python Code Refactoring (Modular python functions)
Extract Method Refactoring Example in Python
Code Review: Python. Refactoring a function to increase its capabilities
Amanda Sopkin - The Refactoring Balance Beam: When to Make Changes and When to Leave it Alone
Python 07 - Refactoring
Refactoring a Boolean Function in Python🐍 #shorts
Code Refactoring Simplified: How LAMBDA Functions Lead the Way! #techeducation #pythonforbeginners
Python Refactor Clinic #1
Refactoring Python code
Refactoring A Tower Defense Game In Python // CODE ROAST
Python Refactoring: 'while True' Infinite Loops & The 'input' Function
CODE ROAST: Yahtzee - New Python Code Refactoring Series!
Python Refactoring Tip, Use any for many or operations #pythonprogramming #python #python3
Avoid endless if-else statements with this Python Tip!!
1M lines of code in one PR ☠️ (w/ @CodeRabbitAI)
Комментарии