Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.043 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'root': 0.05; 'don': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'rationale': 0.16; 'responses.': 0.16; 'spots': 0.16; 'subject:GUI': 0.16; 'untouched.': 0.16; 'wrote:': 0.18; 'written': 0.21; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'leave': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'easier': 0.31; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'figure': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'doing': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'application': 0.37; 'performance': 0.37; 'skip:& 10': 0.38; 'pm,': 0.38; 'heard': 0.39; 'quote': 0.39; 'though,': 0.39; 'read': 0.60; 'most': 0.60; 'making': 0.63; 'name': 0.63; 'high': 0.63; 'relatively': 0.65; 'to:addr:gmail.com': 0.65; 'jul': 0.74; 'article': 0.77; '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=9yg00S9LrzfV6k9DWtyENd3uRyyWFIza7DdkixXwbs0=; b=lGGdAKu+XzfUEIIZYVxprit2oiYkQoRaw2jUVPaiVWK8H0IqlUYa7h4t8ScpHp0iUh TXWLmAF2L/Y1vtlDCTLKpwrLEBociy+8zmu177/dk6fb5cMqzvj7YuBLr8k7VjTEeam0 WRTdSkDcOKLdsaw/aoosyjEBqYc+ae7tH5OgdL7dVh82h3HQ0sDGuR0XnKEKX/Gq4qiq Z31QyE3bJUbefPu20LSF96l4PmRLkJubCFC3fB+JimqC8ujar7xs8pguySJJK+Ga9SBu 4AUGIqRJ6+mA3zjuiI5nKGUVEL4eN5l8G+98Z6oDori92SBCghDpmdc1ze/p8Q6Xnm9Y iROg== MIME-Version: 1.0 X-Received: by 10.68.27.105 with SMTP id s9mr56428182pbg.29.1373936523550; Mon, 15 Jul 2013 18:02:03 -0700 (PDT) In-Reply-To: <8152b57e-5ff3-4024-9de1-d0a20b5c14b6@googlegroups.com> References: <22e50125-633a-4bae-a317-a83a748be225@googlegroups.com> <8152b57e-5ff3-4024-9de1-d0a20b5c14b6@googlegroups.com> Date: Mon, 15 Jul 2013 18:02:03 -0700 Subject: Re: Ideal way to separate GUI and logic? From: Asim Jalis To: fronagzen@gmail.com Content-Type: multipart/alternative; boundary=bcaec520f1b96e3be604e19686f1 Cc: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1373936531 news.xs4all.nl 15905 [2001:888:2000:d::a6]:48475 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50722 --bcaec520f1b96e3be604e19686f1 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 15, 2013 at 5:25 PM, wrote: > Again, thanks for all the responses. I'm curious, though, what exactly is > the rationale for making functions so small? (I've heard that the function > calling of Python has relatively high overhead?) > There is a small overhead, but it makes the code easier to read and understand. You can look at the function name and get and idea of _what_ the function is doing instead of having to figure out _how_ it is doing it. Regarding optimization, after you have written your application if you see performance issues you can surgically optimize the spots that have the issues and leave most of the code untouched. To quote Don Knuth, "premature optimization is the root of all evil". Also the article at http://en.wikipedia.org/wiki/Program_optimization makes some good points. --bcaec520f1b96e3be604e19686f1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, Jul 15, 2013 at 5:25 PM, <fronagzen@= gmail.com> wrote:
Again, thanks for all the responses= . I'm curious, though, what exactly is the rationale for making functio= ns so small? (I've heard that the function calling of Python has relati= vely high overhead?)

There is a small overhead, but it makes the cod= e easier to read and understand. You can look at the function name and get = and idea of _what_ the function is doing instead of having to figure out _h= ow_ it is doing it.=C2=A0

Regarding optimization, after you have written your app= lication if you see performance issues you can surgically optimize the spot= s that have the issues and leave most of the code untouched.=C2=A0

To quote Don Knuth, "premature optimization is the root= of all evil". Also the article at=C2=A0http://en.wikipedia.org/wiki/Program_optimi= zation makes some good points.
--bcaec520f1b96e3be604e19686f1--