Spaces or Tabs? Microsoft Developers Reveal Their Preferences (msdn.com) 238
In a new video, Microsoft's principal cloud advocate and DevOps lead weighed in on that crucial and perennial developer question: which is better, indenting your code with spaces or with tabs?
"This is kind of a loaded question... However, I am very opinionated on this. I happen to be a huge fan of tabs, for a couple of reasons.
Number one, your file size is going to be much smaller, because a tab is just one character. Okay, okay, granted this isn't a big deal any more, but I'm old as dirt, and I remember when hard drive space was at a premium.
But here's the real reason: you can customize your indentation width. And this is actually a bigger deal than it sounds like. By using tabs, you now give each individual the ability to see the indentation widths that they want, or even in some cases need. That makes it so much more accessible than spaces, right?
So because of that, for accessibility reasons, use tabs.
Well, I guess that settles that, leaving no need for any further... Wait, there's more responses from other Microsoft developers on this page, including program manager Craig Lowen. At the end of a video titled WSL2: Code faster on the Windows Subsystem for Linux! he says: I prefer spaces to tabs, and that's because tabs don't actually have a denotation of how wide or short they have to be in indentations. That's totally done by your IDE, so if you open it up in a different IDE, it might have a different level of indentation. If you use spaces, you'll always have the same indentation level if you're using a fixed-width font.
But however, I still use the tab key, and I just make my editor insert spaces for me.
Number one, your file size is going to be much smaller, because a tab is just one character. Okay, okay, granted this isn't a big deal any more, but I'm old as dirt, and I remember when hard drive space was at a premium.
But here's the real reason: you can customize your indentation width. And this is actually a bigger deal than it sounds like. By using tabs, you now give each individual the ability to see the indentation widths that they want, or even in some cases need. That makes it so much more accessible than spaces, right?
So because of that, for accessibility reasons, use tabs.
Well, I guess that settles that, leaving no need for any further... Wait, there's more responses from other Microsoft developers on this page, including program manager Craig Lowen. At the end of a video titled WSL2: Code faster on the Windows Subsystem for Linux! he says: I prefer spaces to tabs, and that's because tabs don't actually have a denotation of how wide or short they have to be in indentations. That's totally done by your IDE, so if you open it up in a different IDE, it might have a different level of indentation. If you use spaces, you'll always have the same indentation level if you're using a fixed-width font.
But however, I still use the tab key, and I just make my editor insert spaces for me.
Spaces are for barbarians. (Score:2, Funny)
That the primary argument in favor of spaces is "ugh, able use option for set width make Mongo angry" illustrates the neanderthals on that side of the debate.
Re: (Score:2)
This, is indenting code with spaces not a fireable offense in a software development role? I just assumed it was.
Re: Spaces are for barbarians. (Score:2)
No, there are MANY who prefer spaces. And I canâ(TM)t really blame them. Itâ(TM)s the default way to keep files consistent, and some languages require spaces.
Then there are the files with mixed tabs and spaces. A special place in hell belongs to those users.
That said, I prefer an IDE that automatically converts to tabs AND notifies you when there are extra spaces. (Except of course for languages that require spaces.)
Re: Spaces are for barbarians. (Score:2)
Nevermind, that spot in Hell is reserved for Slashdot mobile.
Re: (Score:2)
Re: Spaces are for barbarians. (Score:2)
I have an iPhone because literally my entire family is stuck in the iEcoSystem.
You just sound like a stuck up ââoe-hole.
Spaces are for the enlightened. (Score:2)
Tabs are for heathens that have no code aesthetics.
As soon as you have multi-line statements tabs fail.
While the article's first reason for tab use (smaller files) was valid 30 years ago, so was limiting line length to 80. Considering that the phone in your pocked has 10x the pixels as an old VGA display and also has more storage that you could buy for a years salary back then I don't think that argument has merit today.
Re: (Score:2)
There's rarely any good reason to use super-long lines of code, and when there is, it's better to let it run forever (my preference) OR to have an ugly line break than to defile an entire source code file with space-based indentations. The other options would be a small price to pay to maintain the sanity of tab-based indentations.
Re: (Score:2)
Tabs for indentation, spaces for alignment.
Re: (Score:2)
As soon as you have multi-line statements tabs fail. :D
As you have multi line statements, I fire you
has more storage that you could buy for a years salary back then
Unless 30 years ago, he was a multi billionaire, it was impossible to buy 64BG or even more on less than a ten years salary you can even say 100 years to be on the safe side.
Re:Spaces are for barbarians. (Score:5, Insightful)
Interesting. The winds seem to be shifting on this one. Previously the space-users were so overwhelmingly vocal that the wise tabbists couldn't or wouldn't say anything. Now, the first few threads I see here are in support of tabs.
I think the two developers in the summary really make it clear what the dichotomy is about. Tab advocates want to give maximum control to whatever poor schmuck has to read the code. Space advocates are a bunch of control freaks who will give up authority over layout over their cold dead fingers. Or search and replace.
Newbs took an HBO Silicon Valley joke seriously (Score:3)
Interesting. The winds seem to be shifting on this one. Previously the space-users were so overwhelmingly vocal that the wise tabbists couldn't or wouldn't say anything. Now, the first few threads I see here are in support of tabs.
The newbs took a joke from HBO's Silicon Valley seriously. Give them time, they'll learn. Their skills will eventually develop and they will use the occasional console based tool.
I think the two developers in the summary really make it clear what the dichotomy is about. Tab advocates want to give maximum control to whatever poor schmuck has to read the code. Space advocates are a bunch of control freaks who will give up authority over layout over their cold dead fingers. Or search and replace.
Actually the spaces advocates want the next poor schmuck, which may be themselves at times, to be able to instantly read the code regardless of IDE, or editor, or console. Its not about control per se, its about things just working the first time without experimentation or reconfiguration.
Re: (Score:2)
If your code requires a particular tab stop, you need to think about how you're writing code. Stop trying to draw your penis in it.
Re: (Score:2)
^^ This. I don't understand how people can be writing their code so poorly that changing the tab stop renders the code unreadable to any developer.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
It's not just arrow keys. If you want to place the cursor at the beginning of the line, you have to be much more accurate using the mouse when the file uses spaces for indentation.
Re: (Score:2)
If you want to place the cursor at the beginning of the line
That's what the Home key is for. (or the zero key if you are in the holy editor known as vi) Do you seriously take your hand off the keyboard to reach for the mouse while typing?
Re: (Score:2)
The Home key (or '0') takes you to the beginning of the line, not the beginning of text. To insert something at the beginning of the text you have to hit the arrow key 4 times as many times with spaces than with tabs.
I use gvim. It's often quicker to use the mouse to move the cursor many lines than to use some keys to get to where I want.
Re: (Score:2)
Lol, why don't you just use your mouse all the time if you're not going to use keyboard shortcuts?
In most sane editors you can hit home to go to the start of the line, and then ctrl+right to jump to the first character.
I use gvim.
Nevermind.
Re: (Score:2)
TIL ...
But still, it's more work than if the indent character is a single tab.
Fundamentally, that's what I see whenever this argument arises: the "spaces" camp is always saying "but there is this workaround ..".
With tabs, you don't need workarounds.
Re: (Score:3)
That the primary argument in favor of spaces is "ugh, able use option for set width make Mongo angry" illustrates the neanderthals on that side of the debate.
Mongo no want artist code, Mongo want boring engineer code. Written by people with clipboards.
And if you think Neandertal is some sort of insult, that tells us which side of the "ugga ugga" you're really on.
Re: (Score:2)
100% Just One Choice (Score:5, Insightful)
The biggest problem with tabs is that you get people who will do a mix of tabs and spaces, and then it all falls apart. If you're going with tabs, you can't work with a logical 4-space indentation with 8-space tabs, which is exactly what I've seen some people do. (I think emacs does that by default in bash mode, for example, but it may just be my settings are wrong.)
What is needed is commit checks that require that everyone adding code to the project is following the standard, possibly with exceptions for projects that also include third-party code.
Re: (Score:3)
Unfortunately, formatters are just not smart enough to format code in a readable manner. They don't understand the real meaning of your code, which is essential for doing readable formatting.
It's like saying you can reformat a book and have the formatter decide where the paragraphs and chapters should be.
Fluent code for example is hard to get right with a formatter. Sometimes it is short enough to leave as-is. Sometimes you want to have a link break before each part.
Same goes for line breaking sets of ar
IDE (Score:3)
tabs don't actually have a denotation of how wide or short they have to be in indentations. That's totally done by your IDE,
If only IDEs had settings for that...
Consistency is gold (Score:2)
If you don't mix both, you're good.
But this consistency must be at least project-wide, preferably company-wide.
Personally I prefer spaces, because your code will be aligned exactly the same no matter the IDE (specially on elaborate comments... yeah, I'm not a clean-code zealot, not everything can be explained in a function name).
But this discussion is like that one over semicolons on JS... damn, so much worse problems to deal with.
Re: (Score:2)
And also no matter the programmer, which is the problem for some. Tabs allow programmers to set the indentation level to their preferences.
I was a spaces guy but have been converted. I think tabs are only a problem (as you indicated and as many have noted in this thread) when they are mixed with spaces. That fucks everything up, and eventually leads people to think tabs are bad.
Re: (Score:2)
sw=4:ts=8:noexpandtab
Semantics not presentation (Score:5, Insightful)
Tabs are the semantic way to do indentation. One character per indentation level. And tabs used only for line-leading indentation. Then each tab character has semantic meaning related to the program structure. Intelligent people recognize this as a good thing.
Spaces are presentation-level indentation. Not only is each space individually meaningless, but you've just hard coded the visual appearance of your code. There's no special indent character, as spaces are used everywhere (other than perl line noise). Bad for a whole host of reasons, not least of which is accessibility. Narcissistic autocrats forcing their hare-brained choices on everyone else.
Use spaces if you want to keep coding with Cobol-style fixed punch-card positions like a troglodyte. Or move beyond the weaving loom and program in the 21st century. Semantic markup is generally agreed to be superior in all other realms, but some dinosaurs refuse to adapt. Their death by fiery meteor is well deserved.
Re: (Score:2)
Re:Semantics not presentation (Score:4, Insightful)
One the problems with tabs is that any alignment of code further along in a line gets screwed up when you change the tab size. Comments at the end of a line for example on lines that have different indentation.
Let's say I use tabs, and I set tabsize to 5 (0, 5, 10, 15, 20):
Now, change tabsize to 4 (0, 4, 8, 12, 16, 20):
You can try the same with any mix of spaces/tabs, or advocate only to use spaces at the end of the line... and it still won't align for people that use a different tab size (one of the main arguments for tab advocates). That's why you use spaces.
--
ps. Some more text here to counter the lameness filter. Please try to keep posts on topic.
Try to reply to other people's comments instead of starting new threads.
Read other people's messages before posting your own to avoid simply duplicating what has already been said.
Use a clear subject that describes what your message is about.
Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page)
Re: (Score:2)
Indent with tabs... (Score:3, Insightful)
Re:Indent with tabs... (Score:5, Funny)
Tabs are neutral evil. Mixing tabs and spaces is chaotic evil.
Re: (Score:2)
Yes, but indenting with tabs and then spaces eliminates the ability to re-indent by changing the tab size.
Re: (Score:2)
No, align with spaces allows changing tab size! With only tabs then alignment screws up if the tab size changes.
For example, let's say you have a long conditional that has to straddle multiple lines (none of the 800 character long lines like some IDE people seem to think is acceptable).
for (initial condition here;
then repeat condition here;
then incremental action here)
{
do some stuff.
}
I used spaces, but slashdot mucked it up, so nothing's really aligned above. But the intent of the spaces is to make sure that the three parts of the "for" statement are aligned with each other. The second and third line us
Re: (Score:2)
You just did a great job of illustrating your point. The problem is that it's very difficult to enforce that the spaces are only use for alignment and not also for indentation. It will get messed up. If you want to enforce this on a large project, it means you have to parse the code and determine the correct indention to verify that the usage of spaces and tabs is correct. (This is where a program like GNU Indent comes in.)
Re: (Score:2)
No, it doesn't. It retains the correct alignment when you re-indent by changing the tab size. Using only tabs to indent, even when it is for aesthetic rather than semantic indentation breaks the indentation when viewed with a different tab width.
Re: (Score:2)
Yes, this works. I am a spaces person myself. However usually when I see indentation with tabs, they also align with tabs as well. This makes changing tab width not work very well. As a side effect, when I do adjust tab width I can see clearly what the original author's indentation size was because there's only one size where things like up in a coherent way.
I had to do a project recently where for the first time ever, the code style was dictated to be tabs. And there were OCD people unrelated to the p
Ya, no (Score:2)
you can customize your indentation width.
So *everyone* else who views your code has to adjust their tab display for your files?
People who do what you suggest should be dragged out behind the chemical sheds and shot.
Re: (Score:2)
What the hell kind of code are you writing that it's unreadable if your tab stop changes?
Stop putting ASCII art in your comments. Problem solved.
Re: (Score:2)
Re: (Score:3)
I also bold face the important part of the code!
Re: (Score:2)
Re: (Score:2)
What the hell kind of code are you writing that it's unreadable if your tab stop changes?
It's more a case of code being unreadable due to excessive indention due to tabs forcing one to set a non-standard tab width simply to view the code on a screen/page. Using spaces -- or combinations, like in Emacs where it can use, say, 1 tab and 2 spaces for a 10 space indent -- makes things universally readable and editable *without* requiring a non-standard tab width. (Said as someone with 30+ years using many, many different programming languages, often several within the same project.) But it's just
In other news... (Score:2)
Partly language-dependant (Score:2)
Almost all others: tabs
I don't use an IDE per se, however my text editor can quickly and easily convert all leading tabs to spaces or vice versa.
Now we get into the real religious wars: How wide should the tab indents be?
What? (Score:2)
Christ.
any more? (Score:2)
When spelled as two words, any more refers to quantities. ... When spelled as one word, anymore is an adverb that refers to time. It means “at present,” “still,” or “any longer.”
3 spaces... (Score:4, Funny)
Changed my opinion over time (Score:2)
as a beginner - whatever my IDE of editor was set to by default
then it became 2 spaces, I finally found it hard to make up the correct indentation, went to 3
then I discovered how to use tabs properly, and switched to tabs
then I realized that tabs were inconvenient for copy-pasting, and most people in teams I worked with didn't use tabs properly, didn't configure their editors properly, etc... so I switched to 4 spaces as it is the most common I found, I still use tabs for personal projects.
So my vote is: fo
Your file size is going to be much smaller (Score:2)
Re: (Score:2)
I bet this the kind of guy who uses single-character variables too. Maintaining his code must a bliss.
Well if he is worried about file size then he's probably working on a floppy disk based machine. In that case it might be a 40 column Apple II display so the single char variables (two for readability) make sense.
I'm older than dirt too ... (Score:2)
Number one, your file size is going to be much smaller, because a tab is just one character. Okay, okay, granted this isn't a big deal any more, but I'm old as dirt, and I remember when hard drive space was at a premium.
I'm older than dirt and remember that too. Then I moved from a floppy disk based computer to a hard drive based computer and it was never a concern again.
Being older than dirt, what was still a concern was having code look the same regardless of whether it was being viewed in an IDE, type'd or cat'd to the screen from the console, printed, etc.
But here's the real reason: you can customize your indentation width. And this is actually a bigger deal than it sounds like. By using tabs, you now give each individual the ability to see the indentation widths that they want, or even in some cases need. That makes it so much more accessible than spaces, right?
Not really. Because any sane organization is going to have coding guidelines telling you what the indentation should be. You should acclimate to the organization's
Re: (Score:2)
We have coding guidelines which is part of the problem. They change every few years with change in leadership & different groups do different things. And the subcontractors do their own thing.
Most places I've seen the guidelines are constant for a project. They may change for a new project, a new code base, but not mid project. It might have been considered when revision control systems changed, migrating from svn to git for example, but ultimately it was not done for the same reason it was never done. It would break diffing two version to see what has changed. The svn to git migration preserved the old versioning into and comments, so reformatting was a no go. If all that would have been lost,
Spaces for me (Score:2)
I use all spaces, and insist on it in projects I work on, for the simple reason that tab width is entirely defined by the editor/IDE and can vary from one developer to another depending on settings. Tab-based indentation only works if everyone has the same tab setting and the indentation interval is exactly one tab (ie. if the indentation level is 4, everyone has to set tabs at 4 spaces and not 8). It's far too easy for indentation to become inconsistent the moment even one developer deviates from that, and
works both ways (Score:2)
"But here's the real reason: you can customize your indentation width"
"That's totally done by your IDE, so if you open it up in a different IDE, it might have a different level of indentation"
It's the same argument on both sides. You can customise tabs, but the implementation of that customisation can sometimes work in a way you don't intend. Does your code always need to look the same or is it important to be able to easily modify the look of your code? Sounds to me like it depends on the code.
Which leads
Tabs and 1TBS (Score:2)
Tabs with a width of 4 and OTBS. I always use braces, and it's a waste of vertical space to put a brace on it's own line, even for functions. It's literally the only thing that I have "OCD" about. Mixing spaces and tabs is abomination. Consistent use of 4-space or even 8-space indents is OK, if I have to work on someone else's code that works that way, but I never do it that way myself.
Elastic Tabs (Score:2)
If we had Elastic Tabs in a critical mass of editors, this conversation would have concluded long ago.
Elastic tabs:
- allows dynamic indentation alignment for indentation blocks. Useful for comments, parameters, tables....
- allows proportional fonts. Otherwise we are with ugly monospace fonts.
- saves disk and bandwidth over tabbed source, which saves disk and bandwidth over spaced source.
Re: (Score:2)
I'm going to use this right now, my 2400 baud modem has been feeling kinda sluggish lately.
Most people are too stupid to use tabs (Score:2)
Simply put, using tabs is hard. Tabs should be used only for indentation, and only at the start of a line, and never mixed with spaces. Spaces then are used at the end of the line for aligning comments if needed. Donot use tabs there.
Inevitably though, there will be developers on your team that just don't care enough to get this right. They'll use tabs and spaces wherever they want and as long as it looks right on their screen they donot see the error of their ways. Pointing out these flaws usually get
Using spaces would blow linux kernel size by 25% (Score:2)
Re: (Score:2)
Re: (Score:2)
He has touched A Python.
Re: No spaces or tabs for me. (Score:2)
Re: (Score:2)
No spaces or tabs. Simply a new line if needed.
Found the guy who has never touched Python.
He probably sleeps well. :-)
Re: (Score:2)
Or make
Re:No spaces or tabs for me. (Score:5, Funny)
New lines? Write your code like a real programmer: all one line and spaces only when mandatory.
I use XML instead (Score:3)
I put every line of code between XML tags, then I put the logical indent level in as meta data. That way to compile it I just parse it and it spaces things just right in terms of the logical level of indent.
It's so simple, I don't see why anyone would do it differently
Re: (Score:2)
Re: (Score:3)
This is true. The problem is that if you want to view someone else's code, it's often not in a decent IDE. For example, the GitHub website defaults to tabwidth = 8 spaces unless you log in and fiddle with the settings, which is just stupid. Plenty of plain text file viewers and notepad-like editors also have hard-coded 8-space tabwidths. That's why it's best to stick with spaces, because everybody sees reasonable indentation by default.
Good IDEs can then fudge those spaces for you if you really want. (Howev
Re:A Decent IDE Should Give You Control... (Score:5, Informative)
The worst is when someone uses a mixture of tabs and spaces, and your editor defaults to a different tab width than theirs. Everything looks totally messed up in that case.
Re: (Score:3)
You can attach a turnin filter to git to reject pushes that include tabs in the source.
Better than that, you can have it just auto convert to spaced and send a snotty email back telling them to fix their editor and use the company wide standard tab width so the conversion doesn't brake code.
Re: A Decent IDE Should Give You Control... (Score:2)
Or, if you prefer tabs, you can use one that rejects spaces...
Re:A Decent IDE Should Give You Control... (Score:4, Informative)
I prefer tabs, allowing people to view code with the indentation of their choice. Tabs are a view-independent indentation mechanism, while spaces are hard-coding the layout.
Granted, if you are a company for which it's ideal to have everyone viewing code in a uniform way, or if you use tools where it's not easy to set such preferences (i.e. web-based code review tools, etc), then spaces might be the way to go. Most companies I've worked for mandated "tabs to spaces" and "4 spaces per tab". The other advantage of an "all spaces" policy is that its easier to write conformance filters.
Speaking of GitHub, for those not aware, you can set a per-project tab view by using an .editorconfig file in the root folder with the following content:
indent_style = tab
indent_size = 4
Re: (Score:2)
Re: (Score:3)
Do not indent comments after some code with tabs. Use only spaces in such a case.
Tabs can be only at the beginning of a line and they indicate code indentation and comment indentation relative to the first character of the corresponding code (e.g. when you have comment only lines before or after the corresponding code line). Any indentation which is not relative to the first character of the code must be done with spaces after the tabs indenting to the first code character. Only tabs can be used for indenta
Re: (Score:2)
For example, the GitHub website defaults to tabwidth = 8 spaces unless you log in and fiddle with the settings, which is just stupid.
I used to think the same thing. I read the Linux developer guidelines, which (at least at the time) mandated a tab width of 8 spaces. I scoffed at Linus' dubious skills, needing such a ridiculously wide tab, and needing tabs at all. I used 2 spaces per indentation, and no tabs at all. I felt smugly superior.
Then, one night, I was trying to fix a bug. I had looked at my C code for hours, and couldn't see the problem. Then, on a whim, I remembered the Linux developer guide's recommended 8 character tab width.
Re:A Decent IDE Should Give You Control... (Score:5, Insightful)
A better solution is to ban braceless if-else blocks so indentation doesn't obscure bugs in the first place.
Re: (Score:3)
A better solution is to ban braceless if-else blocks so indentation doesn't obscure bugs in the first place.
I've yet to see a real, valid reason why single-statement blocks require braces. And yeah, I'm well aware of the Apple goto fail [sophos.com] bug. It's not convincing or obscure:
if ((err = SSLFreeBuffer(&hashCtx)) != 0)
goto fail;
if ((err = ReadyHash(&SSLHashSHA1, &hashCtx)) != 0)
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &clientRandom)) != 0)
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
goto fail;
if
Re: (Score:3)
...over how spaces and/or tabs impact indentation.
But that leaves you guessing what the original author(s) intended. If multiple people edit the code and make changes using their own tab-width, you end up with a mess. You also get git-thrashing as people check-out code, make inadvertent changes between tabs and spaces, and then check-in their changes.
Tabs are an even bigger problem with Python, where whitespace is syntactically significant.
All spaces is the obvious and only sane answer.
Re: (Score:2)
Ha!
If multiple people edit the code and make changes using their own tab-width, you end up with a mess.
Only if you're doing something stupid like using tabs for further indentation past the first non-tab character.
If everyone indented with tabs and then used spaces to align within that initial codeblock indentation (for aligning blocks of things within blocks of code) we'd have the best of both worlds. Spaces people can still set the tabwidth however they want in their editor, and tabs people don't have to deal with nonsensical (or forced, or inconsistent) indentation with spaces.
Problem solved. Works wel
Re: (Score:3)
If everyone indented with tabs and then used spaces to align within that initial codeblock indentation
Oh God, No! Mixing tabs and spaces is the worst possible policy.
Please don't force your 2- or 4- or 8- space indentation scheme on me. Let me pick that for myself via tabs
That sounds great in theory, but in reality, if you take code written with an indentation of, say, 4, and display it with 2 or 8, it is going to look like a mess.
It is best to read and edit code with the existing indentation level.
Re: (Score:2)
That sounds great in theory, but in reality, if you take code written with an indentation of, say, 4, and display it with 2 or 8, it is going to look like a mess.
This is a non-issue with what I'm describing. It works perfectly fine. People on my team use variously use 2, 4, and 8 spaces for tab rendering in their IDEs and there are no issues.
Maybe I'm describing it poorly? But there is a good solution that involves the use of both. You should expand your horizons some. It's nice having code that every member of the team can view with their own preferred indentation stops.
Re:A Decent IDE Should Give You Control... (Score:5, Funny)
You should expand your horizons some.
I expand my horizons one space at a time.
Re: (Score:2)
If your using tab spacing any number of spaces more than zero is innapropriate.
And that can easily be enforced with a git hook and your lint tool of choice.
Re: (Score:2)
But that leaves you guessing what the original author(s) intended.
It shouldn't. One indent level = one tab. Simple. Easy. Done.
Tabs are the obvious and only sane answer.
Re: (Score:3)
Or, of course, Python Version {next big number] could finally dump that absurd piece of shit rule that the number of white spaces indicates anything at all, and avoid the entire headache to begin with.
Then again, seeing as a misplaced "}" once caused a major AT&T nationwide crash, I'm going to go all the way out there and suggest that FORTRAN had it right with IF -- ENDIF and similar easy-to-see bracket terminator strings.
(now get offa my lawn, etc etc)
Re: (Score:2)
I suppose you are trying to find a clever way to express your preference for 4 spaces indentation over tabs.
It is, however, a good way to make a mess. On well formatted tab-based code, it will work as intended. But if you find code that is well formatted using tabs, you should probably first ask you the right question before trying to "fix" it.
The most likely reason you want to run this command is that the code uses tabs for both indentation and alignment, have a mix or tabs and spaces, or some other ugly m
Re: (Score:2)
Re: There is only one right answer (Score:2)
Re: There is only one right answer (Score:2)
Re: (Score:2)
expand giveth and unexpand taketh away.
Re: (Score:2)
I hate to break it to you, but it's not vulnerabilities in Microsoft's code that allows people to do that, it's people that are too clueless to realize that they shouldn't click on random links in unsolicited emails.
Re: (Score:2)
> it's people that are too clueless to realize that they shouldn't click on random links in unsolicited emails.
Like Norsk Hydro?
This is 2020, man.
Re: (Score:2)
Why did they even have the vice-presidential debate?
The parts I saw was just talking about B. and T. anyways.
And it's not just Microsoft doing that; all the big companies do it as well.
Re: (Score:3)
The correct answer is to display tabs in your IDE as 1 space. Then use different combinations of tabs and spaces to indent each line 6 spaces. Make sure to update everyone else's code to match this standard.
I'm not sure the punch card machine handling the fortran code is going to get the columns correct, that could be a problem.
Re:Itâ(TM)s all nonsense (Score:4, Insightful)
Whether tabs or spaces are used becomes irrelevant. Either method looks exactly the same on the screen.
Until you do anything from the console.
Re: (Score:3)
Tabs user manual:
Only use tabs for identation, donot mix tabs and spaces, break off lines appropriately when you want things aligned. Never try to align things that use a different identation level. Donot even bother trying to align things at the end of lines, like comments, when the lines involved have different indentation levels. It's a good idea to configure your IDE to have tabs/spaces visible so you can see when you fuck it up. Etc...
Spaces user manual:
Use 4 for indents, align things as needed. N