r/learnprogramming 5h ago

First semi big python project - looking for feedback on my code and structure

I'm heading off to uni in 2 weeks and I've heard personal projects can be pretty important for internships/spring weeks, so I'd love to get some feedback on a football game I've worked on.

I'd especially appreciate feedback on the code structure, readability, organisation and anything you think I should improve as I continue developing it.

https://github.com/willhe7/football-tactics-simulator

4 Upvotes

2 comments sorted by

2

u/Big_Ant5507 4h ago

I peeked at the repo and the first thing that jumps out is how you organized the match engine stuff into its own module, that's way ahead of where most people start. Usually you see a 2000 line main.py and just nope out

The player attributes dict approach is clean but you might want to look into dataclasses for that kind of thing, makes it a lot less error prone when you're passing stats around between functions

Overall pretty impressive for a pre-uni project, you'll be miles ahead of your classmates who are still figuring out fizzbuzz

2

u/db_tech_dev 1h ago

structure wise the thing that jumps out is everything's flat in root - compscifootballgame and maingui sitting next to like 5 different json data files with no folders. splitting into something like /engine, /gui, /data even loosely would make it way easier for anyone skimming the repo to find what they're looking for. solid feature list for a solo project tho, the xg and match commentary stuff is more than most people attempt.