Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Good day for overcoming obstacles. Try a steeplechase.


comp / comp.unix.shell / Re: Python (was Re: I did not inhale)

SubjectAuthor
* Re: I did not inhaleStefan Ram
`* Re: I did not inhaleKalevi Kolttonen
 `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  +* Re: Python (was Re: I did not inhale)Kaz Kylheku
  |`* Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  | +* Re: Python (was Re: I did not inhale)John Ames
  | |`- Re: Python (was Re: I did not inhale)D
  | +* Re: Python (was Re: I did not inhale)Muttley
  | |+* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||+* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| +* Re: Python (was Re: I did not inhale)Muttley
  | ||| |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| | `* Re: Python (was Re: I did not inhale)Muttley
  | ||| |  +* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |  |+* Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| |  ||`- Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |  |+- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||| |  |+- Re: Python (was Re: I did not inhale)Muttley
  | ||| |  |`* Re: Python (was Re: I did not inhale)Sebastian
  | ||| |  | `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |  |  +* Re: Python (was Re: I did not inhale)vallor
  | ||| |  |  |`- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||| |  |  `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||| |  `- Re: Python (was Re: I did not inhale)Richard Kettlewell
  | ||| +* Re: Python (was Re: I did not inhale)Kenny McCormack
  | ||| |`- Re: Python (was Re: I did not inhale)Muttley
  | ||| +* Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| | `* Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| |  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | ||| |   `- Re: Python (was Re: I did not inhale)Kaz Kylheku
  | ||| `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   +* Re: Python (was Re: I did not inhale)David Brown
  | |||   |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | +* Re: Python (was Re: I did not inhale)Muttley
  | |||   | |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | | +- Re: Python (was Re: I did not inhale)Muttley
  | |||   | | `- Re: Python (was Re: I did not inhale)Bozo User
  | |||   | +* Re: Python (was Re: I did not inhale)David Brown
  | |||   | |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | | +* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | | |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | | | `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | | `* Re: Python (was Re: I did not inhale)David Brown
  | |||   | |  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | |   +* Re: Python (was Re: I did not inhale)David Brown
  | |||   | |   |`- Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | |   `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | |    `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | |     `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   | `* Re: Python (was Re: I did not inhale)Keith Thompson
  | |||   |  `* Re: Python (was Re: I did not inhale)John Ames
  | |||   |   +- Re: Python (was Re: I did not inhale)Muttley
  | |||   |   `- Re: Python (was Re: I did not inhale)Stefan Ram
  | |||   +* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   |`* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | +* Re: Python (was Re: I did not inhale)Keith Thompson
  | |||   | |`- Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   | `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   |  `* Re: Python (was Re: I did not inhale)Dmitry A. Kazakov
  | |||   |   +- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | |||   |   `- Re: Python (was Re: I did not inhale)D
  | |||   `* Re: Python (was Re: I did not inhale)vallor
  | |||    `- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  | ||`- Re: Python (was Re: I did not inhale)Muttley
  | |`* Re: Python (was Re: I did not inhale)David Brown
  | | `- Re: Python (was Re: I did not inhale)Muttley
  | `* Re: Python (was Re: I did not inhale)David Brown
  |  +* Re: Python (was Re: I did not inhale)Keith Thompson
  |  |`- Re: Python (was Re: I did not inhale)David Brown
  |  `* Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  |   +* Re: Python (was Re: I did not inhale)Muttley
  |   |+- Re: Python (was Re: I did not inhale)Lew Pitcher
  |   |`- Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  |   +* Re: Python (was Re: I did not inhale)David Brown
  |   |`* Re: Python (was Re: I did not inhale)Kalevi Kolttonen
  |   | +* Re: Python (was Re: I did not inhale)David Brown
  |   | |+* Re: Python (was Re: I did not inhale)Muttley
  |   | ||`* Re: Python (was Re: I did not inhale)David Brown
  |   | || `* Re: Python (was Re: I did not inhale)Muttley
  |   | ||  `* Re: Python (was Re: I did not inhale)David Brown
  |   | ||   `* Re: Python (was Re: I did not inhale)Muttley
  |   | ||    `* Re: Python (was Re: I did not inhale)David Brown
  |   | ||     `* Re: Python (was Re: I did not inhale)Muttley
  |   | ||      +* Re: Python (was Re: I did not inhale)D
  |   | ||      |+* Re: Python (was Re: I did not inhale)Muttley
  |   | ||      ||`* Re: Python (was Re: I did not inhale)D
  |   | ||      || `* Re: Python (was Re: I did not inhale)Lew Pitcher
  |   | ||      ||  `- Re: Python (was Re: I did not inhale)Muttley
  |   | ||      |`- Re: Python (was Re: I did not inhale)David Brown
  |   | ||      `* Re: Python (was Re: I did not inhale)David Brown
  |   | ||       +* Re: Python (was Re: I did not inhale)Muttley
  |   | ||       |`* Re: Python (was Re: I did not inhale)John Ames
  |   | ||       | +- Re: Python (was Re: I did not inhale)Muttley
  |   | ||       | `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | ||       |  +* Re: Python (was Re: I did not inhale)John Ames
  |   | ||       |  |+- Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | ||       |  |+- Re: Python (was Re: I did not inhale)Sebastian
  |   | ||       |  |`* Re: Python (was Re: I did not inhale)Richard Kettlewell
  |   | ||       |  +* Re: Python (was Re: I did not inhale)Bart
  |   | ||       |  `- Re: Python (was Re: I did not inhale)Kaz Kylheku
  |   | ||       `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | |`* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  |   | `* Re: Python (was Re: I did not inhale)Muttley
  |   `* Re: Python (was Re: I did not inhale)Lawrence D'Oliveiro
  `* Re: Python (was Re: I did not inhale)Kalevi Kolttonen

Pages:12345678910
Subject: Re: Python (was Re: I did not inhale)
From: Bart
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 23:21 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 00:21:43 +0100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <vaobe7$3lbp1$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <vao9h0$3l470$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 01:21:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f25609d88f29f3eda9765667c5ab1831";
logging-data="3845921"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+trNVXI5jaRYy26xMBURzD"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IKkXNJovxRD4nuxNIhawxWFwj9c=
Content-Language: en-GB
In-Reply-To: <vao9h0$3l470$1@dont-email.me>
View all headers

On 28/08/2024 23:49, Lawrence D'Oliveiro wrote:
> On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:
>
>> The main problem isn't in changing the indentation of a block of code;
>> it is in HAVING to do so because of poor language design.
>
> If you think the need for refactoring is something that can be solved by
> “language design”, I’d like to hear how.

The aim is to not NEED refactoring when you are playing around with
different, short-term bits of code.

Requiring letter-case that is exactly right plus indentation that is
exactly right, plus requiring you to choose between spaces and tabs
(plus requiring endless 'imports' to added for standard language
features), is just a nuisance.

Subject: Re: Python (was Re: I did not inhale)
From: Kaz Kylheku
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Wed, 28 Aug 2024 23:44 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 23:44:28 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <20240828163641.223@kylheku.com>
References: <uu54la$3su5b$6@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <87le0gbczf.fsf@nosuchdomain.example.com>
Injection-Date: Thu, 29 Aug 2024 01:44:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ee676becc5cc43d653dc7d1580a96201";
logging-data="3850494"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/Xc4DLQzlshMukfsICtfw/O6W3zWoYq8="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:PJzCackYkQCsZtkVs8k8Wk+Fq+Y=
View all headers

On 2024-08-28, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Bart <bc@freeuk.com> writes:
>> On 28/08/2024 19:48, David Brown wrote:
>> But some of us devise (and, importanly, implement) languages of our
>> own and can be more vocal about misfeatures in others.
>
> If I'm moving chunks of code around in a C or C++ program, from one
> scope to another, I can get away with leaving the indentation as it is,
> because all the compiler cares about is where the braces are. But I
> *always* adjust the indentation to fit the code's new context.
>
> Python's use of indentation to indicate scoping just means that I have
> to do what I would have done anyway.

In a language with brackets or braces, the indentation can adjust itself
for you.

The proof of concept for this is the "parinfer" algorithm, for Lisp
languages. Someone came up with this a bunch of years ago and now
it's fairly widely implemented.

Parinfer creates a real-time link between indentation and parentheses.

It can be configured to infer one from the other: you can manually
control indentation and have parentheses magically appear and disappear
as needed, or you can control parentheses and have the code indent
itself.

Likely, a much more complicated version of the algorithm could work
for "C likes" and others. Maybe someone has done it by now? No idea.

There are some animated demos on the original home page, and maybe
elsewhere:

https://shaunlebron.github.io/parinfer/

I use a somewhat poor but usable Vim implementation of this.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Subject: Re: Python (was Re: I did not inhale)
From: Keith Thompson
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: None to speak of
Date: Thu, 29 Aug 2024 00:23 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 17:23:25 -0700
Organization: None to speak of
Lines: 136
Message-ID: <875xrkb2iq.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
<87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me>
<87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me>
<87ttf4bdcx.fsf@nosuchdomain.example.com>
<vaoaak$3l470$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 02:23:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d17aacdbc8a710bbcdf54ea5a7e9baf3";
logging-data="3842266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RZmFtFJ5/GcwhQBBLI9ZN"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:enReKqZMoF2WJ+LPubXJbxQ0uhM=
sha1:1wC0GrgoTsPbl2hw7xiuc9BgYoY=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:
>> But ok, I found your post and removed all the #end comments. I found it
>> just as readable without them as with them.
>
> You know what? You are right. That example was just too
> well-structured.
>
> Here’s a more dangerous one:
>
> def register_additional_standard(self, **kwargs) :
> "registers additional standard interfaces that are not automatically" \
> " installed at Connection creation time. Currently the only one is" \
> " the object-manager interface, registered with\n" \
> "\n" \
> " «conn».register_additional_standard(managed_objects = True)\n"

That's not the conventional way to format a docstring. If you're using
backslashes to splice lines in Python, it's likely you're doing
something wrong.

> for key in kwargs :
> if kwargs[key] :
> if key == "managed_objects" :
> if self._managed_objects != None :

I think "is not None" is more idiomatic.

> raise asyncio.InvalidStateError \
> (
> "object manager interface already registered"
> )

You don't need the \ if you put the ( on the same line.

> #end if
> self.register \
> (
> path = "/",
> interface = ManagedObjectsHandler(),
> fallback = True
> )

Again, you've decided how you want to place parentheses and you're
forcing the syntax to cater to that. I might write that as:

self.register(
path = "/",
interface = ManagedObjectsHandler(),
fallback = True
)

> self._managed_objects = {}
> else :

You leave a space between "else" and ":". It's not wrong, but it's not
something I've ever seen. It's likely to be just a little jarring to
readers.

> raise TypeError("unrecognized argument keyword “%s”" % key)

Do you have a requirement to use older versions of Python that don't
support f-strings?

> #end if
> #end if
> #end for
> return \
> self

Why not just "return self"?

> #end register_additional_standard
>
> versus
>
> def register_additional_standard(self, **kwargs) :
> "registers additional standard interfaces that are not automatically" \
> " installed at Connection creation time. Currently the only one is" \
> " the object-manager interface, registered with\n" \
> "\n" \
> " «conn».register_additional_standard(managed_objects = True)\n"
> for key in kwargs :
> if kwargs[key] :
> if key == "managed_objects" :
> if self._managed_objects != None :
> raise asyncio.InvalidStateError \
> (
> "object manager interface already registered"
> )
> self.register \
> (
> path = "/",
> interface = ManagedObjectsHandler(),
> fallback = True
> )
> self._managed_objects = {}
> else :
> raise TypeError("unrecognized argument keyword “%s”" % key)
> return self

Again, the #end comments don't make it any more readable *for me*.
I suspect that would be even more true for more experienced Python
programmers.

> I was looking for quite a tricky example I remember seeing on the
> ArjanCodes channel on YouTube, but I can’t find it.

In any language, if a block of code is so deeply indented that it's
confusing, you should consider refactoring it. (Though that's not
always the answer.)

I once reviewed some C code with misleading indentation. Depending on
the viewer's tab settings (4 vs 8 columns) it looked either like this:

if (condition)
this;
that;

or like this:

if (condition)
this;
that;

Of course it meant the same to the compiler.

In any language, I think it's important to use consistent indentation
that reflects the structure of the code, and to avoid mixing tabs and
spaces. (My personal preference is to use spaces exclusively, but I'll
conform to what existing code does.) As I've said elsethread, Python's
rules just force me to do what I would have done anyway.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 01:16 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 01:16:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <vaoi58$3m9tm$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <vao9h0$3l470$1@dont-email.me>
<vaobe7$3lbp1$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 03:16:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a3e0b73fdd7ebf903f98fecca6ec3d09";
logging-data="3876790"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19j6K1m17y0PL8Lf6eD9p8y"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:aDnImlC2860cRjSMfI67SDA0laA=
View all headers

On Thu, 29 Aug 2024 00:21:43 +0100, Bart wrote:

> On 28/08/2024 23:49, Lawrence D'Oliveiro wrote:
>
>> On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:
>>
>>> The main problem isn't in changing the indentation of a block of code;
>>> it is in HAVING to do so because of poor language design.
>>
>> If you think the need for refactoring is something that can be solved
>> by “language design”, I’d like to hear how.
>
> The aim is to not NEED refactoring when you are playing around with
> different, short-term bits of code.

“Playing around” is exactly one of those situations where you will need to
do all kinds of things to the code, including refactoring.

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 01:19 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 01:19:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <vaoibg$3m9tm$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me> <87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me> <87ttf4bdcx.fsf@nosuchdomain.example.com>
<vaoaak$3l470$3@dont-email.me> <875xrkb2iq.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 03:19:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a3e0b73fdd7ebf903f98fecca6ec3d09";
logging-data="3876790"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lkowyx/wcgsIAl2M6ZqyD"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:qzopETPKFL4t//8KlIkeLTFoQU8=
View all headers

On Wed, 28 Aug 2024 17:23:25 -0700, Keith Thompson wrote:

> That's not the conventional way to format a docstring. If you're using
> backslashes to splice lines in Python, it's likely you're doing
> something wrong.

What exactly is wrong?

> I think "is not None" is more idiomatic.

When I want an equality comparison, I use “==”, not “is”.

> You don't need the \ if you put the ( on the same line.

But I do otherwise.

> You leave a space between "else" and ":". It's not wrong, but it's not
> something I've ever seen.

People who look at my code tend to get triggered by the little things;
maybe it’s a way to avoid thinking about the big things?

> In any language, if a block of code is so deeply indented that it's
> confusing, you should consider refactoring it. (Though that's not
> always the answer.)

The point being, the same kind of code in a language with explicit
statement brackets would reach the point of confusion later, rather than
sooner.

Subject: Re: Python (was Re: I did not inhale)
From: Keith Thompson
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: None to speak of
Date: Thu, 29 Aug 2024 02:19 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Wed, 28 Aug 2024 19:19:38 -0700
Organization: None to speak of
Lines: 65
Message-ID: <87seuo9ikl.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
<87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me>
<87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me>
<87ttf4bdcx.fsf@nosuchdomain.example.com>
<vaoaak$3l470$3@dont-email.me>
<875xrkb2iq.fsf@nosuchdomain.example.com>
<vaoibg$3m9tm$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 04:19:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d17aacdbc8a710bbcdf54ea5a7e9baf3";
logging-data="3879117"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NbzE7y9GjaOJOuL4wOT7x"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:scGoBDKGLWY1w4pcT9evxcy0Bc4=
sha1:kjlQALJ2Xai7r+E+I7yKIkRYtC0=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> On Wed, 28 Aug 2024 17:23:25 -0700, Keith Thompson wrote:
>
>> That's not the conventional way to format a docstring. If you're using
>> backslashes to splice lines in Python, it's likely you're doing
>> something wrong.
>
> What exactly is wrong?

Perhaps "wrong" overstates it, but your code certainly doesn't follow
common Python conventions.

https://peps.python.org/pep-0257/

>> I think "is not None" is more idiomatic.
>
> When I want an equality comparison, I use “==”, not “is”.
>
>> You don't need the \ if you put the ( on the same line.
>
> But I do otherwise.

So I see. I don't know why -- and I'm ok with that.

>> You leave a space between "else" and ":". It's not wrong, but it's not
>> something I've ever seen.
>
> People who look at my code tend to get triggered by the little things;
> maybe it’s a way to avoid thinking about the big things?

Why would I want to avoid thinking about the big things?

One of Henry Spencer's Ten Commandments for C Programmers seems relevant
(indirectly, of course):

Thou shalt make thy program's purpose and structure clear to thy
fellow man by using the One True Brace Style, even if thou likest it
not, for thy creativity is better used in solving problems than in
creating beautiful new impediments to understanding.

https://www.lysator.liu.se/c/ten-commandments.html

My impression is that your unconventional style indicates a relative
lack of experience in Python. Maybe that's an invalid conclusion, but
it's one that others are likely to reach as well.

And if you want to discuss Python, I suggest that comp.lang.python would
be a better place to do so. I see that you already post there. (And
you seem to have a problem with the gateway to the python-list mailing
list, for reasons you have declined to explain.) I follow that
newsgroup, and I'm going to bow out of this thread here.

>> In any language, if a block of code is so deeply indented that it's
>> confusing, you should consider refactoring it. (Though that's not
>> always the answer.)
>
> The point being, the same kind of code in a language with explicit
> statement brackets would reach the point of confusion later, rather than
> sooner.

I'm not convinced of that.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: Python (was Re: I did not inhale)
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 07:28 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 07:28:58 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <vap7vq$3sr7b$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me>
<vanrd8$3j0vv$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Injection-Date: Thu, 29 Aug 2024 09:28:58 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5fbf1cd8b4d0321f21665cc02191e17d";
logging-data="4091115"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hHwwq58YYPEkLk5NuNAvu"
Cancel-Lock: sha1:bO5HFD57TuOEQLaKxvDyjzA8zYA=
View all headers

On Wed, 28 Aug 2024 20:48:08 +0200
David Brown <david.brown@hesbynett.no> wrote:
>On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
>> Writing editor editor macros in order to work around fundamentally bad
>> language design is not something a programmer should have to waste time on.
>>
>>
>
>I don't know about Emacs, but in most editors the way you indent a block
>of code is to select the lines, then press "Tab". Unindenting is
>"shift-Tab". Changing tabs to spaces or spaces to tabs is done by
>selecting "Tabs to spaces" from the Edit menu, or something equally
>simple and obvious. Many editor can be set to convert tabs to spaces
>(or vice versa) when saving files, perhaps specific to the file type (so
>you don't muck up your makefiles).
>
>It takes a special kind of genius to be able to program, and yet still
>have trouble with this kind of thing.

Don't be a patronising prick, it doesn't help your argument. Personally I
have better things to do that figure out some obscure functionality of vim
to achieve something I shouldn't have to do in the first place if the
language was designed properly. Thankfully I don't have to use Python much.

Subject: Re: Python (was Re: I did not inhale)
From: Bart
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 10:49 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc@freeuk.com (Bart)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 11:49:35 +0100
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <vapjnv$3u1ub$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <vao9h0$3l470$1@dont-email.me>
<vaobe7$3lbp1$2@dont-email.me> <vaoi58$3m9tm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 12:49:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f25609d88f29f3eda9765667c5ab1831";
logging-data="4130763"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pzoGDWmk4fz4atv3u7leC"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:byIUSa7CFr/WxXa1TPB+ozLZUYM=
In-Reply-To: <vaoi58$3m9tm$1@dont-email.me>
Content-Language: en-GB
View all headers

On 29/08/2024 02:16, Lawrence D'Oliveiro wrote:
> On Thu, 29 Aug 2024 00:21:43 +0100, Bart wrote:
>
>> On 28/08/2024 23:49, Lawrence D'Oliveiro wrote:
>>
>>> On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:
>>>
>>>> The main problem isn't in changing the indentation of a block of code;
>>>> it is in HAVING to do so because of poor language design.
>>>
>>> If you think the need for refactoring is something that can be solved
>>> by “language design”, I’d like to hear how.
>>
>> The aim is to not NEED refactoring when you are playing around with
>> different, short-term bits of code.
>
> “Playing around” is exactly one of those situations where you will need to
> do all kinds of things to the code, including refactoring.

Here:

if a == b:
s1
return
s2
s3

that return statement is added temporarily for some reason that is not
relevant to the discussion.

Real life code would have much busier statements, and the whole thing
would in the middle of lots of other stuff that can include actual
return statements.

The problem is that that line doesn't stand out, when later you have to
find it to remove it or comment it. It blends into the surrounding code.

Without the constraints imposed by the language, I could just write it as:

if a == b:
s1
RETURN
s2
s3

NOW it stands out! Of course, I could just do:

if a == b:
s1
return # TEMPORARY RETURN
s2
s3

But this is extra effort that shouldn't be necessary, like adding #end
comments. I might for example move that line to a different part of the
function, but it might use a different indent level.

Subject: Re: Python (was Re: I did not inhale)
From: Dmitry A. Kazakov
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 11:31 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 13:31:01 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <vapm5l$3uich$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <vao9h0$3l470$1@dont-email.me>
<vaobe7$3lbp1$2@dont-email.me> <vaoi58$3m9tm$1@dont-email.me>
<vapjnv$3u1ub$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 13:31:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b4e511ef47117c0bf21f8481c4c7c2e4";
logging-data="4147601"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VXX7yUI0YAt4trHpSLFabb0k8V2Pgltg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:HsA6ejbIpD5+0CfcM0XYWhfaz9U=
In-Reply-To: <vapjnv$3u1ub$2@dont-email.me>
Content-Language: en-US
View all headers

On 2024-08-29 12:49, Bart wrote:

> Without the constraints imposed by the language, I could just write it as:
>
>     if a == b:
>         s1
> RETURN
>         s2
>         s3
>
> NOW it stands out!

In Ada I use indentation for the purpose:

if A = B then -- This I will remove later
s1;
end if;
s2;
s3;

I remember FORTRAN in its glory days had D-comments. In the first column
the letter D meant a conditional, compiled in the debug mode, ignored
otherwise.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 12:01 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 14:01:05 +0200
Organization: A noiseless patient Spider
Lines: 215
Message-ID: <vapnu2$3v4l8$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me> <87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me> <87ttf4bdcx.fsf@nosuchdomain.example.com>
<vaoaak$3l470$3@dont-email.me> <875xrkb2iq.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 14:01:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="737b96d1a4f94365fbc2f60b2f2e5810";
logging-data="4166312"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/44F5rtMgZ/s1tDEhu5lvQj1d5kOIAsdA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:csapkzPMd/PHSc2jF4BKVBKxOWU=
In-Reply-To: <875xrkb2iq.fsf@nosuchdomain.example.com>
Content-Language: en-GB
View all headers

On 29/08/2024 02:23, Keith Thompson wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>> On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:
>>> But ok, I found your post and removed all the #end comments. I found it
>>> just as readable without them as with them.
>>
>> You know what? You are right. That example was just too
>> well-structured.

So why not try to write /all/ your code in a well-structured manner, so
that you don't feel the need to add these "#end" comments?

>>
>> Here’s a more dangerous one:
>>
>> def register_additional_standard(self, **kwargs) :
>> "registers additional standard interfaces that are not automatically" \
>> " installed at Connection creation time. Currently the only one is" \
>> " the object-manager interface, registered with\n" \
>> "\n" \
>> " «conn».register_additional_standard(managed_objects = True)\n"
>
> That's not the conventional way to format a docstring. If you're using
> backslashes to splice lines in Python, it's likely you're doing
> something wrong.

Agreed 100%.

>
>> for key in kwargs :
>> if kwargs[key] :
>> if key == "managed_objects" :
>> if self._managed_objects != None :
>
> I think "is not None" is more idiomatic.

I don't know if that is true or not that it is more idiomatic - I would
certainly be happy with either.

def register_additional_standard(self, managed_objects) :
"""
registers additional standard interfaces that are not automatically
installed at Connection creation time. Currently the only one is
the object-manager interface, registered with

«conn».register_additional_standard(managed_objects = True)
"""

if managed_objects :
if self._managed_objects != None :
raise asyncio.InvalidStateError("object manager
interface already registered")
self.register(
path = "/",
interface = ManagedObjectsHandler(),
fallback = True
)
self._managed_objects = {}
return self

(Usenet formatting is limited to 72 characters standard - modern
programming is not. Overly long lines are not good, but a hard limit
at, say, 80 characters is a bad idea.)

>
>> raise asyncio.InvalidStateError \
>> (
>> "object manager interface already registered"
>> )
>
> You don't need the \ if you put the ( on the same line.

Line continuation characters in Python are usually an indicator of poor
formatting, or an unhealthy obsession with line length limits.

>
>> #end if
>> self.register \
>> (
>> path = "/",
>> interface = ManagedObjectsHandler(),
>> fallback = True
>> )
>
> Again, you've decided how you want to place parentheses and you're
> forcing the syntax to cater to that. I might write that as:
>
> self.register(
> path = "/",
> interface = ManagedObjectsHandler(),
> fallback = True
> )
>
>> self._managed_objects = {}
>> else :
>
> You leave a space between "else" and ":". It's not wrong, but it's not
> something I've ever seen. It's likely to be just a little jarring to
> readers.

I personally prefer a space before the colon in Python. It is probably
less common than no space, but it is certainly not a rare habit.

>
>> raise TypeError("unrecognized argument keyword “%s”" % key)
>
> Do you have a requirement to use older versions of Python that don't
> support f-strings?
>
>> #end if
>> #end if
>> #end for
>> return \
>> self
>
> Why not just "return self"?

Indeed.

>
>> #end register_additional_standard
>>
>> versus
>>
>> def register_additional_standard(self, **kwargs) :
>> "registers additional standard interfaces that are not automatically" \
>> " installed at Connection creation time. Currently the only one is" \
>> " the object-manager interface, registered with\n" \
>> "\n" \
>> " «conn».register_additional_standard(managed_objects = True)\n"
>> for key in kwargs :
>> if kwargs[key] :
>> if key == "managed_objects" :
>> if self._managed_objects != None :
>> raise asyncio.InvalidStateError \
>> (
>> "object manager interface already registered"
>> )
>> self.register \
>> (
>> path = "/",
>> interface = ManagedObjectsHandler(),
>> fallback = True
>> )
>> self._managed_objects = {}
>> else :
>> raise TypeError("unrecognized argument keyword “%s”" % key)
>> return self
>
> Again, the #end comments don't make it any more readable *for me*.
> I suspect that would be even more true for more experienced Python
> programmers.

I don't know if I am more experienced than you in Python (I may have
been using Python for longer, but you may have worked with it more), but
I would say that the "#end" comments directly detract from readability.

>
>> I was looking for quite a tricky example I remember seeing on the
>> ArjanCodes channel on YouTube, but I can’t find it.
>
> In any language, if a block of code is so deeply indented that it's
> confusing, you should consider refactoring it. (Though that's not
> always the answer.)

Agreed.

>
> I once reviewed some C code with misleading indentation. Depending on
> the viewer's tab settings (4 vs 8 columns) it looked either like this:
>
> if (condition)
> this;
> that;
>
> or like this:
>
> if (condition)
> this;
> that;
>
> Of course it meant the same to the compiler.

As someone who works with C programming that is often high-reliability
(not necessarily safety critical, but updates after production can be
very expensive), both are unacceptable in the kind of coding standards
we use. I accept single-line "if" statements without braces if they are
simple enough, otherwise braces are required.

if (condition) return;

if (condition) {
return;
} else {
break;
}

If the "true" statement is on a separate line, braces are /always/
required for my type of code. Almost any indentation is done inside a
pair of braces - it keeps everything simple and consistent, and it's
easy to spot mistakes.

>
> In any language, I think it's important to use consistent indentation
> that reflects the structure of the code, and to avoid mixing tabs and
> spaces. (My personal preference is to use spaces exclusively, but I'll
> conform to what existing code does.) As I've said elsethread, Python's
> rules just force me to do what I would have done anyway.
>

I do the same. (Well, I use tabs more than spaces, but otherwise I do
the same.)

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 12:05 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 14:05:41 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <vapo6l$3v4l8$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me> <87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me> <87ttf4bdcx.fsf@nosuchdomain.example.com>
<vaoaak$3l470$3@dont-email.me> <875xrkb2iq.fsf@nosuchdomain.example.com>
<vaoibg$3m9tm$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 14:05:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="737b96d1a4f94365fbc2f60b2f2e5810";
logging-data="4166312"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18m2Aid/cGKY3fCEUMN/YrnmtwPcKm7z9I="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:9pvAoNhvlwti8w8Iq5M18wXSLhQ=
Content-Language: en-GB
In-Reply-To: <vaoibg$3m9tm$2@dont-email.me>
View all headers

On 29/08/2024 03:19, Lawrence D'Oliveiro wrote:
> On Wed, 28 Aug 2024 17:23:25 -0700, Keith Thompson wrote:
>
>> That's not the conventional way to format a docstring. If you're using
>> backslashes to splice lines in Python, it's likely you're doing
>> something wrong.
>
> What exactly is wrong?
>
>> I think "is not None" is more idiomatic.
>
> When I want an equality comparison, I use “==”, not “is”.
>
>> You don't need the \ if you put the ( on the same line.
>
> But I do otherwise.
>
>> You leave a space between "else" and ":". It's not wrong, but it's not
>> something I've ever seen.
>
> People who look at my code tend to get triggered by the little things;
> maybe it’s a way to avoid thinking about the big things?

"""
There are two ways of constructing a software design: One way is to make
it so simple that there are obviously no deficiencies, and the other way
is to make it so complicated that there are no obvious deficiencies. The
first method is far more difficult.
"""

You are clearly aiming for the second method here - put in so much extra
crap and silliness that readers get caught up in that instead of
noticing that most of the function is meaningless.

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 12:24 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 14:24:01 +0200
Organization: A noiseless patient Spider
Lines: 113
Message-ID: <vapp91$3v4l8$3@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 14:24:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="737b96d1a4f94365fbc2f60b2f2e5810";
logging-data="4166312"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193drDaJzsQfWCmB1nHVYBGO1BiCUcPJU4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:t5Tcka/KbY/fItv6PZI+MDMA7Hw=
Content-Language: en-GB
In-Reply-To: <vantnp$3j94i$1@dont-email.me>
View all headers

On 28/08/2024 21:27, Bart wrote:
> On 28/08/2024 19:48, David Brown wrote:
>> On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
>>> On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
>>> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>>> On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:
>>>>
>>>>> (2) You want to temporarily comment out an 'if' line so that the
>>>>> following block is unconditional. You can't do that with also
>>>>> unindenting the block.
>>>>
>>>> In Emacs, I have commands defined to adjust the indentation of the
>>>> selected region. Surely any other decent editor would offer the same.
>>>
>>> Writing editor editor macros in order to work around fundamentally bad
>>> language design is not something a programmer should have to waste
>>> time on.
>>>
>>>
>>
>> I don't know about Emacs, but in most editors the way you indent a
>> block of code is to select the lines, then press "Tab".  Unindenting
>> is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done by
>> selecting "Tabs to spaces" from the Edit menu, or something equally
>> simple and obvious.  Many editor can be set to convert tabs to spaces
>> (or vice versa) when saving files, perhaps specific to the file type
>> (so you don't muck up your makefiles).
>>
>> It takes a special kind of genius to be able to program, and yet still
>> have trouble with this kind of thing.
>
> The main problem isn't in changing the indentation of a block of code;
> it is in HAVING to do so because of poor language design.

If I am adding or removing blocks (such as surrounding existing code in
a new conditional), then I /have/ to change the indentation - in /any/
language. (I use indents in my assembly programming too.) Call it OCD
or compulsive behaviour if you like, but I cannot consider code to be
finished - even to the level of a quick compile or test - if the
indentation is not correct.

I simply cannot see the problem with Python here, because I would not
indent things in any other way in any language.

The only thing I see as annoying in Python is when you have two or three
indentations left hanging :

def foo(a, b, c) :
if a :
if b :
if c :
doThis()

That looks unfinished to me. So I will add a "return" at the end (with
a single tab indent, in this case). If it is not the end of the
function, I will sometimes use a "pass" to pull back the indent level.

> A lesser one
> is having to rely on whatever varied features that 100s of different
> editors may have to do so.

I also rely on editors being able to accept keypresses, to load and save
files, and to have features like "search".

Of course, being a sane software developer, I do most of my programming
using editors that are suitable for software development. Most
professional carpenters use hammers for their nails, rather than bashing
them in with stones - it's the same thing, really.

>
> And yet another, of more significance, if that after you've indented a
> block, it may now merge into an adjacent block that was already at that
> new indent. If you later need to revert that first block back to it's
> original position, you'd better make sure you mark that boundary.
>

So mark the boundary. Add a blank line. Put a comment line describing
the steps of the function. You are making up problems for which you
already have good solutions that you would be using in any programming
language.

> It is a language design issue pure and simple. Don't try and pin it on
> the users and make out it's due to lack of expertise with their editors.
> Of course we can all indent blocks; it's just an unnecessary palaver.
>
> Clearly your point of view is as a language /user/ where languages and
> their characteristics are an invariant that you can't do anything about,
> can't change, and need to work around.
>
> But some of us devise (and, importanly, implement) languages of our own
> and can be more vocal about misfeatures in others.
>

Having made your own language(s) gives you no more and no less right to
comment about features of other languages that you like or dislike.

Your problem here is that you are obsessed with finding things that you
want to see as misfeatures, design flaws, or problems in other languages
- and then obsess about how you can find new ways to make it more
difficult to "work around" them.

Don't you ever just accept that a language is the way it is, and it is
perfectly useable that way? Or think that perhaps other people in the
world know better than you do about how they want their language to
work? Has it never occurred to you that the people behind a given
language - such as Python - considered various alternatives and decided
that making it the way they did was the best choice overall for the
language they wanted?

As Bjarne Stustroup said, there are two kinds of programming languages -
those that people complain about, and those that no one uses.

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 12:30 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 14:30:27 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <vappl3$3v4l8$4@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vap7vq$3sr7b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 14:30:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="737b96d1a4f94365fbc2f60b2f2e5810";
logging-data="4166312"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pF+yQp6QwXvLNuLgZaeg89FrHpXiB4vA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:kVt0/a5xhhtJSFgNMTHt3VURvGA=
Content-Language: en-GB
In-Reply-To: <vap7vq$3sr7b$1@dont-email.me>
View all headers

On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
> On Wed, 28 Aug 2024 20:48:08 +0200
> David Brown <david.brown@hesbynett.no> wrote:
>> On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
>>> Writing editor editor macros in order to work around fundamentally bad
>>> language design is not something a programmer should have to waste
>>> time on.
>>>
>>>
>>
>> I don't know about Emacs, but in most editors the way you indent a
>> block of code is to select the lines, then press "Tab".  Unindenting
>> is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done by
>> selecting "Tabs to spaces" from the Edit menu, or something equally
>> simple and obvious.  Many editor can be set to convert tabs to spaces
>> (or vice versa) when saving files, perhaps specific to the file type
>> (so you don't muck up your makefiles).
>>
>> It takes a special kind of genius to be able to program, and yet still
>> have trouble with this kind of thing.
>
> Don't be a patronising prick, it doesn't help your argument. Personally I
> have better things to do that figure out some obscure functionality of vim
> to achieve something I shouldn't have to do in the first place if the
> language was designed properly. Thankfully I don't have to use Python much.
>

Then don't use vim - use an editor that suits your needs.

If you are trying to claim that you do software development, and that
the editor(s) you use regularly do not have easily available functions
for indenting and un-indenting sections of code, then you are either
lying, or you /are/ an aforementioned special kind of genius.

Presumably you are /not/ trying to claim that - you are just trolling.

Subject: Re: Python (was Re: I did not inhale)
From: Ben Bacarisse
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 12:50 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 13:50:01 +0100
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <87ikvjwl1i.fsf@bsb.me.uk>
References: <uu54la$3su5b$6@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <vannkg$3ig72$1@dont-email.me>
<vanrd8$3j0vv$1@dont-email.me> <vantnp$3j94i$1@dont-email.me>
<vao9h0$3l470$1@dont-email.me> <vaobe7$3lbp1$2@dont-email.me>
<vaoi58$3m9tm$1@dont-email.me> <vapjnv$3u1ub$2@dont-email.me>
<vapm5l$3uich$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 29 Aug 2024 14:50:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fea14ca971f37fc10e006db08518a19f";
logging-data="4170496"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nmYl0ce+5k0gTc8idwA6f4/C2X1Lah1I="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:xgW7YGgGwLKKGJhqFIsbc+kssUI=
sha1:MHMCJt8d65in5tlIg33MdaJNmHQ=
X-BSB-Auth: 1.9251eb4b9be70c3df770.20240829135001BST.87ikvjwl1i.fsf@bsb.me.uk
View all headers

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> On 2024-08-29 12:49, Bart wrote:
>
>> Without the constraints imposed by the language, I could just write it as:
>>     if a == b:
>>         s1
>> RETURN
>>         s2
>>         s3
>> NOW it stands out!
>
> In Ada I use indentation for the purpose:
>
> if A = B then -- This I will remove later
> s1;
> end if;
> s2;
> s3;
>
> I remember FORTRAN in its glory days had D-comments. In the first column
> the letter D meant a conditional, compiled in the debug mode, ignored
> otherwise.

That was a non-standard extension, so it was not really part of FORTRAN
but just some FORTRAN implementations. (The ones I have used didn't
have that, for example.)

--
Ben.

Subject: Re: Python (was Re: I did not inhale)
From: John Ames
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 15:52 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: commodorejohn@gmail.com (John Ames)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 08:52:46 -0700
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <20240829085246.00003ab5@gmail.com>
References: <uu54la$3su5b$6@dont-email.me>
<v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com>
<v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me>
<va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me>
<va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me>
<va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me>
<vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me>
<vapp91$3v4l8$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Aug 2024 17:52:50 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fe5ee229dc287aa20fb403ba14b23ff8";
logging-data="3375"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18zV/24p1KuSI4yXdfbWEPmRSkYGKO1P8c="
Cancel-Lock: sha1:lR7tCYspv/jZeCwcrxEEbsLjrkQ=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Thu, 29 Aug 2024 14:24:01 +0200
David Brown <david.brown@hesbynett.no> wrote:

> Don't you ever just accept that a language is the way it is, and it
> is perfectly useable that way? Or think that perhaps other people in
> the world know better than you do about how they want their language
> to work? Has it never occurred to you that the people behind a given
> language - such as Python - considered various alternatives and
> decided that making it the way they did was the best choice overall
> for the language they wanted?

They probably did - but did they do that *because* of the point in
question, in spite of it, or without any meaningful inclination toward
or against it? There are plenty of other aspects about Python that may
tip the balance in spite of its annoyances.

F'rinstance, the *very* comprehensive set of libraries make bashing out
quick utilities to do A Complex Thing often very simple. (That was the
reason I first used it - needed a quick-'n-easy way to programmatically
deliver data in a POST request from a Windows box in production, and it
beat the hell out of trying to wrap my head around Win32 network
programming.) But if the language "wins" on that score, that doesn't
mean its annoyances or flaws are any less real or worthy of complaint.

Like, obviously it's way too late in the game for Python to change this
now. But we can still say it's stupid for them to have done it that way
in the first place. Is that a matter of opinion? Sure, but that's never
stopped anybody from expressing themselves re: any other language. (How
many people are still bitching about C being "insecure," 50+ years down
the line?)

Subject: Re: Python (was Re: I did not inhale)
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 16:19 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 16:19:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <vaq731$1jeb$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vap7vq$3sr7b$1@dont-email.me>
<vappl3$3v4l8$4@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Injection-Date: Thu, 29 Aug 2024 18:19:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5fbf1cd8b4d0321f21665cc02191e17d";
logging-data="52683"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PWL4ifdQ+kKUcNhjQqz8z"
Cancel-Lock: sha1:LhmPihuVDPoSZ1NdV481r52ZWms=
View all headers

On Thu, 29 Aug 2024 14:30:27 +0200
David Brown <david.brown@hesbynett.no> wrote:
>Presumably you are /not/ trying to claim that - you are just trolling.

Ah ok, you're the type who thinks anyone who disagrees with you is a troll.
You're not worth the effort mate.

Subject: Re: Python (was Re: I did not inhale)
From: Janis Papanagnou
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 16:44 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 18:44:35 +0200
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <vaq8hk$1qbm$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vap7vq$3sr7b$1@dont-email.me> <vappl3$3v4l8$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Aug 2024 18:44:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="37bf894888e16e3dd8f612469928b931";
logging-data="59766"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hm+8v9jOSHlhJLBeXq6Ww"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Uwm0UejGdyvMcMOaM7sHvbOct+I=
In-Reply-To: <vappl3$3v4l8$4@dont-email.me>
X-Enigmail-Draft-Status: N1110
View all headers

On 29.08.2024 14:30, David Brown wrote:
> On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
>> [...]
>
> Then don't use vim - use an editor that suits your needs.

LOL. (You appear to be joking. - If not, continue reading...)

But what makes you think that his needs are not covered by Vim?

>
> If you are trying to claim that you do software development, and that
> the editor(s) you use regularly do not have easily available functions
> for indenting and un-indenting sections of code, then you are either
> lying, or you /are/ an aforementioned special kind of genius.

Vim is an editor that has the most simple and also very powerful
indenting for well structured data and programs I've yet seen.
(Not mentioning its equally powerful other editing facilities.)

And even badly designed languages can be indented in the same
ways that other editors (more primitive ones or Emacs) provide.
Not as efficient as with previously mentioned cleanly designed
data or languages, but as efficient as all these other editors.

Why should he use any editor that is - in the general case, for
editing all sorts of data - mostly much less efficient than Vim?
(From the handful of popular editors I don't see any candidate.)

But this is not an untypical reflex on the Internet; ignoring
factual design issues, questioning the used tools instead, and
giving folks with different experiences and preferences names.

Janis

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 19:27 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 21:27:36 +0200
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <vaqi38$33ga$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <vapp91$3v4l8$3@dont-email.me>
<20240829085246.00003ab5@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Aug 2024 21:27:37 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="167bfd288a0b55d141ad14b12d6bc1a3";
logging-data="101898"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19S7fzJhc4G8hGAo4GAk/dsOCSeFN2jWFM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:+cQVb+xP8y8maD5Q0S1xeAkDabI=
In-Reply-To: <20240829085246.00003ab5@gmail.com>
Content-Language: en-GB
View all headers

On 29/08/2024 17:52, John Ames wrote:
> On Thu, 29 Aug 2024 14:24:01 +0200
> David Brown <david.brown@hesbynett.no> wrote:
>
>> Don't you ever just accept that a language is the way it is, and it
>> is perfectly useable that way? Or think that perhaps other people in
>> the world know better than you do about how they want their language
>> to work? Has it never occurred to you that the people behind a given
>> language - such as Python - considered various alternatives and
>> decided that making it the way they did was the best choice overall
>> for the language they wanted?
>
> They probably did - but did they do that *because* of the point in
> question, in spite of it, or without any meaningful inclination toward
> or against it? There are plenty of other aspects about Python that may
> tip the balance in spite of its annoyances.
>

I don't know the early history of Python, so I can't answer that. But
there can be no doubt that the BDFL and other "founding fathers" of the
language were aware of the pros and cons of making white space
significant for block structuring in the language, and that they
actively decided to make its syntax the way it is as the best balance,
in their opinions, for the expected use of the language. However, it is
also likely that they did not predict where the language would be, and
how it would be used, decades later. Maybe if they had had a crystal
ball they would have designed things differently - maybe not.

/All/ languages, except perhaps Bart's private language that is only
used by him, have their annoyances. I have worked at least a little
with a fair number of languages, and I've never seen one that I thought
was "perfect". But different people have different things that the like
and dislike about any given language.

So if you have the choice of which language to use (many programmers do
not), you pick one that has more things you like for the task in
question in comparison to the things you don't like.

> F'rinstance, the *very* comprehensive set of libraries make bashing out
> quick utilities to do A Complex Thing often very simple. (That was the
> reason I first used it - needed a quick-'n-easy way to programmatically
> deliver data in a POST request from a Windows box in production, and it
> beat the hell out of trying to wrap my head around Win32 network
> programming.) But if the language "wins" on that score, that doesn't
> mean its annoyances or flaws are any less real or worthy of complaint.
>
> Like, obviously it's way too late in the game for Python to change this
> now. But we can still say it's stupid for them to have done it that way
> in the first place. Is that a matter of opinion? Sure, but that's never
> stopped anybody from expressing themselves re: any other language. (How
> many people are still bitching about C being "insecure," 50+ years down
> the line?)
>

You are welcome to your opinions on languages - I have plenty of my own
(and I prefer explicit block delimiters - I would even go further in
languages like C and insist on them in more situations). But it's
important to understand that these are opinions - the designers of
Python were /not/ stupid to have made the language that way. They just
had different opinions from you, and the had a much better basis for
forming those opinions than you or I.

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 19:29 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 21:29:15 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <vaqi6b$33ga$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vap7vq$3sr7b$1@dont-email.me> <vappl3$3v4l8$4@dont-email.me>
<vaq731$1jeb$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Aug 2024 21:29:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="167bfd288a0b55d141ad14b12d6bc1a3";
logging-data="101898"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sqSZm2HDHcAta/ZelidYbgX9MImMdlic="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JK0kEIrvdwlIfWR3T/lQisd41i8=
Content-Language: en-GB
In-Reply-To: <vaq731$1jeb$1@dont-email.me>
View all headers

On 29/08/2024 18:19, Muttley@dastardlyhq.com wrote:
> On Thu, 29 Aug 2024 14:30:27 +0200
> David Brown <david.brown@hesbynett.no> wrote:
>> Presumably you are /not/ trying to claim that - you are just trolling.
>
> Ah ok, you're the type who thinks anyone who disagrees with you is a troll.

No, I was talking about /you/. I don't know of anyone here with whom I
don't disagree at times, and most of the rest are not trolling.

> You're not worth the effort mate.
>

Feel free to ignore my posts.

Subject: Re: Python (was Re: I did not inhale)
From: David Brown
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 19:36 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 21:36:08 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <vaqij8$33ga$3@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vap7vq$3sr7b$1@dont-email.me> <vappl3$3v4l8$4@dont-email.me>
<vaq8hk$1qbm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 29 Aug 2024 21:36:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="167bfd288a0b55d141ad14b12d6bc1a3";
logging-data="101898"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PUf6XEiYkgtNrZurE2CV70nxrYp6Fvpk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:hOxHL22m3HsFzkE/+Cd8SLHg/Lo=
In-Reply-To: <vaq8hk$1qbm$1@dont-email.me>
Content-Language: en-GB
View all headers

On 29/08/2024 18:44, Janis Papanagnou wrote:
> On 29.08.2024 14:30, David Brown wrote:
>> On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
>>> [...]
>>
>> Then don't use vim - use an editor that suits your needs.
>
> LOL. (You appear to be joking. - If not, continue reading...)
>

I was not joking.

> But what makes you think that his needs are not covered by Vim?

You seem to have missed the point - sorry if I was not clear.

He complained that he didn't want to learn complicated macros in Vim
just to be able to indent or un-indent lines of code. The solution is
obvious - he should use an editor other than Vim.

He could, of course, learn how to use Vim. It's a perfectly good editor
with a lot of features. It's never been my cup of tea, and nor has
Emacs - but that's preference and habit, and says nothing about whether
or not it is a good editor or useful for other people.

There are more than enough decent editors to choose from, that cover the
basic needs of programmers. Some people use one editor for everything,
others use a range for different purposes - whatever suits you. But it
is pretty absurd to complain that it is difficult to indent code just
because you (i.e., Muttley) think it is hard to do in one particular editor.

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 22:57 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 22:57:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <vaqucc$5ioe$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vantnp$3j94i$1@dont-email.me> <vapp91$3v4l8$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Aug 2024 00:57:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="83a2afc57074dde6adbb50829710fb29";
logging-data="183054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19y3QfEedSD+Yjk/CxqhOiE"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:fgzi1JkE1FSMEx2IqQCMeGs5kUE=
View all headers

On Thu, 29 Aug 2024 14:24:01 +0200, David Brown wrote:

> def foo(a, b, c) :
> if a :
> if b :
> if c :
> doThis()
>
> That looks unfinished to me. So I will add a "return" at the end (with
> a single tab indent, in this case).

A redundant “return” ... kind of like my redundant “#end” comments, except
yours work in a more restricted set of places ...

> Don't you ever just accept that a language is the way it is, and it is
> perfectly useable that way?

Of course not.

> Or think that perhaps other people in the world know better than you do
> about how they want their language to work?

And vice versa.

> Has it never occurred to you that the people behind a given
> language - such as Python - considered various alternatives and decided
> that making it the way they did was the best choice overall for the
> language they wanted?

Barring a few obvious stupidities, yes of course they were, and are, smart
people.

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Thu, 29 Aug 2024 23:03 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 23:03:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <vaquop$5ioe$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va4aut$3q4g0$1@dont-email.me>
<va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me>
<va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me>
<va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me>
<va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com>
<vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me> <87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me> <87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me> <87ttf4bdcx.fsf@nosuchdomain.example.com>
<vaoaak$3l470$3@dont-email.me> <875xrkb2iq.fsf@nosuchdomain.example.com>
<vapnu2$3v4l8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Aug 2024 01:03:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="83a2afc57074dde6adbb50829710fb29";
logging-data="183054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196BJ8o5/xZ5OZyu3s7IuXU"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:G6z07QKwY3wGfxnyT6zCYPV4B48=
View all headers

On Thu, 29 Aug 2024 14:01:05 +0200, David Brown wrote:

> On 29/08/2024 02:23, Keith Thompson wrote:
>>
>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>> On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:
>>>>
>>>> But ok, I found your post and removed all the #end comments. I found
>>>> it just as readable without them as with them.
>>>
>>> You know what? You are right. That example was just too
>>> well-structured.
>
> So why not try to write /all/ your code in a well-structured manner, so
> that you don't feel the need to add these "#end" comments?

Because not all examples can be made that neat, as I demonstrated.

> def register_additional_standard(self, managed_objects) :
> """
> registers additional standard interfaces that are not
> automatically installed at Connection creation time. Currently
> the only one is the object-manager interface, registered with
>
> «conn».register_additional_standard(managed_objects = True)
> """

Note that Python’s indentation rules don’t apply to multiline string
literals -- don’t you wish they did? So you end up with all that extra
space within the literal. Do you see why I prefer to avoid that?

> Line continuation characters in Python are usually an indicator of poor
> formatting, or an unhealthy obsession with line length limits.

I like to keep within a line length limit of about 100 characters.

> I don't know if I am more experienced than you in Python (I may have
> been using Python for longer, but you may have worked with it more), but
> I would say that the "#end" comments directly detract from readability.

Think about why you bother to indent code in languages where the compiler
ignores such indentation anyway: it means you are expressing the structure
of code in two different ways, one via statement brackets, and the other
via indentation. This redundancy aids in understanding that the code does
what you think it does.

Python gets rid of this redundancy, by having the compiler take notice of
the whitespace and removing the statement bracketing symbols. So I put it
back, by adding statement bracketing symbols that the compiler ignores.

Subject: Re: Python (was Re: I did not inhale)
From: Keith Thompson
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: None to speak of
Date: Thu, 29 Aug 2024 23:57 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Thu, 29 Aug 2024 16:57:21 -0700
Organization: None to speak of
Lines: 21
Message-ID: <87zfou9926.fsf@nosuchdomain.example.com>
References: <uu54la$3su5b$6@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com>
<wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me>
<valgpu$34s18$1@dont-email.me>
<87y14hd4bk.fsf@nosuchdomain.example.com>
<valnei$35rt8$2@dont-email.me>
<87ikvlcs7i.fsf@nosuchdomain.example.com>
<vamclm$3c4ke$1@dont-email.me>
<87ttf4bdcx.fsf@nosuchdomain.example.com>
<vaoaak$3l470$3@dont-email.me>
<875xrkb2iq.fsf@nosuchdomain.example.com>
<vapnu2$3v4l8$1@dont-email.me> <vaquop$5ioe$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 30 Aug 2024 01:57:23 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="06fc674f2ef62846f0d6137618397abc";
logging-data="193463"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kix81yXdbUeWLzG7lDwyI"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:ayI/V5rVcFhMdzo2XOIezAme7sc=
sha1:yBLstukdtP22WjDl3mqpwG1Kgvs=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
[...]
> Think about why you bother to indent code in languages where the compiler
> ignores such indentation anyway: it means you are expressing the structure
> of code in two different ways, one via statement brackets, and the other
> via indentation. This redundancy aids in understanding that the code does
> what you think it does.
>
> Python gets rid of this redundancy, by having the compiler take notice of
> the whitespace and removing the statement bracketing symbols. So I put it
> back, by adding statement bracketing symbols that the compiler ignores.

You might find Bython useful.

https://github.com/mathialo/bython

(I don't, but you might.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Fri, 30 Aug 2024 02:53 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Fri, 30 Aug 2024 02:53:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <varc7h$b7bo$1@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <v9m4gd$14scu$1@dont-email.me>
<20240815182717.189@kylheku.com> <v9npls$1fjus$1@dont-email.me>
<v9t204$2dofg$1@dont-email.me> <va28pi$3dldm$1@dont-email.me>
<va2ro9$3gd7v$1@dont-email.me> <va2vt0$3h3gj$1@dont-email.me>
<va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me>
<va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me>
<va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me>
<vap7vq$3sr7b$1@dont-email.me> <vappl3$3v4l8$4@dont-email.me>
<vaq8hk$1qbm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Aug 2024 04:53:37 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c509a17e16dee277c625dc90ee6d135d";
logging-data="367992"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nEyHsfMZlt7XFG9eq8z2Y"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:dK7pHXl9Xa9gvX4iKCfH5ggpQdo=
View all headers

On Thu, 29 Aug 2024 18:44:35 +0200, Janis Papanagnou wrote:

> Vim is an editor that has the most simple and also very powerful
> indenting for well structured data and programs I've yet seen. (Not
> mentioning its equally powerful other editing facilities.)

Vim is only good for text-editing, though. It assumes a file is split into
lines. Emacs makes no such assumption, and can also edit non-text files.

Subject: Re: Python (was Re: I did not inhale)
From: Lawrence D'Oliv
Newsgroups: comp.unix.shell, comp.unix.programmer, comp.lang.misc
Organization: A noiseless patient Spider
Date: Fri, 30 Aug 2024 02:55 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Fri, 30 Aug 2024 02:55:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <varca9$b7bo$2@dont-email.me>
References: <uu54la$3su5b$6@dont-email.me> <va51ok$3tqr9$1@dont-email.me>
<va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me>
<va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me>
<20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me>
<20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk>
<vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me>
<87y14hd4bk.fsf@nosuchdomain.example.com> <valnei$35rt8$2@dont-email.me>
<87ikvlcs7i.fsf@nosuchdomain.example.com> <vamclm$3c4ke$1@dont-email.me>
<87ttf4bdcx.fsf@nosuchdomain.example.com> <vaoaak$3l470$3@dont-email.me>
<875xrkb2iq.fsf@nosuchdomain.example.com> <vapnu2$3v4l8$1@dont-email.me>
<vaquop$5ioe$2@dont-email.me> <87zfou9926.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Aug 2024 04:55:06 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c509a17e16dee277c625dc90ee6d135d";
logging-data="367992"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LMU5H94fVzPxrZxZDbyx4"
User-Agent: Pan/0.160 (Toresk; )
Cancel-Lock: sha1:RKcbwBuC5b+SbNx5I9Xd2kwHQ/Q=
View all headers

On Thu, 29 Aug 2024 16:57:21 -0700, Keith Thompson wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
> [...]
>> Think about why you bother to indent code in languages where the
>> compiler ignores such indentation anyway: it means you are expressing
>> the structure of code in two different ways, one via statement
>> brackets, and the other via indentation. This redundancy aids in
>> understanding that the code does what you think it does.
>>
>> Python gets rid of this redundancy, by having the compiler take notice
>> of the whitespace and removing the statement bracketing symbols. So I
>> put it back, by adding statement bracketing symbols that the compiler
>> ignores.

Another reason for “#end” comments is they give me something to jump to in
the editor.

I have Emacs commands defined to move quickly between lines with matching
indentation. Since I have these at the beginning and end of every compound
construct, that allows me easy navigation around my code.

Pages:12345678910

rocksolid light 0.9.8
clearnet tor