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


Groups > comp.lang.python > #109786

Re: for / while else doesn't make sense

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: for / while else doesn't make sense
Date Fri, 10 Jun 2016 08:00:43 -0600
Lines 18
Message-ID <mailman.138.1465567247.2306.python-list@python.org> (permalink)
References <_lx6z.1194262$z22.146690@fx36.am4> <87shwlns34.fsf@elektro.pacujo.net> <CALwzidk3h0-CAeLobcC_iR2LJz9ocQwChMA9pyCaFUsaybsvYQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de rIg/N+k/qJVzRcWzn9nfHwSHl05sgKJdTYm10OamKAOA==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'lines,': 0.05; 'subject:while': 0.09; 'received:209.85.218': 0.10; '(must': 0.16; '1,500': 0.16; '2016': 0.16; '70.': 0.16; 'aligns': 0.16; 'columns': 0.16; 'display,': 0.16; 'fits': 0.16; 'received:209.85.218.51': 0.16; 'received:io': 0.16; 'received :mail-oi0-f51.google.com': 0.16; 'received:psf.io': 0.16; 'subject:make': 0.16; 'wrote:': 0.16; '"you': 0.18; '&gt;': 0.18; 'am,': 0.23; 'fit': 0.23; 'header:In-Reply-To:1': 0.24; 'point.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'bad.': 0.29; 'once,': 0.29; 'code': 0.30; 'becomes': 0.30; 'fixed': 0.31; 'screen': 0.32; 'particular,': 0.33; 'rule': 0.33; 'similar': 0.33; 'quickly': 0.34; 'received:google.com': 0.35; 'mine': 0.35; 'but': 0.36; 'lines': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'received:209': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'show': 0.62; 'subject: / ': 0.63; 'more': 0.63; 'more.': 0.63; 'deeply': 0.64; 'limit': 0.65; 'nested,': 0.84; 'subject:else': 0.84; 'subject:sense': 0.84; 'to:name:python': 0.84
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; bh=g8A7GYqH2ERztGBs2oFCz2SpE0+4OYID3Pj8yc+at3U=; b=ubG//A1KKHn6C6DcAb1/Ka2qspdOwhvT140SlPpZRHd7CTbyq2citXcsXhE/TSd3Ko lNxQo5bPBr/AE1CI/J8PWNqZDFCLJQ7LMahbPOUc/dAgrboUWQjz+ClcIWkKGc9KRWHI OQvOAzXiRW9o0ChTSBObCnENuXn7cGa/MiK2WOn8978bffFLMvs0OGuwhVXX0nH+X6y/ ISwq5nAgH8YIBt3I3Nhy0wS0roPRwv7l158wjPnPZnlqkljWPDBLLGwe5IZpAu5hAx3I ZaneT9mYkmUC2iIxWvGfos8u50m4q1+Dzt4EmMMPj4zOwT06MKk9cc/lXp3EX9V5sjoZ 4+hw==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=g8A7GYqH2ERztGBs2oFCz2SpE0+4OYID3Pj8yc+at3U=; b=JeAffwe3AmtjRIBUO40Wd5ZN83NpJx5305wdqXQsU4hSctCP4pZWQVue0p8J+HOoRz zcwUCRenPrBDQxuh3sG+pirpbT76JlprCibLMAypeysHpz+ZIzR/0h0ykIxK++X9PNnc KfxV9LqKHnWU4PxsaSyIxxjG6O+eHkaiThfLAKaxudbXpggUzhUb0GnAgxUWqiV0d0Ta FhpCW5CFKZkcS2/tN03TkTeu+tstH8Qq/y+LvqsxlZAHqTiJJwp7a+7mw1+8vdLzj1pA RfXQRjGqThtYGAcyqxJcguJhtwvSrkH08EwgRprm/mUD4Fck1f/+iXq0QR2g7yRiaekp vvYg==
X-Gm-Message-State ALyK8tLc5W+vfnRva73Peg1uIR2W9M9nvlw6oFVwX5XWckucPx+UsXADGWz523pK7EER9c7XRHb+c2V9OB5D3A==
X-Received by 10.157.37.6 with SMTP id k6mr1163295otb.115.1465567243781; Fri, 10 Jun 2016 07:00:43 -0700 (PDT)
In-Reply-To <87shwlns34.fsf@elektro.pacujo.net>
X-Content-Filtered-By Mailman/MimeDel 2.1.22
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CALwzidk3h0-CAeLobcC_iR2LJz9ocQwChMA9pyCaFUsaybsvYQ@mail.gmail.com>
X-Mailman-Original-References <_lx6z.1194262$z22.146690@fx36.am4> <87shwlns34.fsf@elektro.pacujo.net>
Xref csiph.com comp.lang.python:109786

Show key headers only | View raw


On Jun 10, 2016 6:37 AM, "Marko Rauhamaa" <marko@pacujo.net> wrote:
>
> alister <alister.ware@ntlworld.com>:
>
> > Or more simply a hard fixed RULE (MUST be less than X lines) is Bad.
>
> It's not X lines, it's "you must see the whole function at once."
>
> If your display can show 1,500 lines at once, that's your limit. Mine
> shows 70.

I disagree on that point. For a typical-size display, it's a reasonable
guideline. But just because your 1500-line function fits in a single screen
does not make it readable. In particular, if the function is deeply nested,
then it quickly becomes difficult to discern which code aligns with which.

A similar principle informs us that 70-100 columns is a reasonable line
length limit for readability even if your display can fit much more.

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


Thread

Re: for / while else doesn't make sense alister <alister.ware@ntlworld.com> - 2016-06-10 11:18 +0000
  Re: for / while else doesn't make sense Marko Rauhamaa <marko@pacujo.net> - 2016-06-10 15:31 +0300
    Re: for / while else doesn't make sense alister <alister.ware@ntlworld.com> - 2016-06-10 13:06 +0000
    Re: for / while else doesn't make sense Ian Kelly <ian.g.kelly@gmail.com> - 2016-06-10 08:00 -0600
      Re: for / while else doesn't make sense Steven D'Aprano <steve@pearwood.info> - 2016-06-11 00:27 +1000
        Re: for / while else doesn't make sense Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-11 13:17 +1200
      Re: for / while else doesn't make sense Marko Rauhamaa <marko@pacujo.net> - 2016-06-10 19:13 +0300

csiph-web