[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Good code



On Thu, Dec 06, 2007 at 05:52:59PM +0100, Mundial 82 wrote:
> Thanks to all your help, my little newbie project is shaping up. So now I 
> have a different question: being a non-programmer, I like to learn by 
> reading other people's code when it is available. I find it difficult, 
> though, to understand what are the good practices and structures that are 
> present in good coding.

Hint: it's whatever makes reading and understanding the code easier.
Usually the best way to do that is to split the code into separate
chunks (such as modules, classes and functions) that can be reasoned
about and used without having to remember what's inside them.

> So, for the code reading newbies: what are your examples of nice, clean, 
> elegant code for games that I could take a look at (beyond the pygame.org 
> tutorials, that is)?

I've tried to make pyspacewar code nice and clean:
http://mg.pov.lt/pyspacewar/trac/browser/trunk/src/pyspacewar/

Regards,
Marius Gedminas
-- 
lg_PC.gigacharset (lg = little green men language, PC = proxima centauri)
	-- Markus Kuhn provides an example of a locale

Attachment: signature.asc
Description: Digital signature