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


Groups > comp.lang.python > #88189

Re: Proposal for new minor syntax

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Proposal for new minor syntax
Date 2015-03-28 10:39 +1100
References <CAPauRLMMAT-OffHTYW6GPybAZzouc7H9BjrmvVQiSig0X3x+ig@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.282.1427499534.10327.python-list@python.org> (permalink)

Show all headers | View raw


Jamie Willis <jw14896.2014@my.bristol.ac.uk> writes:

> This could be written as:
>
> hello = "hello world              "
> hello .= strip()

−1, “.=” is visually too similar to “=”.

Syntax that is ambiguous at a glance is a cost when reading, and here I
think the cost is great.

> In this slightly contrived example, the programmer saved (a small amount
> of) time when writing the code.

Code is read much more often than it is written; we should optimise for
reading effort, not writing effort.

-- 
 \      “The history of Western science confirms the aphorism that the |
  `\     great menace to progress is not ignorance but the illusion of |
_o__)            knowledge.” —Daniel J. Boorstin, historian, 1914–2004 |
Ben Finney

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


Thread

Re: Proposal for new minor syntax Ben Finney <ben+python@benfinney.id.au> - 2015-03-28 10:39 +1100
  Re: Proposal for new minor syntax Mario Figueiredo <marfig@gmail.com> - 2015-03-28 01:33 +0100
    Re: Proposal for new minor syntax Ian Kelly <ian.g.kelly@gmail.com> - 2015-03-27 18:55 -0600
      Re: Proposal for new minor syntax Rustom Mody <rustompmody@gmail.com> - 2015-03-27 21:18 -0700
        VB/Pascal with statement [was Re: Proposal for new minor syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-28 17:26 +1100
          Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Chris Angelico <rosuav@gmail.com> - 2015-03-28 17:40 +1100
          Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-28 12:26 +0000
            Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-28 23:58 +1100
              Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-28 13:44 +0000
          Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Rustom Mody <rustompmody@gmail.com> - 2015-03-28 09:21 -0700
            Re: VB/Pascal with statement [was Re: Proposal for new minor syntax] Rustom Mody <rustompmody@gmail.com> - 2015-03-28 09:32 -0700
        Re: Proposal for new minor syntax Giorgos Tzampanakis <giorgos.tzampanakis@gmail.com> - 2015-04-08 22:11 +0000

csiph-web