filmov
tv
Python Refactoring: Turn Magic Numbers into Constants for Readability

Показать описание
---
In today's video, we delve into the topic of "magic numbers" and discuss why it's crucial to avoid them in your code.
I'll walk you through a hands-on Python example, demonstrating how magic numbers can reduce code readability. We'll then refactor the code using constants. An added advantage of this approach is the ability to reuse these constants across different modules.
Code Repository:
Complete Refactoring Playlist:
Chapters:
00:00 Introduction
00:38 Why Comments Can Be a Code Smell
01:14 Refactoring: Replace Magic Numbers with Constants
01:38 The Role of Asserts in Refactoring
02:18 How Using Constants Enhances Readability
03:13 Diving into a More Complex Refactoring Example
04:00 The Reduced Need for Comments After Refactoring
04:10 Conclusion and Wrap-up
---
Enjoyed the video? Don't forget to subscribe for more content!
In today's video, we delve into the topic of "magic numbers" and discuss why it's crucial to avoid them in your code.
I'll walk you through a hands-on Python example, demonstrating how magic numbers can reduce code readability. We'll then refactor the code using constants. An added advantage of this approach is the ability to reuse these constants across different modules.
Code Repository:
Complete Refactoring Playlist:
Chapters:
00:00 Introduction
00:38 Why Comments Can Be a Code Smell
01:14 Refactoring: Replace Magic Numbers with Constants
01:38 The Role of Asserts in Refactoring
02:18 How Using Constants Enhances Readability
03:13 Diving into a More Complex Refactoring Example
04:00 The Reduced Need for Comments After Refactoring
04:10 Conclusion and Wrap-up
---
Enjoyed the video? Don't forget to subscribe for more content!
Python Refactoring: Turn Magic Numbers into Constants for Readability
Clean Coding Tips: replacing magic numbers with well named variables.
Replace Magic Number With Symbolic Constant
Quick Python Refactoring Tips
Why you should not use magic numbers in your Javascript and how to clean them up #shorts
Smelly code and Magic Numbers
#266 - Refactoring Your Code like Magic with Sourcery
Satisfying ascii animation with C 😉 - The doughnut shaped code that generates a spinning 🍩
Refactoring in Python with Jupyter Notebook for Beginners
Mastering Python Refactoring: Simplifying Code with the Dictionary Dispatch Pattern
Refactoring A Data Science Project Part 1 - Abstraction and Composition
Top 5 Bad Code Smells You Didn't Know! 🚫💻 #top5 #codesmells
Refactoring a Battleship Game in Python // Code Roast Part 1 of 2
Live Refactoring Session: Getting rid of dirty code
Tips for Clean Python Code - Talk Python to Me Ep.404
Measuring Python Code Quality, Simplicity, and Maintainability | Real Python Podcast #117
using numbers in your code is bad
7.3 Refactoring — How to refactor a Jupyter notebook (demo) #CH4DS
7.2 Refactoring — Preparatory steps for refactoring #CH4DS
Idiomatic Python: Decomposition & Refactoring Demo
8 Tips To Write Clean Code - Refactoring Exercise
Refactoring Code with the Standard Library
Make Your Code More Readable With The Magic Of Refactoring Using Sourcery
EdmontonPy October 2019: Refactoring Python Scripts
Комментарии