alexeagleson / arctic-lab

Python Roguelike game using an ASCII terminal supported by the libtcod library.
1 stars 0 forks source link

Break code into smaller modules #2

Closed timothymtorres closed 3 years ago

timothymtorres commented 6 years ago

Hello again!

After you posted in /r/roguelikedev I was examining your repo and have a few helpful suggestions. A good programming practice is to fragment your code into smaller pieces so that the file(s) don't get too large. It makes it easier to navigate, manage, and tremendously improves code readability. I would suggest you do this with different data: maps, items, characters, etc.

Another thing that would probably be helpful is to experiment with the structure of your directory. Consider a "audio" folder for sounds, "code" folder for code, "graphics" folder for maps, particle effects, etc.

The only time where having a single large file might be a good idea is if you were building a library for others to use.

alexeagleson commented 6 years ago

Thank you! Appreciate the tips. Definitely will put them into practice for the next project

Alex

Sent from my iPhone

On Jan 27, 2018, at 1:15 PM, Tim notifications@github.com wrote:

Hello again!

After you posted in /r/roguelikedev I was examining your repo and have a few helpful suggestions. A good programming practice is to fragment your code into smaller pieces so that the file(s) don't get too large. It makes it easier to navigate, manage, and tremendously improves code readability. I would suggest you do this with different data: maps, items, characters, etc.

Another thing that would probably be helpful is to experiment with the structure of your directory. Consider a "audio" folder for sounds, "code" folder for code, "graphics" folder for maps, particle effects, etc.

The only time where having a single large file might be a good idea is if you were building a library for others to use.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.