|
Quote: Just don't use Python is my advice! Laugh | I'm with you, but "it's so simple and easy to use..." crowd are in force!
|
|
|
|
|
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.
|
|
|
|
|
Friends don't let friends use TABs.
|
|
|
|
|
|
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.
|
|
|
|
|
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.
|
|
|
|
|
But it gives the correct answers when you have complex variables. Dot-net can't do that.
|
|
|
|
|
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.
|
|
|
|
|
OriginalGriff wrote: "use tabs" to save file space
I'm quite certain that isn't the reasoning. I think some TABophiles use TABs to save keystrokes.
I, of course, use two SPACEs per TAB and otherwise a whole ing load of whitespace, vertical space in particular. I am not interested in "saving space" or "saving keystrokes" I need space so I can read the stuff.
The simple IDE I developed for myself defaults to TABs because there is no reasonable number of SPACEs to use as a default instead. But what can save file space is that it right-trims SPACEs from lines when it saves a file -- that eliminates a lot more characters from saved files than using TABs.
|
|
|
|
|
The reason I use tabs is Shift+Arrow = Highlight - Tab/Shift-Tab = indent/deindent the block of text.
I use this so often when I code that I could scarcely be productive without it.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: Tab/Shift-Tab = indent/deindent the block of text
Yes, using the TAB key, but it actually inserts/removes the necessary number of SPACEs rather than TABs.
I don't see that TAB characters makes a difference in doing that.
|
|
|
|
|
Oh, I think my editor uses tabs. So I just use them too. It would be weird anyway for me switching between Tab and spacebar.
In the end i always "Format Document" and I've got the process for that tailored more or less to my liking so it's easy and it works for me.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I'm not talking about using the spacebar to indent code. I don't think the issue is about what key is pressed, but about what characters are produced and stored.
Back when using a VT we had to indent by using the spacebar. But with modern(ish) IDEs we use the TAB key, and have it insert either SPACEs or TABs as configured -- the result looks the same, but it isn't.
I don't recall what Turbo Pascal and C/C++ did with TABs.
When I use Notepad, I still have to use the spacebar to indent because it uses eight-character-wide TAB-stops, but I don't use that for code.
|
|
|
|
|
Ah, I getcha. Sorry. Yeah, I think my editor inserts 4 spaces when I hit tab.
To err is human. Fortune favors the monsters.
|
|
|
|
|
I used to do four, but I've cut down to two. Which is bizarre considering the tiny (8 pt) font I use for code.
|
|
|
|
|
No, it’s logical: four spaces would indent too much in relation to font size.
Full disclosure: I also use two spaces and a tiny font
Mircea
|
|
|
|
|
I have the opposite opinion, I think the indent should remain constant (maybe about a 1/4 or a 1/2 inch) regardless of font size, so a tab-stop would use fewer character-places with a larger font and more with a smaller one.
But I know of no IDE which uses absolute tab-stops -- I wouldn't willingly code in a word processor.
|
|
|
|
|
Let’s agree to disagree
There is a reason however why letters have a certain height to width ratio. Also paragraph indenting, in books that use it, is proportional to font size. Your artistic eye might know better than your logical brain
Mircea
|
|
|
|
|
Certainly, and a lot of this still stems from VT screens and such with only one or two character sizes.
On a VT340 or such I used the 132 character-per-line setting because I didn't like to 80 character-per-line limit.
I'm not real concerned with literature type setting.
Don't get me started on illuminated letters at the start of every block... 
|
|
|
|
|
Mircea Neacsu wrote: There is a reason however why letters have a certain height to width ratio. Also paragraph indenting, in books that use it, is proportional to font siz
True.
However English text is the not the same as programming. I read English very fast and often deliberating skip parts. Certainly I am generally oblivious to periods.
But ignoring a period in programming would be a bad idea.
In the editor I use the typeface is specifically not proportional. I have tried it and found it to be a very bad idea. In English text the layout of the text seldom has meaning. In programming the layout does convey information such as easily seeing blocks.
|
|
|
|
|
I didn’t say the text of a program is the same as the text of a novel. What I do say however is that people writing programs could use a bit from the centuries of experience of typographers.
It might be one of my (many) obsessions, but being somewhat dyslexic, I pay a lot of attention to things like font typeface, tab sizes page layout and such. When things go well, my programs are a thing of beauty in content and form. That happens rarely 🤪
Mircea
|
|
|
|
|
Mircea Neacsu wrote: I didn’t say the text of a program is the same as the text of a novel
The thread is about programming but you then said the following
"in books that use it, is proportional to font size"
The way I read that post suggested that there is an equivalence. As I read it. I saw nothing in the post to which you responded which would have suggested they were referring to English.
|
|
|
|
|
Tab spaces should be in half-inches or centimeters, depending where you live. Not characters.
Nothing succeeds like a budgie without teeth.
To err is human, to arr is pirate.
|
|
|
|