About one class/function per module

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Mon Nov 2 10:03:58 CET 2009


Peng Yu a écrit :
(snip)
> I prefer organized my code one class/function per file (i.e per module
> in python). I know the majority of programmers don't use this
> approach. Therefore, I'm wondering what its disadvantage is.

Hmmm... As far as I'm concerned, you already answered your own question: 
"the majority of programmers don't use this approach".

Now, for a much more practical answer:
1/ having to handle thousands of files for even a simple project is a 
king-size PITA for the maintainer.
2/ having to load thousands of modules will add quite a lot of overhead 
when actually running the code.
3/ as a result, the poor guy that will end up maintaining your code will 
positively hate you. Beware : this poor guy might as well be you.



More information about the Python-list mailing list