DEV Community

sm.lee
sm.lee

Posted on

Refactoring Struggles: Successfully Modularized, But Hitting a Wall with Scalability

main
https://gist.github.com/5c0c1c7ff0892e0a14175f7d99350d15.git
engine
https://gist.github.com/2ad8c7eea57128cfcbaa261385a1a4f0.git
teams
https://gist.github.com/15e234746f5d4d5026158c4671d599dc.git



Today, I attempted a major refactoring of my project files. I successfully separated the code into three main files: engine, main, and teams. However, my next goal—splitting the teams file into individual files for each team to allow for easier expansion—proved to be a formidable challenge.

I spent 3 to 4 hours battling persistent errors, but ultimately, the attempt was unsuccessful. To truly master refactoring, I’ve realized I need to go back to simpler simulations, re-evaluate if my logic aligns with how the machine processes data, and then see if those principles can be applied to my current project.

I’ve heard that sharing failed attempts can be just as helpful as sharing successes, so I am posting my current progress here. A huge thank you to all my followers and readers for your continuous support.

PS: To run this, copy the code from the three links into separate Python files. In your main file, update the from statements to match the filenames of your engine and teams files in your local environment.

Top comments (0)