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


Groups > comp.lang.python > #44889

Re: First python program, syntax error in while loop

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.054
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'subject:error': 0.03; 'languages.': 0.04; 'subject:while': 0.09; 'python': 0.11; '"good': 0.16; 'blanket': 0.16; 'blocks': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'indent': 0.16; 'it."': 0.16; 'parentheses': 0.16; 'subject:program': 0.16; 'subject:python': 0.16; 'language': 0.16; 'wrote:': 0.18; 'deduct': 0.19; "python's": 0.19; 'examples': 0.20; 'code,': 0.22; 'example': 0.22; 'programming': 0.22; 'logical': 0.24; "i've": 0.25; '2005': 0.26; 'header:In-Reply- To:1': 0.27; 'point': 0.28; '[1]': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; 'becoming': 0.31; 'exceptions': 0.31; 'indentation': 0.31; '"the': 0.34; 'sense': 0.34; 'there,': 0.34; 'advice': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'should': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'quote': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'most': 0.60; "you're": 0.61; 'first': 0.61; 'national': 0.62; 'times': 0.62; 'such': 0.63; 'our': 0.64; 'more': 0.64; 'school': 0.64; '(that': 0.65; 'finally': 0.65; 'computers': 0.72; 'prime': 0.74; 'subject:First': 0.74; 'achievement': 0.84; 'girls': 0.91; 'hate': 0.91; 'province': 0.91; 'africa': 0.95; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=kIgpyaatpbSuEcrx4ain2RIzGTp8FTUT21Swo40QX2o=; b=VOQJxrSQ4ufncyMuNN83DJOccnAdTmYnqbwCZW7YTCXOYe4QYPsfwI7SL0IhU0nocK juW41U3ddIoAD/MyF3N2/9rKgTeynxJ+lgbw7kuv0Dknvf3FbcdmzKSsxd/q/tL3/7Ks E2jWXPD5/TG03HnWiQ73OS/wEYuxPD/fRJJixTORjtdKcCGGO+06EKuQIS3pWrU1nMbf +bpuOi4ZS0kNifvZ3mjwEV827dgtdx8IYfHNphHQFTgNv49b/TVYmHFOKOxgv0W4RdJk +EYsmgYJkFeoaYeGuPMaGFCD+l4DakDNghaAqwKJct+X0X48bo8KEHCyMhaRjOnyEY6g 2PXw==
MIME-Version 1.0
X-Received by 10.58.50.7 with SMTP id y7mr1199524ven.24.1367933397236; Tue, 07 May 2013 06:29:57 -0700 (PDT)
In-Reply-To <CAM6w3no+sUrF+=jOOgr2SBpPQSZS4EQSLSF7LM19W14rAAPiUA@mail.gmail.com>
References <CAM6w3no+sUrF+=jOOgr2SBpPQSZS4EQSLSF7LM19W14rAAPiUA@mail.gmail.com>
Date Tue, 7 May 2013 23:29:57 +1000
Subject Re: First python program, syntax error in while loop
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.1408.1367933400.3114.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367933400 news.xs4all.nl 16001 [2001:888:2000:d::a6]:55100
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44889

Show key headers only | View raw


On Tue, May 7, 2013 at 10:44 PM, Ombongi Moraa Fe
<moraa.lovetakes2@gmail.com> wrote:
> My first language was Pascal. It was at a time in 2005 when computers were
> finally becoming popular in Africa and our year was the first time a girls
> school from our Province did a computer coursework for National Exams. (That
> was such an achievement *sigh*)
>
> "The teacher said ... Good Programming Practice ... Use parentheses to
> format code.. or I will deduct a point from your work when I feel like it."
>
> Cant seem to let go of the behavior. I use parentheses in all languages.

Pretty much all such blanket advice is flawed. I cannot at present
think of any example of a "Good Programming Practice" suggestion that
doesn't have its exceptions and caveats. The only ones that don't are
the ones that get codified into language/syntax rules, and even there,
most of them have their detractors. Python's indentation rule is a
prime example; most people follow the advice to always indent blocks
of code, Python makes it mandatory, and some people hate Python for
it. (And yes, there have been times when I've deliberately misindented
a block of C code, because it made more logical sense that way. I can
quote examples if you like.)

The only principle that you should follow is: Think about what you're
doing. Everything else is an elaboration on that. [1]

ChrisA
[1] Matthew 22:37-40 :)

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


Thread

Re: First python program, syntax error in while loop Chris Angelico <rosuav@gmail.com> - 2013-05-07 23:29 +1000

csiph-web