Рет қаралды 49,149
It’s been a while, but I am back with a new code roast video! Today I'm refactoring a Chess game. By practicing code reviewing you greatly improve your own coding abilities, become more critical of your own code and open up your mind.
👉🏻 The code I worked on in this video is available here: github.com/ArjanCodes/2022-ch...
👷 Join the FREE Code Diagnosis Workshop to help you review code more effectively using my 3-Factor Diagnosis Framework: www.arjancodes.com/diagnosis
💻 ArjanCodes Blog: www.arjancodes.com/blog.
🎓 Courses:
The Software Designer Mindset: www.arjancodes.com/mindset
The Software Designer Mindset Team Packages: www.arjancodes.com/sas
The Software Architect Mindset: Pre-register now! www.arjancodes.com/architect
Next Level Python: Become a Python Expert: www.arjancodes.com/next-level...
The 30-Day Design Challenge: www.arjancodes.com/30ddc
🛒 GEAR & RECOMMENDED BOOKS: kit.co/arjancodes.
👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!
💬 Discord: discord.arjan.codes
🐦Twitter: / arjancodes
🌍LinkedIn: / arjancodes
🕵Facebook: / arjancodes
📱Instagram: / arjancodes
👀 Code reviewers:
- Yoriz
- Ryan Laursen
- James Dooley
- Dale Hagglund
🎥 Video edited by Mark Bacskai: / bacskaimark
🔖 Chapters:
0:00 Intro
2:03 Example code explanation
5:03 Analysis of the current code
5:10 Wildcard imports
6:30 Hardcoded values
7:19 Initialising issues
7:57 CommandHandler misplacement
9:30 Precise type hints
10:30 Reuse buttons and images
17:20 Law of Demeter violations
18:38 Refactor 1: Guard clauses
20:59 Refactor 2: Change the Piece inheritance hierarchy to a single class
24:18 Refactor 3: Create a Board class that has useful methods
26:55 Refactor 4: Fill the board from a FEN string
29:07 Refactor 5: Split out the valid moves functions
30:35 Abstraction with Protocol class
30:50 Final thoughts
#arjancodes #softwaredesign #python
DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!