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?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joel.goldstick@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.030
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'anyway.': 0.05; 'practice,': 0.07; 'function,': 0.09; 'logic': 0.09; 'cc:addr :python-list': 0.11; 'gui': 0.12; 'mythical': 0.16; 'scratch': 0.16; 'subject:GUI': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'import': 0.22; 'email addr:gmail.com&gt;': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'question': 0.24; 'cc:2**0': 0.24; 'define': 0.26; 'least': 0.26; 'header:In-Reply- To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'easier': 0.31; 'idea,': 0.31; 'file': 0.32; 'class': 0.32; 'url:python': 0.33; 'but': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'url:listinfo': 0.36; 'doing': 0.36; 'next': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'level': 0.37; 'pm,': 0.38; 'rather': 0.38; 'realize': 0.39; 'url:mail': 0.40; 'how': 0.40; 'days': 0.60; 'truly': 0.60; 'first': 0.61; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'jul': 0.74; 'concept.': 0.84; 'divided': 0.91; 'joel': 0.91; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=SeHcE3oVCN621lBFKS1DrnlcjGZ20kLnAHJrlEhHsqY=; b=h5NcLaY21K2HfNklp9iHm1/oeLB1mFKQ2y0P4Y5tI0zFVj58jWoR99qeQWZhbxwplN MZj4t0jYMTS0/4ORbcA2gkisgzF0X5GTSM7JpYPWWWx7c1C5bX9nK5RtgkvpqxqFK/zA blXT36v404jaq4s07hpCkgnQu4KlR/ILWbxeexyToYvNzOkUcVVuP77qW0DX8A808CSm W2f0GLLAYesjUB9FXPZVo9kFpJyAJH3OrXCZQnG9yAZ7KQgPc0XNhNmTDrn44hmjqzL3 MAqGmPibf1Exb1mR7podV/4c/WfqV0y1YOFjcJAwebmpKdCn8UTDxCOotP6JDdRolcpT UfLg==
MIME-Version 1.0
X-Received by 10.52.35.17 with SMTP id d17mr23473548vdj.74.1373850120167; Sun, 14 Jul 2013 18:02:00 -0700 (PDT)
In-Reply-To <bc883a02-1db9-4428-ac19-838606dd866d@googlegroups.com>
References <b8d83518-77f9-4b09-8b6b-f8e6c84efa50@googlegroups.com> <mailman.4685.1373742210.3114.python-list@python.org> <bc883a02-1db9-4428-ac19-838606dd866d@googlegroups.com>
Date Sun, 14 Jul 2013 21:02:00 -0400
Subject Re: Ideal way to separate GUI and logic?
From Joel Goldstick <joel.goldstick@gmail.com>
To fronagzen@gmail.com
Content-Type multipart/alternative; boundary=20cf307cfc4063277c04e18268a8
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4706.1373850127.3114.python-list@python.org> (permalink)
Lines 74
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1373850127 news.xs4all.nl 15881 [2001:888:2000:d::a6]:47961
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:50653

Show key headers only | 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