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


Groups > comp.lang.python > #81922

Re: Most gratuitous comments

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Rob Gaddi <rgaddi@technologyhighland.invalid>
Newsgroups comp.lang.python
Subject Re: Most gratuitous comments
Date Thu, 4 Dec 2014 09:12:41 -0800
Organization Highland Technology, Inc.
Lines 54
Message-ID <20141204091241.1f6bf93c@rg.highlandtechnology.com> (permalink)
References <546d7505$0$12899$c3e8da3$5496439d@news.astraweb.com> <54802e01$0$15926$e4fe514c@dreader35.news.xs4all.nl>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
Injection-Info mx02.eternal-september.org; posting-host="a48e804ab85e47f9d2e8748775b64aeb"; logging-data="25885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+iIb8XcL6KbjBMn9rwkfoc"
X-Newsreader Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu)
Cancel-Lock sha1:Xu9TDjTCxuEN1uE7AcG3jqzvpys=
Xref csiph.com comp.lang.python:81922

Show key headers only | View raw


On 04 Dec 2014 09:48:49 GMT
albert@spenarnc.xs4all.nl (Albert van der Horst) wrote:

> In article <546d7505$0$12899$c3e8da3$5496439d@news.astraweb.com>,
> Steven D'Aprano  <steve@pearwood.info> wrote:
> >And the award for the most gratuitous comments before an import goes to
> >one of my (former) workmates, who wrote this piece of code:
> >
> ># Used for base64-decoding.
> >import base64
> ># Used for ungzipping.
> >import gzip
> 
> The comment lines contain genuine information. The program is
> decoding or gunzipping. (And apparently not doing the encoding part)
> 
> This information may have been better conveyed by
> "
> from base64 import base64-decode
> from gzip import gunzip
> "
> but anyway.
> 
> Also the comment may be misleading, but I think not.
> 
> If there are mysterious names for packages, the comment may be
> actually useful.
> "
> # Auxiliary for the reverse recursion to calculate
> # Chebychev coefficients.
> import courseware-2014-ch11
> "
> 
> A professor who demands from students that every import is documented
> is IMO not to blame.
> In a company's coding convention ... I've seen a lot of things there
> that make a lot less sense.
> 
> >--
> >Steven
> -- 
> Albert van der Horst, UTRECHT,THE NETHERLANDS
> Economic growth -- being exponential -- ultimately falters.
> albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
> 

In my code, I habitually use big old bar comments to break the imports
into three sections, standard library, third-party libraries, and local
imports.  I find it radically simplifies knowing where to start looking
for documentation.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.

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


Thread

Most gratuitous comments Steven D'Aprano <steve@pearwood.info> - 2014-11-20 04:58 +0000
  Re: Most gratuitous comments Chris Angelico <rosuav@gmail.com> - 2014-11-20 16:06 +1100
  Re: Most gratuitous comments Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-20 12:04 +0000
  Re: Most gratuitous comments sohcahtoa82@gmail.com - 2014-11-20 10:52 -0800
    Re: Most gratuitous comments cl@isbd.net - 2014-11-20 21:32 +0000
      Re: Most gratuitous comments sohcahtoa82@gmail.com - 2014-11-20 13:43 -0800
        Re: Most gratuitous comments Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-21 10:16 +1100
          Re: Most gratuitous comments sohcahtoa82@gmail.com - 2014-11-20 15:59 -0800
            Re: Most gratuitous comments Chris Angelico <rosuav@gmail.com> - 2014-11-21 11:17 +1100
              Re: Most gratuitous comments sohcahtoa82@gmail.com - 2014-11-20 16:19 -0800
                Re: Most gratuitous comments Chris Angelico <rosuav@gmail.com> - 2014-11-21 11:33 +1100
            Re: Most gratuitous comments Marko Rauhamaa <marko@pacujo.net> - 2014-11-21 08:52 +0200
              Re: Most gratuitous comments Grant Edwards <invalid@invalid.invalid> - 2014-11-21 17:04 +0000
              Re: Most gratuitous comments Marco Buttu <marco.buttu@gmail.com> - 2014-11-25 13:40 +0100
                Re: Most gratuitous comments Marko Rauhamaa <marko@pacujo.net> - 2014-11-25 14:53 +0200
                Re: Most gratuitous comments Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-26 01:47 +1100
      Re: Most gratuitous comments Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-20 23:18 +0000
    Re: Most gratuitous comments Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-20 21:39 -0500
  Re: Most gratuitous comments Stefan Behnel <stefan_ml@behnel.de> - 2014-11-20 20:09 +0100
  Re: Most gratuitous comments albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-12-04 09:48 +0000
    Re: Most gratuitous comments Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-12-04 09:12 -0800
  Re: Most gratuitous comments sjmsoft@gmail.com - 2014-12-04 07:08 -0800

csiph-web