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

Liste des GroupesRevenir à cl misc 
Sujet : Re: Python (was Re: I did not inhale)
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.misc
Date : 30. Aug 2024, 00:49:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <var1e5$6186$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
User-Agent : Mozilla Thunderbird
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:
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()
Let's assume you know this ends here (as there is no concrete bit of syntax that will confirm it).
You need to add another statement to that 'if b' block. Even with just two intervening lines, you need to take some care. With more, you either have to work your way down from 'if b' then move right one tab, or start from the first statement ('if c') and work down from that. At the same keep an eye out for cues as to the end of the 'if b' block.
It should look like this afterwards:
  def foo(a, b, c) :
       if a :
           if b :
               if c :
                   doThis()
               bnewstmt
That new statement looks rather lonely and exposed though! Do the same with 'if a', and it becomes:
  def foo(a, b, c) :
       if a :
           if b :
               if c :
                   doThis()
               bnewstmt
# comment
# comment
           anewstmt

That looks unfinished to me.
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
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?

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.

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

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.

- 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.

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!

  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.
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!

Date Sujet#  Auteur
29 Mar 24 * Command Languages Versus Programming Languages750Lawrence D'Oliveiro
29 Mar 24 +- Re: Command Languages Versus Programming Languages1candycanearter07
29 Mar 24 +* Re: Command Languages Versus Programming Languages170Muttley
29 Mar 24 i+- Re: Command Languages Versus Programming Languages1Josef Möllers
29 Mar 24 i+* Re: Command Languages Versus Programming Languages9Richard Kettlewell
29 Mar 24 ii`* Re: Command Languages Versus Programming Languages8Muttley
29 Mar 24 ii `* Re: Command Languages Versus Programming Languages7Kaz Kylheku
29 Mar 24 ii  `* Re: Command Languages Versus Programming Languages6Muttley
29 Mar 24 ii   `* Re: Command Languages Versus Programming Languages5Kaz Kylheku
30 Mar 24 ii    `* Re: Command Languages Versus Programming Languages4Muttley
30 Mar 24 ii     +- Re: Command Languages Versus Programming Languages1Janis Papanagnou
30 Mar 24 ii     `* Re: Command Languages Versus Programming Languages2Kaz Kylheku
1 Apr 24 ii      `- Re: Command Languages Versus Programming Languages1Muttley
29 Mar 24 i`* Re: Command Languages Versus Programming Languages159John Ames
29 Mar 24 i +* Re: Command Languages Versus Programming Languages157Muttley
29 Mar 24 i i+- Re: Command Languages Versus Programming Languages1John Ames
29 Mar 24 i i+* Re: Command Languages Versus Programming Languages151Kaz Kylheku
29 Mar 24 i ii`* Re: Command Languages Versus Programming Languages150Muttley
29 Mar 24 i ii +* Re: Command Languages Versus Programming Languages148Kaz Kylheku
29 Mar 24 i ii i+* Re: Command Languages Versus Programming Languages4David W. Hodgins
29 Mar 24 i ii ii+* Re: Command Languages Versus Programming Languages2Johanne Fairchild
30 Mar 24 i ii iii`- Re: Command Languages Versus Programming Languages1David W. Hodgins
30 Mar 24 i ii ii`- Re: Command Languages Versus Programming Languages1Janis Papanagnou
30 Mar 24 i ii i`* Re: Command Languages Versus Programming Languages143Muttley
30 Mar 24 i ii i `* Re: Command Languages Versus Programming Languages142Kaz Kylheku
1 Apr 24 i ii i  `* Re: Command Languages Versus Programming Languages141Muttley
1 Apr 24 i ii i   +* Re: Command Languages Versus Programming Languages139Johanne Fairchild
1 Apr 24 i ii i   i`* Re: Command Languages Versus Programming Languages138Muttley
1 Apr 24 i ii i   i +- Re: Command Languages Versus Programming Languages1Kaz Kylheku
2 Apr 24 i ii i   i `* Re: Command Languages Versus Programming Languages136Johanne Fairchild
2 Apr 24 i ii i   i  +* Re: Command Languages Versus Programming Languages115ram@zedat.fu-berlin.de (Stefan Ram)
2 Apr 24 i ii i   i  i+* Re: Command Languages Versus Programming Languages112Stefan Ram
2 Apr 24 i ii i   i  ii+* Re: Command Languages Versus Programming Languages110Stefan Ram
3 Apr 24 i ii i   i  iii`* Re: Command Languages Versus Programming Languages109Lawrence D'Oliveiro
3 Apr 24 i ii i   i  iii `* Re: Command Languages Versus Programming Languages108David Brown
3 Apr 24 i ii i   i  iii  +- Re: Command Languages Versus Programming Languages1Lawrence D'Oliveiro
3 Apr 24 i ii i   i  iii  +- Re: Command Languages Versus Programming Languages1John Ames
3 Apr 24 i ii i   i  iii  `* Re: Command Languages Versus Programming Languages105Keith Thompson
3 Apr 24 i ii i   i  iii   +* Re: Command Languages Versus Programming Languages100Richard Kettlewell
4 Apr 24 i ii i   i  iii   i+- Re: Command Languages Versus Programming Languages1Muttley
4 Apr 24 i ii i   i  iii   i`* Re: Command Languages Versus Programming Languages98Stefan Ram
5 Apr 24 i ii i   i  iii   i `* Re: Command Languages Versus Programming Languages97Lawrence D'Oliveiro
5 Apr 24 i ii i   i  iii   i  +* Re: Command Languages Versus Programming Languages49Muttley
5 Apr 24 i ii i   i  iii   i  i+* Re: Command Languages Versus Programming Languages3candycanearter07
5 Apr 24 i ii i   i  iii   i  ii`* Re: Command Languages Versus Programming Languages2Muttley
6 Apr 24 i ii i   i  iii   i  ii `- Re: Command Languages Versus Programming Languages1candycanearter07
6 Apr 24 i ii i   i  iii   i  i`* Re: Command Languages Versus Programming Languages45Lawrence D'Oliveiro
6 Apr 24 i ii i   i  iii   i  i `* Re: Command Languages Versus Programming Languages44Alan Bawden
6 Apr 24 i ii i   i  iii   i  i  +* Re: Command Languages Versus Programming Languages13Lawrence D'Oliveiro
8 Apr 24 i ii i   i  iii   i  i  i`* Re: Command Languages Versus Programming Languages12John Ames
9 Apr 24 i ii i   i  iii   i  i  i `* Re: Command Languages Versus Programming Languages11Lawrence D'Oliveiro
9 Apr 24 i ii i   i  iii   i  i  i  +* Re: Command Languages Versus Programming Languages9John Ames
9 Apr 24 i ii i   i  iii   i  i  i  i`* Re: Command Languages Versus Programming Languages8Richard Kettlewell
9 Apr 24 i ii i   i  iii   i  i  i  i +* Re: Command Languages Versus Programming Languages2Janis Papanagnou
9 Apr 24 i ii i   i  iii   i  i  i  i i`- Re: Command Languages Versus Programming Languages1Richard Kettlewell
9 Apr 24 i ii i   i  iii   i  i  i  i `* Re: Command Languages Versus Programming Languages5David Brown
9 Apr 24 i ii i   i  iii   i  i  i  i  `* Re: Command Languages Versus Programming Languages4Lawrence D'Oliveiro
9 Apr 24 i ii i   i  iii   i  i  i  i   `* Re: Command Languages Versus Programming Languages3David Brown
10 Apr 24 i ii i   i  iii   i  i  i  i    `* Re: Command Languages Versus Programming Languages2Lawrence D'Oliveiro
10 Apr 24 i ii i   i  iii   i  i  i  i     `- Re: Command Languages Versus Programming Languages1Kaz Kylheku
9 Apr 24 i ii i   i  iii   i  i  i  `- Re: Command Languages Versus Programming Languages1Kaz Kylheku
6 Apr 24 i ii i   i  iii   i  i  +* Re: Command Languages Versus Programming Languages3Kaz Kylheku
6 Apr 24 i ii i   i  iii   i  i  i`* Re: Command Languages Versus Programming Languages2David Brown
6 Apr 24 i ii i   i  iii   i  i  i `- Re: Command Languages Versus Programming Languages1Muttley
6 Apr 24 i ii i   i  iii   i  i  +- Re: Command Languages Versus Programming Languages1candycanearter07
6 Apr 24 i ii i   i  iii   i  i  `* Re: Command Languages Versus Programming Languages26Muttley
7 Apr 24 i ii i   i  iii   i  i   +* Re: Command Languages Versus Programming Languages22Alan Bawden
8 Apr 24 i ii i   i  iii   i  i   i`* Re: Command Languages Versus Programming Languages21Muttley
8 Apr 24 i ii i   i  iii   i  i   i `* Re: Command Languages Versus Programming Languages20David Brown
8 Apr 24 i ii i   i  iii   i  i   i  `* Re: Command Languages Versus Programming Languages19Muttley
8 Apr 24 i ii i   i  iii   i  i   i   +* Words to the wise (Was: Command Languages Versus Programming Languages)2Kenny McCormack
8 Apr 24 i ii i   i  iii   i  i   i   i`- Re: Words to the wise (Was: Command Languages Versus Programming Languages)1Muttley
8 Apr 24 i ii i   i  iii   i  i   i   `* Re: Command Languages Versus Programming Languages16Kaz Kylheku
8 Apr 24 i ii i   i  iii   i  i   i    +* Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)9Kenny McCormack
9 Apr 24 i ii i   i  iii   i  i   i    i`* Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)8Janis Papanagnou
9 Apr 24 i ii i   i  iii   i  i   i    i +- Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)1D
9 Apr 24 i ii i   i  iii   i  i   i    i `* Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)6candycanearter07
9 Apr 24 i ii i   i  iii   i  i   i    i  `* Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)5Janis Papanagnou
9 Apr 24 i ii i   i  iii   i  i   i    i   +- Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)1candycanearter07
10 Apr 24 i ii i   i  iii   i  i   i    i   `* Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)3Lawrence D'Oliveiro
10 Apr 24 i ii i   i  iii   i  i   i    i    +- Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)1Chris Elvidge
10 Apr 24 i ii i   i  iii   i  i   i    i    `- Re: Phrases that should be banned on Usenet (Was: Command Languages Versus Programming Languages)1candycanearter07
9 Apr 24 i ii i   i  iii   i  i   i    `* Re: Command Languages Versus Programming Languages6Muttley
9 Apr 24 i ii i   i  iii   i  i   i     +- Re: Command Languages Versus Programming Languages1Kaz Kylheku
9 Apr 24 i ii i   i  iii   i  i   i     +- Re: Command Languages Versus Programming Languages1Janis Papanagnou
9 Apr 24 i ii i   i  iii   i  i   i     `* Re: Command Languages Versus Programming Languages3Muttley
9 Apr 24 i ii i   i  iii   i  i   i      `* Re: Command Languages Versus Programming Languages2John Ames
9 Apr 24 i ii i   i  iii   i  i   i       `- Re: Command Languages Versus Programming Languages1Muttley
8 Apr 24 i ii i   i  iii   i  i   +- [meta] Re: Command Languages Versus Programming Languages1Janis Papanagnou
10 Apr 24 i ii i   i  iii   i  i   `* Re: Command Languages Versus Programming Languages2Keith Thompson
10 Apr 24 i ii i   i  iii   i  i    `- Re: Command Languages Versus Programming Languages1Kenny McCormack
5 Apr 24 i ii i   i  iii   i  `* Re: Command Languages Versus Programming Languages47Janis Papanagnou
5 Apr 24 i ii i   i  iii   i   +* Re: Command Languages Versus Programming Languages27Stefan Ram
6 Apr 24 i ii i   i  iii   i   i+* Re: Command Languages Versus Programming Languages4Muttley
7 Apr 24 i ii i   i  iii   i   ii`* Re: Command Languages Versus Programming Languages3Lawrence D'Oliveiro
8 Apr 24 i ii i   i  iii   i   ii `* Re: Command Languages Versus Programming Languages2Muttley
9 Apr 24 i ii i   i  iii   i   ii  `- Re: Command Languages Versus Programming Languages1Lawrence D'Oliveiro
6 Apr 24 i ii i   i  iii   i   i+- Re: Command Languages Versus Programming Languages1Janis Papanagnou
6 Aug 24 i ii i   i  iii   i   i`* Re: Command Languages Versus Programming Languages21Sebastian
7 Aug 24 i ii i   i  iii   i   i `* Re: Command Languages Versus Programming Languages20Lawrence D'Oliveiro
7 Aug 24 i ii i   i  iii   i   i  +* Re: Command Languages Versus Programming Languages3Kaz Kylheku
8 Aug 24 i ii i   i  iii   i   i  +* Re: Command Languages Versus Programming Languages4Andreas Eder
25 Aug 24 i ii i   i  iii   i   i  `* Re: Command Languages Versus Programming Languages12Sebastian
5 Apr 24 i ii i   i  iii   i   +- Re: Command Languages Versus Programming Languages1Kaz Kylheku
6 Apr 24 i ii i   i  iii   i   `* Re: Command Languages Versus Programming Languages18Lawrence D'Oliveiro
3 Apr 24 i ii i   i  iii   `* Re: Command Languages Versus Programming Languages4David Brown
2 Apr 24 i ii i   i  ii`- Re: Command Languages Versus Programming Languages1Kaz Kylheku
2 Apr 24 i ii i   i  i`* Re: Command Languages Versus Programming Languages2Kaz Kylheku
2 Apr 24 i ii i   i  `* Re: Command Languages Versus Programming Languages20Lawrence D'Oliveiro
1 Apr 24 i ii i   `- Re: Command Languages Versus Programming Languages1Lawrence D'Oliveiro
1 Apr 24 i ii `- Re: Command Languages Versus Programming Languages1Andreas Eder
29 Mar 24 i i+- Re: Command Languages Versus Programming Languages1Christian Weisgerber
30 Mar 24 i i+* Re: Command Languages Versus Programming Languages2David Brown
30 Sep 24 i i`- Re: Command Languages Versus Programming Languages1Bozo User
29 Mar 24 i `- Re: Command Languages Versus Programming Languages1Kaz Kylheku
29 Mar 24 +* Re: Command Languages Versus Programming Languages554Johanne Fairchild
29 Mar 24 +* Re: Command Languages Versus Programming Languages2David Brown
29 Mar 24 +* Re: Command Languages Versus Programming Languages15Lawrence D'Oliveiro
30 Mar 24 +* Re: Command Languages Versus Programming Languages3Dmitry A. Kazakov
30 Sep 24 `* Re: Command Languages Versus Programming Languages4Bozo User

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal