Ideal way to separate GUI and logic?
joel.goldstick at gmail.com
Mon Jul 15 03:02:00 CEST 2013
On Sun, Jul 14, 2013 at 8:25 PM, <fronagzen at gmail.com> wrote:
> Thanks for all the responses!
> So as a general idea, I should at the very least separate the GUI from the
> program logic by defining the logic as a function, correct? And the next
> level of separation is to define the logic as a class in one or more
> separate files, and then import it to the file with the GUI, correct?
> My next question is, to what degree should I 'slice' my logic into
> functions? How small or how large should one function be, as a rule of
Others may differ. I think you should just write the code. In actually
doing that you will learn the pitfalls of how you have divided up your
logic. Writing code isn't all theory. It takes practice, and since the
days of The Mythical Man-Month, it has been well understood that you always
end up throwing away the first system anyway. It has to be built to truly
understand what you think you want to create, but in the learning, you
realize that its easier and better to start more or less from scratch
rather than try to fix the first concept.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list