Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #50653

Re: Ideal way to separate GUI and logic?

References <b8d83518-77f9-4b09-8b6b-f8e6c84efa50@googlegroups.com> <mailman.4685.1373742210.3114.python-list@python.org> <bc883a02-1db9-4428-ac19-838606dd866d@googlegroups.com>
Date 2013-07-14 21:02 -0400
Subject Re: Ideal way to separate GUI and logic?
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4706.1373850127.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Sun, Jul 14, 2013 at 8:25 PM, <fronagzen@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
> thumb?
> --
> http://mail.python.org/mailman/listinfo/python-list
>


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.



-- 
Joel Goldstick
http://joelgoldstick.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Ideal way to separate GUI and logic? fronagzen@gmail.com - 2013-07-13 04:07 -0700
  Re: Ideal way to separate GUI and logic? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-13 11:43 +0000
  Re: Ideal way to separate GUI and logic? Roland Koebler <r.koebler@yahoo.de> - 2013-07-13 15:56 +0200
  Re: Ideal way to separate GUI and logic? Dave Cook <davecook@nowhere.net> - 2013-07-13 17:40 +0000
  Re: Ideal way to separate GUI and logic? Wayne Werner <wayne@waynewerner.com> - 2013-07-13 14:03 -0500
    Re: Ideal way to separate GUI and logic? fronagzen@gmail.com - 2013-07-14 17:24 -0700
    Re: Ideal way to separate GUI and logic? fronagzen@gmail.com - 2013-07-14 17:25 -0700
      Re: Ideal way to separate GUI and logic? Joel Goldstick <joel.goldstick@gmail.com> - 2013-07-14 21:02 -0400
        Re: Ideal way to separate GUI and logic? Roy Smith <roy@panix.com> - 2013-07-14 21:30 -0400
      Re: Ideal way to separate GUI and logic? Steven D'Aprano <steve@pearwood.info> - 2013-07-15 01:44 +0000
  Re: Ideal way to separate GUI and logic? asimjalis@gmail.com - 2013-07-15 10:06 -0700
    Re: Ideal way to separate GUI and logic? fronagzen@gmail.com - 2013-07-15 17:25 -0700
      Re: Ideal way to separate GUI and logic? Owen Marshall <o@owenmarshall.invalid> - 2013-07-16 00:42 +0000
      Re: Ideal way to separate GUI and logic? Asim Jalis <asimjalis@gmail.com> - 2013-07-15 18:02 -0700
      Re: Ideal way to separate GUI and logic? Chris Angelico <rosuav@gmail.com> - 2013-07-16 13:18 +1000

csiph-web