|
I use two SPACEs per TAB. The simple IDE I wrote can do it, even were I ever to use it for Python.
On the other hand, a TAB-stop should be a certain width (e.g. a half inch), regardless of font and display medium, not measured in "character positions". If we could have that, then maybe TABs would make sense.
|
|
|
|
|
Why don't Python editors indicate tabs/spaces with some sort of symbol? Perhaps '{' for tab and ' ' for space. To be even more helpful, the editor could indicate the end of a block with '}' ?
|
|
|
|
|
|
I refer to it as "invisible source code" because that's what significant whitespace is.
And it's just as stupid as it sounds. How do you debug that which you cannot see?
It's risible.
To err is human. Fortune favors the monsters.
|
|
|
|
|
With 8 Bit micros it made sense, when I jumped to 16 Bit (Amiga 500, Amiga Basic, AMOS, C & 68K assembly!) no spaces. Why with a new language?
|
|
|
|
|
Considering it was named after the people who gave us the Ministry of Silly Walks, Dead Parrots, and the Argument Sketch, what else would you expect?
honey the codewitch wrote: It's risible. Had to look that word up, which caused me to be risible.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
You are not the only one ... I must admit I looked it up, too , feel safer now
|
|
|
|
|
OK, "risible" ... thanks, never heard of it
|
|
|
|
|
You don't remember "Life of Brian" with the centurion who can't stop laughing at the name "Biggus Dickus".
"Do you find it wisible?"
|
|
|
|
|
Oh no ... 😊 this is not my cup of tea, I’ve seen one or 2 fragments on YT a few years ago, and I found it ridiculous, beyond strange, not really interesting ... Thus risible fits here also I guess, but why “wisible”? 😊 My intuition says that this is the pronunciation from the movie - is this guess correct?
modified 6-Apr-23 13:10pm.
|
|
|
|
|
Correct, the Emperor has a speech defect, which the centurion finds greatly amusing.
|
|
|
|
|
honey the codewitch wrote: How do you debug that which you cannot see? Casting a spell to make it visible? Using talcum powder? Asking a blind colleague to do it for you?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
glennPattonWork3 wrote: ...but syntactic white space 'align your tabs' It's like COBOL or RPG.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
We battled those demons and sent them packing! OK a lot of stuff was written in COBOL because there was assembly and COBOL, COBOL gave you an error message, assembly didn't.
|
|
|
|
|
:shudder:
Not to diss on COBOL, but after thirty+ years I still remember having to help a fellow college student debug a COBOL program which wasn't working.
She had used TABs to pad a string to the desired length -- it looked OK on a VT100, but the compiler knew better.
|
|
|
|
|
That's my main problem with Python as well. Tabs? Spaces? Who knows?
Source code should not be invisible. I will make a grudging exception for line based grammars like Visual BASIC. At least that's manageable.
To err is human. Fortune favors the monsters.
|
|
|
|
|
David Crow wrote: glennPattonWork3 wrote:...but syntactic white space 'align your tabs'It's like COBOL or RPG.
With 1 very important difference. With only assembler to build from and the extremely limited capabilities of computers when those languages were designed, rigid assignment of columns of code for specific purposes wasn't an unreasonable choice to make things easier for the compiler and compiler authors and was a major step forward from the prior state of the art.
The chuckle s guilty of designing python have no such excuse.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
|
|
|
|
|
Dan Neely wrote: The chuckle[mastadon] s guilty of designing python have no such excuse. I was there when C pushed out Pascal (and Algol and Simula and ...). Lots of programmers argued in favor of C because they hated all the typing of BEGIN and END (and in some languages CASE - ESAC, DO - OD and PROCEDURE - ERUDECORP). I met lots of programmers who insisted that replacing keywords with braces speeded up their programming.
Besides, they argued: All those keywords clutter up the program code. C, using braces for delimiters, is much cleaner, they insisted.
Python is just taking this one step further. Why should you have to type a delimiter, if you indent the code? Why clutter up you code with braces? Besides: Using both delimiters and indentation opens for inconsistencies: You could be using a brace without indenting, and the reader might overlook it, or indenting without a brace, leading the reader to think that the indented code makes up a block. If you use indentation only, you avoid such problems.
That is how the arguments go. Most modern programmers never wrote a compiler, not even a parser, an in any case, using indents for identifying blocks is not, and has never been, a resource saver. So that argument is never heard.
I hope that I do not appear as if I am supporting these arguments! I am certainly not. I am much in favor of making structures very explicit. I want the compiler to check that redundant elements (like indent and textual markers) correspond, and to check that the label on the block close matches than of the block opening. I am definitely not a Python lover.
|
|
|
|
|
It seems to be logical that adding these { } to Python with the same semantics as in C would save Python from a lot of criticism ... Like in Cython, where static typing has been added. AFAIK there is also syntax in Python to indicate variable types, but there is nothing done yet with this weird block structure ... . Is this feasible (?), perhaps not ... I am dreaming about Python 4.x with { } it's TIOBE rating would probably skyrocket ...
modified 5-Apr-23 14:52pm.
|
|
|
|
|
As trønderen stated above, with braces whitespace becomes more or less immaterial and so it is, for the most part, with Java, C#, C, C++, etc. And that leads to not having to indent when structuring your code.
I was always led to believe that one of the reasons Python made whitespace significant was to enforce "proper" code structure and now all those ugly 2-finger-typed brace characters can be eliminated. In a sense, they actually are there, they're just invisible - and therein lies the rub (at least to braceophiles like me).
|
|
|
|
|
Yes, I agree ... I even do not notice anymore how I type them . I got so much used to them that code without them seems odd (and my brain is warning me - this won't work, so I get in persistent confusion when looking at standard Python code). Also, the missing ; in some languages' code bugs me a lot ... It seems that in Go it is implicit, for some strange reason ... (there is always a good reason for something like this of course )
|
|
|
|
|
|
|
Oh I hope so...
|
|
|
|
|
There just something about **Value, my brain says 'Pointer to a pointer, what witchcraft is this!!!'
|
|
|
|