How much sanity checking is required for function inputs?

Christopher Reimer christopher_reimer at icloud.com
Sat Apr 23 22:32:12 EDT 2016


On 4/23/2016 6:38 PM, Michael Selik wrote:

> Why so many files? Python can easily support thousands of lines in a
> file. If it's just one file any text editor can do a quick find-replace.

That goes back to the Java convention of having one class per file. It 
took a while to convince myself that mixing classes and functions in a 
single file was okay. Once I finished cleaning up the code for this 
round, I'll merge four files into one file (~500 lines) and have four 
files (main.py, display.py, engine.py and utility.py).

> Or just use one file to keep things easier. But, yes, I agree a module
> of constants is appropriate for bigger projects.

That's the other problem I'm running into. Building a chess engine is a 
big project. This is probably bigger than the Java XML parser I built 
from scratch for a college project. I can't seem to find any information 
on how to build bigger programs. Community college taught me how to 
program, but it didn't teach me how to go beyond class inheritance.

Thank you,

Chris R.



More information about the Python-list mailing list