Re: Python (was Re: I did not inhale)

Liste des GroupesRevenir à cl misc 
Sujet : Re: Python (was Re: I did not inhale)
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.misc
Date : 30. Aug 2024, 13:59:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vasfms$gcgq$1@dont-email.me>
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
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
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. So you are also in the 999-in-a-thousand group, just like everyone else here.
Complaining about languages (or any kind of tool) doesn't change them - it doesn't do anything except make you less happy about using them. It's fine to discuss alternative ways to handle aspects of a language that you don't like, and to see if you can make it work better for your needs and preferences.  It's fine to compare it to other languages, and see if there are alternatives that would suit you better.  And sometimes having a rant is fun - after all, complaining (especially about the weather) is the national pastime for Brits.  But mostly it is counter-productive.

 
  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?
 Python is full of ill-advised choices. And it's become almost as much of a monster as C++, with a million incompatible features bolted on.
 
So don't use it if you don't like it.  Mushy peas are an ill-advised choice - I choose not to eat them, rather than to go to cookery groups and tell everyone how horrible they are.

I'm not surprised that mere matters of syntax have low priority.
 
>
As Bjarne Stustroup said, there are two kinds of programming languages - those that people complain about, and those that no one uses.
>
 Funny, I can complain about lots of languages that I never use!
Yes, and no one takes your opinions seriously.  Do you think there might be some reason for that?

Date Sujet#  Auteur
15 Aug 24 * Re: I did not inhale256Kalevi Kolttonen
16 Aug 24 `* Re: Python (was Re: I did not inhale)255Lawrence D'Oliveiro
16 Aug 24  +* Re: Python (was Re: I did not inhale)250Kaz Kylheku
16 Aug 24  i`* Re: Python (was Re: I did not inhale)249Kalevi Kolttonen
16 Aug 24  i +* Re: Python (was Re: I did not inhale)2John Ames
17 Aug 24  i i`- Re: Python (was Re: I did not inhale)1D
17 Aug 24  i +* Re: Python (was Re: I did not inhale)64Muttley
17 Aug 24  i i+* Re: Python (was Re: I did not inhale)61Dmitry A. Kazakov
17 Aug 24  i ii+* Re: Python (was Re: I did not inhale)58Lawrence D'Oliveiro
18 Aug 24  i iii`* Re: Python (was Re: I did not inhale)57Dmitry A. Kazakov
18 Aug 24  i iii +* Re: Python (was Re: I did not inhale)14Muttley
18 Aug 24  i iii i`* Re: Python (was Re: I did not inhale)13Dmitry A. Kazakov
18 Aug 24  i iii i `* Re: Python (was Re: I did not inhale)12Muttley
18 Aug 24  i iii i  +* Re: Python (was Re: I did not inhale)10Dmitry A. Kazakov
18 Aug 24  i iii i  i+* Re: Python (was Re: I did not inhale)2Kaz Kylheku
18 Aug 24  i iii i  ii`- Re: Python (was Re: I did not inhale)1Dmitry A. Kazakov
19 Aug 24  i iii i  i+- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
19 Aug 24  i iii i  i+- Re: Python (was Re: I did not inhale)1Muttley
25 Aug 24  i iii i  i`* Re: Python (was Re: I did not inhale)5Sebastian
25 Aug 24  i iii i  i `* Re: Python (was Re: I did not inhale)4Dmitry A. Kazakov
25 Aug 24  i iii i  i  +* Re: Python (was Re: I did not inhale)2vallor
25 Aug 24  i iii i  i  i`- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
25 Aug 24  i iii i  i  `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
18 Aug 24  i iii i  `- Re: Python (was Re: I did not inhale)1Richard Kettlewell
18 Aug 24  i iii +* Re: Python (was Re: I did not inhale)2Kenny McCormack
18 Aug 24  i iii i`- Re: Python (was Re: I did not inhale)1Muttley
18 Aug 24  i iii +* Re: Python (was Re: I did not inhale)5Kaz Kylheku
18 Aug 24  i iii i`* Re: Python (was Re: I did not inhale)4Dmitry A. Kazakov
19 Aug 24  i iii i `* Re: Python (was Re: I did not inhale)3Kaz Kylheku
19 Aug 24  i iii i  `* Re: Python (was Re: I did not inhale)2Dmitry A. Kazakov
19 Aug 24  i iii i   `- Re: Python (was Re: I did not inhale)1Kaz Kylheku
19 Aug 24  i iii `* Re: Python (was Re: I did not inhale)35Lawrence D'Oliveiro
19 Aug 24  i iii  `* Re: Python (was Re: I did not inhale)34Dmitry A. Kazakov
19 Aug 24  i iii   +* Re: Python (was Re: I did not inhale)23David Brown
19 Aug 24  i iii   i+* Re: Python (was Re: I did not inhale)21Dmitry A. Kazakov
19 Aug 24  i iii   ii+* Re: Python (was Re: I did not inhale)4Muttley
19 Aug 24  i iii   iii`* Re: Python (was Re: I did not inhale)3Dmitry A. Kazakov
19 Aug 24  i iii   iii +- Re: Python (was Re: I did not inhale)1Muttley
30 Sep 24  i iii   iii `- Re: Python (was Re: I did not inhale)1Bozo User
19 Aug 24  i iii   ii+* Re: Python (was Re: I did not inhale)12David Brown
20 Aug 24  i iii   iii`* Re: Python (was Re: I did not inhale)11Dmitry A. Kazakov
20 Aug 24  i iii   iii +* Re: Python (was Re: I did not inhale)3Lawrence D'Oliveiro
20 Aug 24  i iii   iii i`* Re: Python (was Re: I did not inhale)2Dmitry A. Kazakov
21 Aug 24  i iii   iii i `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
20 Aug 24  i iii   iii `* Re: Python (was Re: I did not inhale)7David Brown
20 Aug 24  i iii   iii  `* Re: Python (was Re: I did not inhale)6Dmitry A. Kazakov
20 Aug 24  i iii   iii   +* Re: Python (was Re: I did not inhale)2David Brown
20 Aug 24  i iii   iii   i`- Re: Python (was Re: I did not inhale)1Dmitry A. Kazakov
21 Aug 24  i iii   iii   `* Re: Python (was Re: I did not inhale)3Lawrence D'Oliveiro
21 Aug 24  i iii   iii    `* Re: Python (was Re: I did not inhale)2Dmitry A. Kazakov
22 Aug 24  i iii   iii     `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
19 Aug 24  i iii   ii`* Re: Python (was Re: I did not inhale)4Keith Thompson
19 Aug 24  i iii   ii `* Re: Python (was Re: I did not inhale)3John Ames
20 Aug 24  i iii   ii  +- Re: Python (was Re: I did not inhale)1Muttley
20 Aug 24  i iii   ii  `- Re: Python (was Re: I did not inhale)1Stefan Ram
19 Aug 24  i iii   i`- Re: Python (was Re: I did not inhale)1Bart
19 Aug 24  i iii   +* Re: Python (was Re: I did not inhale)8Lawrence D'Oliveiro
19 Aug 24  i iii   i`* Re: Python (was Re: I did not inhale)7Dmitry A. Kazakov
19 Aug 24  i iii   i +* Re: Python (was Re: I did not inhale)2Keith Thompson
19 Aug 24  i iii   i i`- Re: Python (was Re: I did not inhale)1Dmitry A. Kazakov
20 Aug 24  i iii   i `* Re: Python (was Re: I did not inhale)4Lawrence D'Oliveiro
20 Aug 24  i iii   i  `* Re: Python (was Re: I did not inhale)3Dmitry A. Kazakov
20 Aug 24  i iii   i   +- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
20 Aug 24  i iii   i   `- Re: Python (was Re: I did not inhale)1D
21 Aug 24  i iii   `* Re: Python (was Re: I did not inhale)2vallor
21 Aug 24  i iii    `- Re: Python (was Re: I did not inhale)1Lawrence D'Oliveiro
18 Aug 24  i ii+- Re: Python (was Re: I did not inhale)1Muttley
18 Aug 24  i ii`- Re: Python (was Re: I did not inhale)1Eric Pozharski
18 Aug 24  i i`* Re: Python (was Re: I did not inhale)2David Brown
18 Aug 24  i i `- Re: Python (was Re: I did not inhale)1Muttley
18 Aug 24  i `* Re: Python (was Re: I did not inhale)182David Brown
18 Aug 24  i  +* C function prototype was Python (was Re: I did not inhale)2James Harris
18 Aug 24  i  i`- Re: C function prototype was Python (was Re: I did not inhale)1David Brown
18 Aug 24  i  +* Re: Python (was Re: I did not inhale)2Keith Thompson
19 Aug 24  i  i`- Re: Python (was Re: I did not inhale)1David Brown
20 Aug 24  i  `* Re: Python (was Re: I did not inhale)177Kalevi Kolttonen
20 Aug 24  i   +* Re: Python (was Re: I did not inhale)3Muttley
20 Aug 24  i   i+- Re: Python (was Re: I did not inhale)1Lew Pitcher
20 Aug 24  i   i`- Re: Python (was Re: I did not inhale)1Kalevi Kolttonen
20 Aug 24  i   +* Re: Python (was Re: I did not inhale)170David Brown
20 Aug 24  i   i`* Re: Python (was Re: I did not inhale)169Kalevi Kolttonen
21 Aug 24  i   i +* Re: Python (was Re: I did not inhale)161David Brown
21 Aug 24  i   i i+* Re: Python (was Re: I did not inhale)142Muttley
21 Aug 24  i   i ii`* Re: Python (was Re: I did not inhale)141David Brown
21 Aug 24  i   i ii `* Re: Python (was Re: I did not inhale)140Muttley
21 Aug 24  i   i ii  `* Re: Python (was Re: I did not inhale)139David Brown
21 Aug 24  i   i ii   `* Re: Python (was Re: I did not inhale)138Muttley
21 Aug 24  i   i ii    `* Re: Python (was Re: I did not inhale)137David Brown
22 Aug 24  i   i ii     `* Re: Python (was Re: I did not inhale)136Muttley
22 Aug 24  i   i ii      +* Re: Python (was Re: I did not inhale)6D
22 Aug 24  i   i ii      i+* Re: Python (was Re: I did not inhale)4Muttley
22 Aug 24  i   i ii      ii`* Re: Python (was Re: I did not inhale)3D
22 Aug 24  i   i ii      ii `* Re: Python (was Re: I did not inhale)2Lew Pitcher
22 Aug 24  i   i ii      ii  `- Re: Python (was Re: I did not inhale)1Muttley
22 Aug 24  i   i ii      i`- Re: Python (was Re: I did not inhale)1David Brown
22 Aug 24  i   i ii      `* Re: Python (was Re: I did not inhale)129David Brown
22 Aug 24  i   i ii       +* Re: Python (was Re: I did not inhale)120Muttley
26 Aug 24  i   i ii       i`* Re: Python (was Re: I did not inhale)119John Ames
26 Aug 24  i   i ii       i +- Re: Python (was Re: I did not inhale)1Muttley
26 Aug 24  i   i ii       i `* Re: Python (was Re: I did not inhale)117Lawrence D'Oliveiro
26 Aug 24  i   i ii       i  +* Re: Python (was Re: I did not inhale)113John Ames
26 Aug 24  i   i ii       i  +* Re: Python (was Re: I did not inhale)2Bart
27 Aug 24  i   i ii       i  `- Re: Python (was Re: I did not inhale)1Kaz Kylheku
22 Aug 24  i   i ii       `* Re: Python (was Re: I did not inhale)8Lawrence D'Oliveiro
21 Aug 24  i   i i`* Re: Python (was Re: I did not inhale)18Lawrence D'Oliveiro
21 Aug 24  i   i `* Re: Python (was Re: I did not inhale)7Muttley
21 Aug 24  i   `* Re: Python (was Re: I did not inhale)3Lawrence D'Oliveiro
16 Aug 24  `* Re: Python (was Re: I did not inhale)4Kalevi Kolttonen

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal