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


Groups > comp.lang.python > #43593

Re: classes and sub classes?

Date 2013-04-15 03:07 +0100
From MRAB <python@mrabarnett.plus.com>
Subject Re: classes and sub classes?
References <mailman.313.1365486619.3114.python-list@python.org> <5163be52$0$29977$c3e8da3$5496439d@news.astraweb.com> <CACQBTrRVs1G_LP7d0+e=gxB18-zDGKPr7kXy=_A-2RB8YHEhfw@mail.gmail.com> <CANy1k1imR+yynBjWhGx5OU6FE2jC9hcB+yHuMF6r2GEwY3m39g@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.614.1365991635.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 15/04/2013 02:38, Jason Friedman wrote:
>  > NwInvDb = NetworkInventoryDatabase, yes you are correct, it creates
> the database handle and makes it ready for use.
>
> I am interested in opinions.  I for one dislike abbreviations on the
> theory that programs are read more than they are written.  I would
> probably use this variable name:
>
> network_inventory_db_connection = ...
>
> And yes, I'm aware that "db" is an abbreviation.  I believe I am
> following a few Zen principles:
>
> Beautiful is better than ugly.
> Explicit is better than implicit.
> Readability counts.
> Special cases aren't special enough to break the rules, Although practicality beats purity.
>
> What would others use?
>
"network" could be abbreviated to "net", "inventory" to "inv" (maybe OK
in this context; in another context it could an abbreviation for
"inverse"), and "connection" to "con" (maybe), giving "net_inv_db_con",
or "net_inv_db_connection".

The trick, of course, is to make it clear, but not annoyingly long.
Python itself has "def", "len", and "lstrip", not "define", "length"
and "left_strip".

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


Thread

classes and sub classes? Morten Guldager <morten.guldager@gmail.com> - 2013-04-09 07:50 +0200
  Re: classes and sub classes? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-09 07:08 +0000
    Re: classes and sub classes? Morten Guldager <morten.guldager@gmail.com> - 2013-04-09 09:38 +0200
    Re: classes and sub classes? Jason Friedman <jsf80238@gmail.com> - 2013-04-14 19:38 -0600
    Re: classes and sub classes? MRAB <python@mrabarnett.plus.com> - 2013-04-15 03:07 +0100
    Re: classes and sub classes? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-04-14 22:35 -0400
    Re: classes and sub classes? Peter Otten <__peter__@web.de> - 2013-04-15 09:21 +0200
      Re: classes and sub classes? Neil Cerutti <neilc@norwich.edu> - 2013-04-15 12:22 +0000

csiph-web