Python problems...
-
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?
-
Hi All, Being strongly encouraged (read forced) to use Python for a test rig. Okay need to get down with Kids etc. but syntactic white space 'align your tabs' (who came up with that, is it 1988, am I using a BBC micro) oh gord!!!:mad:
glennPattonWork3 wrote:
...but syntactic white space 'align your tabs'
It's like COBOL or RPG. X|
"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
-
glennPattonWork3 wrote:
...but syntactic white space 'align your tabs'
It's like COBOL or RPG. X|
"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.
-
Hi All, Being strongly encouraged (read forced) to use Python for a test rig. Okay need to get down with Kids etc. but syntactic white space 'align your tabs' (who came up with that, is it 1988, am I using a BBC micro) oh gord!!!:mad:
-
glennPattonWork3 wrote:
...but syntactic white space 'align your tabs'
It's like COBOL or RPG. X|
"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
: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.
-
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.
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.
-
Hi All, Being strongly encouraged (read forced) to use Python for a test rig. Okay need to get down with Kids etc. but syntactic white space 'align your tabs' (who came up with that, is it 1988, am I using a BBC micro) oh gord!!!:mad:
Ya get used to it ;) (The thing that will do your head in is the error when you keep trying to do
!var
) Oh, and good luck with PIP. You've got this! :thumbsup::thumbsup:cheers Chris Maunder
-
Ya get used to it ;) (The thing that will do your head in is the error when you keep trying to do
!var
) Oh, and good luck with PIP. You've got this! :thumbsup::thumbsup:cheers Chris Maunder
Oh :bob: I hope so...
-
Ya get used to it ;) (The thing that will do your head in is the error when you keep trying to do
!var
) Oh, and good luck with PIP. You've got this! :thumbsup::thumbsup:cheers Chris Maunder
There just something about **Value, my brain says 'Pointer to a pointer, what witchcraft is this!!!'
-
OriginalGriff wrote:
Just don't use Python is my advice!
Friends don't let friends use Python. I attempted to learn it a few moons back and found the tab-space thing to much of a deterrent.
PartsBin an Electronics Part Organizer - An updated version available! JaxCoder.com Latest Article: Simon Says, A Child's Game
Friends don't let friends use TABs.
-
Ya get used to it ;) (The thing that will do your head in is the error when you keep trying to do
!var
) Oh, and good luck with PIP. You've got this! :thumbsup::thumbsup:cheers Chris Maunder
-
It is scripted so it's slower than .NET code. And the UI? :~
There's Codon for that: [^]Python-based compiler achieves orders-of-magnitude speedups | MIT News | Massachusetts Institute of Technology[^]
>64 Some days the dragon wins. Suck it up.
-
Friends don't let friends use TABs.
PartsBin an Electronics Part Organizer - An updated version available! JaxCoder.com Latest Article: Simon Says, A Child's Game
-
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.
-
glennPattonWork3 wrote:
...but syntactic white space 'align your tabs'
It's like COBOL or RPG. X|
"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
David Crow wrote:
glennPattonWork3 wrote:...but syntactic white space 'align your tabs'It's like COBOL or RPG. X|
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:elephant: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
-
Most editors can, but they tend to default to "use tabs" to save file space. And some only do it for modified lines, and ... it's a mess. Just don't use Python is my advice! :laugh:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
OriginalGriff wrote:
Most editors can, but they tend to default to "use tabs" to save file space.
To save file space??? You (or rather, those you refer to) can't be serious. In year 2023, you do not seriously use a tab character to save three (3) bytes of space! My home PC has two 16 TB disks, one 8 TB and one 1 TB M.2 main disk - that is almost 14 trillion (English - that is 'billion' in many other countries) times the space a tab character will save. My home PC certainly has got more disk space than most home PCs. Not only have I been using digital video cameras since they came to the market - I imported one from abroad before they were introduced in Norway - but I also have had all my old video, Super-8 and old 8mm digitized. Yet, disk capacities are generally stated in terabytes nowadays. If you need to save 3 bytes of space here, 3 bytes there, then I guess you also need to rule out file systems that allocate disk blocks of 4 Ki size; 512 bytes would be the maximum acceptable. Maybe you should go down to the old floppy disk standard of 128 byte sectors ... Even 512 bytes rules out NTFS, but I guess you could use some FAT variant. I am not familiar with all 42 Linux file systems, but I'd be surprised if not at least a few of them can be configured for 128 bytes allocation unit. If you worry about a waste of 3 bytes for a source file indent, you will probably want to use 128 bytes units.
-
David Crow wrote:
glennPattonWork3 wrote:...but syntactic white space 'align your tabs'It's like COBOL or RPG. X|
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:elephant: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.
-
There's Codon for that: [^]Python-based compiler achieves orders-of-magnitude speedups | MIT News | Massachusetts Institute of Technology[^]
>64 Some days the dragon wins. Suck it up.
You rarely if ever find a Python supporter who will agree that some other compiled language is orders-of-magnitude faster than Python. Yet, when Python is compiled, it is speeded up by orders-of-magnitude. The only logical conclusion is that compiled Python is way faster than any other compiled language. Believe it if you want to.
-
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 ...
-
Ya get used to it ;) (The thing that will do your head in is the error when you keep trying to do
!var
) Oh, and good luck with PIP. You've got this! :thumbsup::thumbsup:cheers Chris Maunder
Chris Maunder wrote:
good luck with PIP
Peripheral Interchange Program? I haven't used that since my PDP-11 days.