Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'value,': 0.04; 'subject:Python': 0.05; 'python': 0.08; 'corresponds': 0.09; 'defined.': 0.09; 'frankly': 0.09; 'programmers.': 0.09; 'read.': 0.10; 'talks': 0.10; 'am,': 0.12; 'language,': 0.14; '(aka': 0.16; 'docstrings': 0.16; 'does,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'suffers': 0.16; 'unfamiliar': 0.16; 'wins': 0.16; 'mon,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'english.': 0.18; 'programming': 0.20; 'badly': 0.21; 'received:209.85.210.174': 0.21; 'received:mail- iy0-f174.google.com': 0.21; 'header:In-Reply-To:1': 0.22; 'statement': 0.23; 'similarly': 0.23; "python's": 0.24; 'code.': 0.26; 'code': 0.26; 'figure': 0.26; '"the': 0.26; 'function': 0.27; 'code,': 0.28; 'work,': 0.28; 'value.': 0.28; "i'm": 0.28; 'message-id:@mail.gmail.com': 0.29; 'languages.': 0.29; 'replaced': 0.29; 'if,': 0.30; 'really,': 0.30; 'for?': 0.32; 'does': 0.32; 'that,': 0.32; 'yet': 0.32; 'programmers': 0.32; 'languages': 0.32; "can't": 0.33; 'anything': 0.34; 'someone': 0.34; 'to:addr:python-list': 0.35; 'something': 0.35; "he's": 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'some': 0.38; 'should': 0.38; 'received:209': 0.39; 'everyone': 0.39; 'to:addr:python.org': 0.40; 'easy': 0.60; 'john': 0.61; 'more': 0.61; 'high': 0.66; 'conceptual': 0.67; '19,': 0.68; 'placed': 0.69; 'today,': 0.69; 'learned': 0.73; 'low': 0.74; 'dead': 0.77; 'algorithm,': 0.84; "paul's": 0.84; 'readability': 0.84; 'glance': 0.91; 'readily': 0.93 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 :content-type:content-transfer-encoding; bh=kw5ofhMjv3nlaWRokFmDVwDZeX2pZomyhoXh9R9WRns=; b=u3kat6pJ021xUh8wHrK07zvAeoho7TGd6hoRWlZoWmGs8lpXk6ew0iKH2rhb7JfobR fiGzVYXxgKmBNWrouUz9hERjtly3GZf8ngJsvv7+g6r32hXFVopWFGu4+xj49oPYhu7A irGrdOgkN1ynoyRz8ONBS/JnHUXr64sTFI0Bos4q9ONcXU+8zWaX8IP039LOvuz0WxXt fqZeLdt2UKiMgeESckOSZOPu3lfYI3DnBLbR2tpT1ZYWA6hZO7HaF1PEQAmytpMNQ3zk 3nGJ5AnwCwJD6k/o4gfRkQTcSG3YLmsmGn0EH6/1Ojx1vQq0jRVEbQg/fSBxJSVQ9BOC u2Qg== MIME-Version: 1.0 In-Reply-To: References: <4f612b19$0$1379$4fafbaef@reader2.news.tin.it> <8e72d74f-c844-4de3-8a37-f6b1fdc2291f@y27g2000yqy.googlegroups.com> <50e9ceec-40f1-4ead-b2b6-87328b30d084@ow8g2000pbc.googlegroups.com> Date: Mon, 19 Mar 2012 09:02:06 +1100 Subject: Re: Python is readable From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332108130 news.xs4all.nl 6889 [2001:888:2000:d::a6]:32803 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21867 On Mon, Mar 19, 2012 at 8:30 AM, John Ladasky wrote: > What I would say is that, when PROGRAMMERS look at Python code for the > first time, they will understand what it does more readily than they > would understand other unfamiliar programming languages. =A0That has > value. This is something that's never truly defined. Everyone talks of how this language or that language is readable, but if you mean that you can look at a line of code and know what *that line* does, then Python suffers badly and assembly language wins out; but if you mean that you should be able to glance over an entire function and comprehend its algorithm, then I have yet to see any language in which it's not plainly easy to write bad code. Even with good code, anything more than trivial can't be eyeballed in that way - if you could, what would docstrings be for? Really, the metric MUST be Python programmers. Intuitiveness is of value, but readability among experienced programmers is far more useful. If I write a whole lot of code today, and next year I'm dead and someone else has replaced me, I frankly don't mind if he has to learn the language before he can grok my code. I _do_ mind if, even after he's learned the language, he can't figure out what my code's doing; and that's where Python's placed itself at about the right level - not so high that it's all in airy-fairy conceptual work, but not so low that it gets bogged down. There's a handful of other languages that are similarly placed, and they're the languages that I would call "readable". Here's an analogy: One statement (aka line of code, etc) corresponds to one sentence in English. Massive one-liners are like some of the sentences in Paul's epistles; assembly language is like "The cat sat on the mat". Both are valid; both are hard to read. There, have fun tearing thaat to shreds :) ChrisA