Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Live long and prosper. -- Spock, "Amok Time", stardate 3372.7


devel / comp.lang.python / Re: on the popularity of loops while and for

SubjectAuthor
* Re: on the popularity of loops while and forPeter J. Holzer
`- Re: on the popularity of loops while and forHope Rouselle

1
Re: on the popularity of loops while and for

<mailman.611.1630750876.4164.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=14965&group=comp.lang.python#14965

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-pyt...@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: on the popularity of loops while and for
Date: Sat, 4 Sep 2021 12:21:14 +0200
Lines: 66
Message-ID: <mailman.611.1630750876.4164.python-list@python.org>
References: <E88B333B-5CF5-4B98-9A3E-13EDBE069A1A@barrys-emacs.org>
<YTNImjQCTtqZ7KMK@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="rb1e7/xE6CsnWtmr"
X-Trace: news.uni-berlin.de tyx+INgWYIBGAs+3WraUVQneJqJQ3NGuuEn99b/VFYRQ==
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'comments': 0.04;
'absolute': 0.05; 'content-type:multipart/signed': 0.05;
"python's": 0.05; 'loop': 0.07; 'loops.': 0.07; 'programmer':
0.07; 'python.': 0.07; 'barry': 0.09; 'content-type:application
/pgp-signature': 0.09; 'filename:fname piece:asc': 0.09;
'filename:fname piece:signature': 0.09;
'filename:fname:signature.asc': 0.09; 'novice': 0.09; 'practice.':
0.09; 'way?': 0.09; '"creative': 0.16; '__/': 0.16; 'algorithms':
0.16; 'category,': 0.16; 'challenge!"': 0.16; 'easy,': 0.16;
'encounter': 0.16; 'from:addr:hjp-python': 0.16;
'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
'hjp@hjp.at': 0.16; 'holzer': 0.16; 'loops': 0.16; 'lot,': 0.16;
'rarely.': 0.16; 'reality.': 0.16; 'stross,': 0.16;
'subject:popularity': 0.16; 'subject:while': 0.16; 'url-
ip:212.17.106.137/32': 0.16; 'url-ip:212.17.106/24': 0.16; 'url-
ip:212.17/16': 0.16; 'url:hjp': 0.16; '|_|_)': 0.16; 'wrote:':
0.16; 'python': 0.16; 'libraries': 0.20; "i'd": 0.23; 'to:addr
:python-list': 0.23; 'code': 0.24; 'probably': 0.24; "i'll": 0.28;
'sense': 0.28; 'there': 0.31; 'think': 0.31; 'but': 0.31;
'context': 0.32; 'do.': 0.32; 'header:In-Reply-To:1': 0.33;
'subject:for': 0.33; '"the': 0.35; 'trying': 0.36; 'cases': 0.37;
'those': 0.38; 'something': 0.38; 'use': 0.38; 'among': 0.61;
'english': 0.61; 'love': 0.61; 'covered': 0.61; 'likely': 0.61;
'here': 0.62; 'ever': 0.63; 'received:userid': 0.64; 'spend':
0.65; 'look': 0.66; 'choice': 0.68; 'received:212': 0.68; 'less':
0.68; 'thoroughly': 0.69; 'url-ip:212/8': 0.69; 'interesting':
0.71; 'know.': 0.72; 'life': 0.76; 'casual': 0.84; "people's":
0.84; 'rare': 0.84; 'received:at': 0.84; 'strings': 0.84; 'vs.':
0.84; 'safely': 0.91
Content-Disposition: inline
In-Reply-To: <E88B333B-5CF5-4B98-9A3E-13EDBE069A1A@barrys-emacs.org>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <https://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: <YTNImjQCTtqZ7KMK@hjp.at>
X-Mailman-Original-References: <E88B333B-5CF5-4B98-9A3E-13EDBE069A1A@barrys-emacs.org>
 by: Peter J. Holzer - Sat, 4 Sep 2021 10:21 UTC
Attachments: signature.asc (application/pgp-signature)

On 2021-08-29 10:04:47 +0100, Barry wrote:
> > I'd like get a statistic of how often each loop is used in practice.
> >
> > I was trying to take a look at the Python's standard libraries --- those
> > included in a standard installation of Python 3.9.6, say --- to see
> > which loops are more often used among while and for loops. Of course,
> > since English use the preposition ``for'' a lot, that makes my life
> > harder. Removing comments is easy, but removing strings is harder. So
> > I don't know yet what I'll do.
> >
> > Have you guys ever measured something like that in a casual or serious
> > way? I'd love to know. Thank you!
>
> I am interesting in why you think that choice of while vs. for is
> about popularity?
>
> Surely the choice is made in most cases by the algorithm?

The context here is an introductory course for Python. So there is not
"the algorithm", there are all the algorithms that a novice is likely
to encounter.

For me it makes absolute sense to base the contents of the course on
popularity. Constructs which a novice programmer is very likely to use
or encounter in other people's code should be covered more thoroughly
than constructs that will be used only rarely. Some are so rare that
they can be safely omitted. The while loop is certainly not in that
category, but it probably makes sense to spend less time on it than on
the for loop.

hp

--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

Attachments: signature.asc (application/pgp-signature)
Re: on the popularity of loops while and for

<86wnnwiktm.fsf@jevedi.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=14968&group=comp.lang.python#14968

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!rocksolid2!i2pn.org!aioe.org!+FoVw7cKPP2bnfYcOjF7tw.user.46.165.242.75.POSTED!not-for-mail
From: hrouse...@jevedi.com (Hope Rouselle)
Newsgroups: comp.lang.python
Subject: Re: on the popularity of loops while and for
Date: Sat, 04 Sep 2021 09:31:17 -0300
Organization: Aioe.org NNTP Server
Message-ID: <86wnnwiktm.fsf@jevedi.com>
References: <E88B333B-5CF5-4B98-9A3E-13EDBE069A1A@barrys-emacs.org>
<YTNImjQCTtqZ7KMK@hjp.at>
<mailman.611.1630750876.4164.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="11135"; posting-host="+FoVw7cKPP2bnfYcOjF7tw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
Cancel-Lock: sha1:5whenOT3phaRzsj/TEsSa/HwOek=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Hope Rouselle - Sat, 4 Sep 2021 12:31 UTC

"Peter J. Holzer" <hjp-python@hjp.at> writes:

> On 2021-08-29 10:04:47 +0100, Barry wrote:
>> > I'd like get a statistic of how often each loop is used in practice.
>> >
>> > I was trying to take a look at the Python's standard libraries --- those
>> > included in a standard installation of Python 3.9.6, say --- to see
>> > which loops are more often used among while and for loops. Of course,
>> > since English use the preposition ``for'' a lot, that makes my life
>> > harder. Removing comments is easy, but removing strings is harder. So
>> > I don't know yet what I'll do.
>> >
>> > Have you guys ever measured something like that in a casual or serious
>> > way? I'd love to know. Thank you!
>>
>> I am interesting in why you think that choice of while vs. for is
>> about popularity?
>>
>> Surely the choice is made in most cases by the algorithm?
>
> The context here is an introductory course for Python. So there is not
> "the algorithm", there are all the algorithms that a novice is likely
> to encounter.
>
> For me it makes absolute sense to base the contents of the course on
> popularity. Constructs which a novice programmer is very likely to use
> or encounter in other people's code should be covered more thoroughly
> than constructs that will be used only rarely. Some are so rare that
> they can be safely omitted. The while loop is certainly not in that
> category, but it probably makes sense to spend less time on it than on
> the for loop.

``A man after my own heart.''

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor