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


Groups > comp.lang.python > #51357

Re: Understanding other people's code

References <66c25416-eaa5-4ac1-a71d-2b2948dec2fb@googlegroups.com> <b023f6e6-a11d-4d05-a126-e3cc49cb367e@googlegroups.com> <51f3c764$0$26864$e4fe514c@dreader37.news.xs4all.nl>
Date 2013-07-27 14:41 +0100
Subject Re: Understanding other people's code
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.5171.1374932473.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Sat, Jul 27, 2013 at 2:13 PM, Albert van der Horst
<albert@spenarnc.xs4all.nl> wrote:
> If the code is really tidy, it is possible to understand a function
> using only the *documentation* (not the code itself) of any function
> or data it uses.

I'd broaden that slightly to the function's signature, which consists
of the declaration line and any associated comments (which in Python
should be in the docstring). The docstring kinda violates this
concept, but what I generally try to explain is that you should be
able to understand a function without reading any of the indented
content.

ChrisA

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


Thread

Understanding other people's code "L O'Shea" <lo0446@my.bristol.ac.uk> - 2013-07-12 07:22 -0700
  Re: Understanding other people's code Chris Angelico <rosuav@gmail.com> - 2013-07-13 00:46 +1000
  Re: Understanding other people's code Peter Otten <__peter__@web.de> - 2013-07-12 17:21 +0200
  Re: Understanding other people's code "Eric S. Johansson" <esj@harvee.org> - 2013-07-12 12:04 -0400
  Re: Understanding other people's code Terry Reedy <tjreedy@udel.edu> - 2013-07-12 18:11 -0400
  Re: Understanding other people's code Joel Goldstick <joel.goldstick@gmail.com> - 2013-07-12 19:49 -0400
  Re: Understanding other people's code CM <cmpython@gmail.com> - 2013-07-13 23:58 -0700
  Re: Understanding other people's code Azureaus <lo0446@my.bristol.ac.uk> - 2013-07-15 03:02 -0700
    Re: Understanding other people's code CM <cmpython@gmail.com> - 2013-07-15 12:13 -0700
    Re: Understanding other people's code albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-07-27 13:13 +0000
      Re: Understanding other people's code Chris Angelico <rosuav@gmail.com> - 2013-07-27 14:41 +0100
  Re: Understanding other people's code asimjalis@gmail.com - 2013-07-15 19:10 -0700
  Re: Understanding other people's code David M Chess <chess@us.ibm.com> - 2013-07-16 14:38 -0400
  Re: Understanding other people's code David Hutto <dwightdhutto@gmail.com> - 2013-07-16 20:05 -0400
  Re: Understanding other people's code David Hutto <dwightdhutto@gmail.com> - 2013-07-19 22:57 -0400
  Re: Understanding other people's code Azureaus <lo0446@my.bristol.ac.uk> - 2013-07-25 09:26 -0700

csiph-web