|
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.
|
|
|
|
|
I agree, but only as an ideal as I know no IDE which can do that.
|
|
|
|
|
I do not understand why anyone uses spaces tbh. I also set my tab spacing to 2, but most of the legacy code I work on - and even some of the newer stuff added to that legacy code - uses spaces, and are thus untidy along the left margin and often not collapsible. Use tabs, for the love of pretty code, and for that matter, used blank lines between logical blocks. And concise comments.
|
|
|
|
|
I see no reason it wouldn't be collapsible. What IDE can't collapse it?
How does your code look if you open it in another IDE/editor? Open it in Notepad for instance.
|
|
|
|
|
a slight exaggeration and significant simplification:
some code
some more code that should be on the same tab as the above, but here's a loop
{
code that loops or whatever
// a comment
}
// a comment
code loop
{
code
}
|
|
|
|
|
PIEBALDconsult wrote: I think some TABophiles use TABs to save keystrokes.
I use spacing to provide formatting.
Tabs in a file, not spaces allows one to skip backwards with fewer keystrokes. Never seen that happen with pseudo spaces (tabbing but with space replacement.)
Since I am also very much a touch typist auto indenting tends to be a hinderance since it tends to break my train of thought. While tabbing (space replacement or not) is fewer keystrokes to get to where I actually want to be without it.
|
|
|
|
|
jschell wrote: skip backwards with fewer keystrokes
Yes, I can see that, but it isn't that big of a deal for me, in fact I think I frequently use the mouse to do that, which is worse.
Also, when using two SPACEs per indent it's less of a burden than with four.
jschell wrote: a touch typist
I definitely am not, but coding is like writing literature, so it's OK.
jschell wrote: auto indenting tends to be a hinderance
Unsure what you are referring to. If you mean having a new line auto-indented to the same level as the previous when you hit RETURN, I like that. With my coding format style, I have a lot of indent levels, so that saves me type.
jschell wrote: it tends to break my train of thought
There are still things Visual Studio does which I don't like and I seem to have no control over them, and I occasionally have to UNDO (Ctrl-Z) an auto-formatting change it made.
It's part of why I wrote my own simple IDE which does only what I want it to.
|
|
|
|
|
Just add braces. For the "purists" make them optional. I have set a new project NPP policy: No Python Period. Cannot find a compelling reason to introduce chaos just to be trendy.
|
|
|
|
|
Any programming language that depends on formatting is fundamentally flawed by design!
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
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.
|
|
|
|