Python project class/file structures.
So, I'm analyzing a project I was working on for fun with some folks over the summer, and I think we kinda fell into a bad way of coding. Essentially, we were making a side-scrolling shooter game. We had two python files in the project: game.py and classes.py.
What kept happening is that classes.py would get changed by me (adding a new class to this file) and I'd push it to github. Meanwhile, my friend "A" made some changes to add new bullet types to classes.py. He would push his changes, it turned into a bit of a mess.
I'm getting ready to start this project up again for a bit when we get on our winter break from college.
I was wondering if there's any advice the /r/Python community could give us to aid in our project development and generally help us stop being such noobs.
13 comments · 80% upvoted · other discussions
Why are you defining multiple classes in one file?
billsil 4 points · Dec 2013
It's totally unnecessary to have multiple files if the groupings are clear and the files are manageable. That's a choice the developers have to make. It's like saying each function should be in it's own file. It's totally unnecessary. Files are logical groupings of methods/classes.
robin-gvx 3 points · Dec 2013
Exactly. On the other hand,
classes.pydoesn't sound like it’s a logical grouping of classes.