|
You've got a point there. Word and WordPad (and many others, I'm sure) default to a proportional font so the default tab is 1/2 inch.
Oddly, with a monospace fonts, I don't even consider the distance, per se, but instead a sufficient number of characters to make it read comfortably. Perhaps others do this?
In any case, I normally choose 4 characters for the tab length in those files but I may have been influenced by so many editors choosing that same number.
|
|
|
|
|
Inches? I still use cubits.
|
|
|
|
|
|
You just reinforced Godwin's Law.
|
|
|
|
|
I never understood that, 8 spaces per tab, on a teletype of all things - sheer lunacy.
|
|
|
|
|
I think it had to do with what a mechanical typewriter was able to reliably insert. Remember, the tab key didn't shift x spaces, it shifted to the next tab stop, and yes, these were physical stops in a mechanical typewriter. Since these old machines worked on a fixed width font of 8 characters per inch and the physical tab stops were one inch apart, a tab became associated with 8 characters.
|
|
|
|
|
Typewriters were typically either 10 (Pica) or 12 (Elite) characters per inch. Some of the later typewriters could support either and had swappable type balls.
|
|
|
|
|
|
I will answer the question you intended to ask.
I use tabs. Set to 2 spaces as that is the indentation size I always use. I use the tabs because a lot of my coworkers use 4 spaces and they came just adjust the tab size to give the code the look they are used to.
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
I would've never thought there could be a good argument for tabs, but this sounds like a good way to satisfy everyone. My only question would be what the code looks like outside the IDE, in GitHub or even Notepad, for example.
|
|
|
|
|
That's exaclty what drove me to ask. GitHub. PR's sometimes don't format correctly.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I only care about what it looks like to the one working on the code. When dealing with changes to legacy code, I follow the patter established, which usually means copy/paste of the disparate numbers of spaces depending on the mood of the coder when it was created in notepad I really hate the ripple effect that gives - I mean choose an indentation style and stick with it.
I'm happiest when working on fresh apps where I can use auto indenting on vscode. So much pleasanter and I can properly collapse the bits I don't need to see right now. Why would I screw that up with using spaces? Just no.
|
|
|
|
|
What does using spaces have to do with collapsing code that you don't need to see right now?
|
|
|
|
|
You should see this crazy code. It was like they decided arbitrarily each day where to start their nested content.
code
condition
{
code
condition
{
super long lines of code that go all the way off a standard screen with references to deeply nested arrays
}
other code
}
|
|
|
|
|
That's beyond sloppy. I would reformat it, and anyone who complained would be auditioning for a boys' choir.
|
|
|
|
|
Yes, I tried that in the first few weeks of my job and got in major trouble because git was a Christmas tree. And they just ignored my branches because of it. Low man on totem pole.
|
|
|
|
|
I'm regularly asked by other coders to fix code or tweak code that is formattwed like this, or worse.
U like my indents to be a consistant 1/4 inch so the long lines of code don't wrap because they have several levels of indent in them.
Just give me Allsup (ANSI) format.
|
|
|
|
|
Plus it's way easier to screw up the number of spaces needed. I guess that IDEs can be set to auto indent with spaces, but if someone else goes in there with notepad, it'll be a mess in a hurry. Using tabs discourages the use of notepad. Is that controlling? Maybe. I am a megalomaniac only in the coding, otherwise I'm very accommodating, so I'm comfortable with that.
|
|
|
|
|
No, no, no!
If you think that you have found a good argument on the internet...
Thanks for the comment though. It is surprising the number of times I have brought this point up and people that were dead set against tabs get a surprised look on their faces. Never thought of that before. Every indentation is 1 tab - what you want it to look like is up to you.
And if you use notepad to look at code - well I can't help everybody!
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
Beer cans used to have tabs...so I prefer tabs.
PartsBin an Electronics Part Organizer - A updated version available!
JaxCoder.com
|
|
|
|
|
BUT BOTTLES USE ALL CAPS!!
|
|
|
|
|
I fine with that as long as you pick up the tab!
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
|
|
Awesome thanks for the link.
Good storage alternative, especially since the organizers are so dang expensive.
PartsBin an Electronics Part Organizer - A updated version available!
JaxCoder.com
|
|
|
|