|
Wordle 488 4/6*
⬜⬜🟨⬜⬜
⬜⬜🟨🟨🟨
🟨🟨🟩🟨⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Quick survey...
How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Probably none. I expect everyone just chooses one or the other.
Edit: Oh, wait, maybe I did... When I wrote DCL, I used a TAB for the first indent and then SPACEs after that. Does that count?
|
|
|
|
|
I use the TAB key to insert SPACES.
"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 all do. We all use one or the other, perhaps even both.
But to answer your question, I use spaces. I generally set up the IDE to sub 4 spaces for a tab.
|
|
|
|
|
FreedMalloc wrote: I generally set up the IDE to sub 4 spaces for a tab.
Infidel! All right-minded people know that a tab stop is every 8 spaces! Anything else is heresy! Your immortal soul will be condemned to an eternity in an infinite loop unless you repent!
Keep Calm and Carry On
|
|
|
|
|
Splitter! The Real Distance is obviously 3 spaces per tab.
"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!
|
|
|
|
|
Nah I like a tight real estate, 2 spaces per tab works best.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
2½ spaces per tab
Nothing succeeds like a budgie without teeth.
To err is human, to arr is pirate.
|
|
|
|
|
There's always someone who just wants to watch the world burn, isn't there?
OK. You can have your half-a-space provided it's the top half.
"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!
|
|
|
|
|
No, TAB stops are by distance, not character count. A half inch is sufficient.
|
|
|
|
|
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?
|
|
|
|