Deutsch   English   Français   Italiano  
<vasfms$gcgq$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.misc
Subject: Re: Python (was Re: I did not inhale)
Date: Fri, 30 Aug 2024 14:59:08 +0200
Organization: A noiseless patient Spider
Lines: 207
Message-ID: <vasfms$gcgq$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>
 <var1e5$6186$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Aug 2024 14:59:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3b8d9008b438dc7a1af6ab394661d0db";
	logging-data="537114"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+19nLmpRNA9/8V8mhIdakZzoA05+XS8AA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Cancel-Lock: sha1:Sb1MM33VE7OCEcyCJ5xlVjeEbsQ=
In-Reply-To: <var1e5$6186$1@dont-email.me>
Content-Language: en-GB
Bytes: 10424

On 30/08/2024 01:49, Bart wrote:
> On 29/08/2024 13:24, David Brown wrote:
>> On 28/08/2024 21:27, Bart wrote:
>>> On 28/08/2024 19:48, David Brown wrote:

<snipping for brevity>

> It's just too 'open'. The contents of foo look like they're leaking into 
> the rest of the program. As it is, someone looking at this in the future 
> wanting to a a new statement to 'if a:' might think it ends before the 
> comments since that 'anewstmt' is too far from the main body.
> 
> It needs delimiters:
> 
> 
>   def foo(a, b, c) :
>        if a :
>            if b :
>                if c :
>                    doThis()
>                end
>                bnewstmt
>             end
> 
> # comment
> # comment
>            anewstmt
>        end
>   end

It does not /need/ delimiters.

It does, sometimes, need a bit more care, especially if you have lots of 
nesting.

(And again let me repeat - I prefer languages to have explicit 
delimiters.  But that does not stop me being able to write Python code, 
or being happy with the language overall.  There are a dozen things I 
dislike about Python, of which whitespace blocking is a very minor one, 
but there are many dozens more things I do like about it for the tasks 
for which I use the language.)

> 
> Now you know that 'if a' doesn't end at that blank line, because no 
> 'end' has been seen for it.
> 
>> 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.
> 
> So you have problems too. Would you have needed 'return' if 'end's had 
> been used in the original?

I have, as I have said in several posts, added a "return" to make code 
clearer.  I probably wouldn't have added them if Python had explicit 
block delimiters - I rarely have a plain "return" at the end of C 
functions (with no return type).

But just because I sometimes add a "return" at the end of functions does 
not mean I see its use of indents for blocks as a problem.  It's just 
different.  And if an occasional "return" makes things clear, then the 
"problem" is solved simply and effortlessly, and is no longer a "problem".

> 
>> 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.
> 
> How about just fixing the ******* language? That must be better than a 
> million programmers wasting time creating their own fixes.

Ah, so it is better to invalidate all the work done by these million 
programmers so far, along with all the tools, books, courses, 
documentation, etc., than to say that people writing big functions might 
want to add an occasional comment?  Yes, I can see how that makes 
perfect sense.

> 
>> 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.
> 
> 
> I had my opinions even before I used my own stuff.
> 

Sure.  We all have opinions about all sorts of things.  Some people even 
have /informed/ opinions, that might be relevant to other people.

> One thing I despised was the begin-end business in Algol60 and Pascal, 
> which has the same nuisance as braces in C-like languages.
> 

You don't like whitespace based blocks, and you don't like explicit 
delimiters for blocks.  Maybe you just don't like structured 
programming?  (Not all programming languages are structured.)

> I didn't like writing 'end else begin' any more than '} else {'. My 
> stuff (and a few languages have picked up on it), uses just 'else', 
> which also limits the placement possibilities when you have one token 
> rather than three.
> 

Ah, it is the need to press a couple of extra keys that you despise so much?

> 
>> 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 
> 
> Yes. I'm into language design. But I'm also interested in aspects of it 
> that many disregard, such as microfeatures, or ease of deployment.
> 

That's great.  But being interested in languages, their design, and 
their features does not mean having an obsession about calling their 
features "flaws".

>> - and then obsess about how you can find new ways to make it more 
>> difficult to "work around" them.
> 
> Fortunately I don't need to work with them much. If I did, I would find 
> the means to make them tolerable.
> 

For someone who doesn't use programming languages much (other than 
perhaps your own ones), you certainly spend a lot of time complaining 
about them!

> 
>> Don't you ever just accept that a language is the way it is, and it is 
>> perfectly useable that way?
> 
> Well, I used Fortran IV for a year. But presumably lots of people 
> weren't that happy with it as we've since had Fortran 77, 90, 95, 2008, 
> 2018 and 2023.
> 
> It's not just me!
> 

For every programmer involved in changing and developing the Fortran 
language, there are a thousand programmers who use it - whichever 
version of it they find best for their job.  Now, it is important that 
these one-in-a-thousand programmers are there, improving the language. 
But most of us are in the 999-in-a-thousand group that /use/ the 
language.  (In that one-in-a-thousand I am including the people who 
actively take part in discussions or proposals for changing the 
language, but not people who just moan about stuff in discussion groups.)

Clearly you can take your own complaints seriously for your own 
languages, and they are very important to you personally.  But in the 
grand scheme of things, they are utterly irrelevant to everyone else. 
========== REMAINDER OF ARTICLE TRUNCATED ==========