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


Groups > comp.lang.python > #72456

Choosing good names for things is difficult (was: Strange Behavior)

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; '(even': 0.05; 'cache': 0.07; 'problem:': 0.07; 'rename': 0.07; 'meaningful': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'run,': 0.09; 'attributed': 0.16; 'be:': 0.16; "computer's": 0.16; 'conclusion:': 0.16; 'exactly,': 0.16; 'finney': 0.16; 'naming': 0.16; 'naming,': 0.16; 'pithy': 0.16; 'programmers.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'words.': 0.16; 'zero.': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'bit': 0.19; 'things.': 0.19; 'header:User-Agent:1': 0.23; 'logical': 0.24; 'typical': 0.24; 'fine': 0.24; 'mon,': 0.24; 'software.': 0.24; 'least': 0.26; 'header:X-Complaints-To:1': 0.27; '(this': 0.29; 'sets': 0.30; 'especially': 0.30; 'along': 0.30; 'software,': 0.31; 'concise': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'writes:': 0.31; 'yesterday': 0.31; 'another': 0.32; 'problem': 0.35; 'subject: (': 0.35; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; '+0200,': 0.36; 'choosing': 0.36; 'combination': 0.36; 'useful': 0.36; 'should': 0.36; 'changing': 0.37; 'wrong': 0.37; 'so,': 0.37; 'two': 0.37; 'being': 0.38; 'ben': 0.38; 'tired': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'most': 0.60; 'limited.': 0.61; 'first': 0.61; 'name': 0.63; 'high': 0.63; 'url:p': 0.64; 'more': 0.64; 'different': 0.65; 'within': 0.65; 'worth': 0.66; 'approaches': 0.68; 'realized': 0.68; 'other.': 0.75; '\xe2\x80\x93': 0.77; '1990s.': 0.84; 'ambiguous': 0.84; 'phil': 0.84; 'received:125': 0.84; 'remembering': 0.84; 'subject:good': 0.84; 'tolerance': 0.84; 'difficult,': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben@benfinney.id.au>
Subject Choosing good names for things is difficult (was: Strange Behavior)
Date Tue, 03 Jun 2014 10:57:25 +1000
References <CANYcpZy3qZHRORFPTnvPcSV+uU2MHHPPcKuDXXuRvjNJBnKJKg@mail.gmail.com> <mailman.10571.1401732331.18130.python-list@python.org> <538d1532$0$29978$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host jigong.madmonks.org
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Cancel-Lock sha1:7IkyZHFYef7fnnliP/guowibjtw=
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10582.1401757062.18130.python-list@python.org> (permalink)
Lines 60
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1401757062 news.xs4all.nl 2870 [2001:888:2000:d::a6]:37673
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72456

Show key headers only | View raw


Steven D'Aprano <steve+comp.lang.python@pearwood.info> writes:

> On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote:
>
> > I invoked the wrong bug.py :/ , works fine now (this happens to me
> > when im a bit tired sometimes...).
>
> Clarity in naming is an excellent thing […] Programs should be named
> by what they do […] or when that isn't practical, at least give them a
> unique and memorable name […].

It's worth noting, along with this useful admonition, that naming things
well is one of the most difficult things to do.

It is especially difficult in computer software, while also being rather
more important than the typical problem of naming, because of the
simultaneous constraints that the names within computer software should
be:

* Memorable and evocative of the meaning to humans, who have a limited
  capacity for remembering large sets of different names exactly, but a
  high tolerance (even fondness) for multiple-meaning and ambiguous
  words.

  So, choosing unique names is difficult, and the set of memorable names
  is severely limited.

* Starkly unique and exact every time for the computer's use, without
  regard to meaning, and any name is just as memorable to a computer as
  any other.

  So, choosing unique meaningful names is crucially important in working
  with computer software.

That combination – difficult but important to do well – is a perennial
bugbear for programmers.


You can find many essays on the “naming things is difficult” theme, with
the most concise and pithy being attributed to Phil Karlton (RIP) of
Netscape in the 1990s. Another wit takes that to its logical conclusion:

    A well known aphorism attributed to Phil Karlton is:

        There are only two hard things in Computer Science: cache
        invalidation and naming things.

    I realized yesterday that this is really only one hard problem: much
    of the reason that naming things is hard is that changing names is
    hard, so you'd better name something right the first time. Why is it
    hard to rename things? Poor cache invalidation.

    <URL:http://www.jefftk.com/p/cache-invalidation>

-- 
 \              “In the long run, the utility of all non-Free software |
  `\      approaches zero. All non-Free software is a dead end.” —Mark |
_o__)                                                    Pilgrim, 2006 |
Ben Finney

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


Thread

Re: Strange Behavior robertw89@googlemail.com - 2014-06-02 20:05 +0200
  Re: Strange Behavior Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-03 00:22 +0000
    Re: Strange Behavior Chris Angelico <rosuav@gmail.com> - 2014-06-03 10:30 +1000
    Re: Strange Behavior Igor Korot <ikorot01@gmail.com> - 2014-06-02 17:49 -0700
    Choosing good names for things is difficult (was: Strange Behavior) Ben Finney <ben@benfinney.id.au> - 2014-06-03 10:57 +1000
      Re: Choosing good names for things is difficult (was: Strange Behavior) Rustom Mody <rustompmody@gmail.com> - 2014-06-02 19:06 -0700
        Re: Choosing good names for things is difficult (was: Strange Behavior) Chris Angelico <rosuav@gmail.com> - 2014-06-03 13:33 +1000
    Re: Strange Behavior Peter Otten <__peter__@web.de> - 2014-06-03 10:01 +0200
      Re: Strange Behavior Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-03 11:44 +0000

csiph-web