一首诗 <newpt...@gmail.com> wrote:
>  But I think the first step to resolve a problem is to describe it.  In
>  that way, I might find the answer myself

:-) That is a great saying!

To answer your original question, split your code up into sections
that can be tested independently.  If you can test code in a isolated
way then it belongs in a class / module of its own.

If you have a class that is too big, then factor independent classes
out of it until it is the right size.  That is easier said than done
and may require some creativity on your part.  It will pay dividends
though as the level of abstraction in your program will rise.

I've noticed some programmers think in big classes and some think in
small classes.  Train yourself to do the other thing and your
programming will improve greatly!

-- 
Nick Craig-Wood <n...@craig-wood.com> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to