07:31Step-By-Step Chess Game Refactoring | Code Roast
From the creator
π· Review code better and faster with my 3-Factor Framework: https://arjan.codes/diagnosis. 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: https://github.com/ArjanCodes/2022-chessroast π ArjanCodes Courses: https://www.arjancodes.com/courses/ π 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
Published 2022-10-07 Β· Watch on YouTube β
Availability and playback restrictions are controlled by the original channel.





