|
It's nice to see that they support OpenVMS. That's where I've had trouble in the past. At one company we had a written standard of four SPACEs, and it was good. Then those Visual Studio people came along and didn't follow directions; they were supposed to set VS appropriately, but didn't. I'd open a file on my dumb terminus (or emulator) and the indenting would be screwed up. I wrote my own filter to correct it.
|
|
|
|
|
It is easy to use. Just a Hard Tab press. And also it makes the formatting proper. Pressing a single key instead of several space strokes is always a better idea.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
It's just as easy to use spaces: you tell the IDE to substitute spaces (the appropriate number: I prefer 2 instead of 4). You'll need to press the backspace key more if you delete - but that's easily circumvented by not making mistakes.
If you've ever opened your code in another editor, you'll often be treated to a horror show of by using tabs.
/xml> "The difference between genius and stupidity is that genius has its limits." - Albert Einstein
| "As far as we know, our computer has never had an undetected error." - Weisert
| "If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010
|
|
|
|
|
|
It is not always necessary to delete parts of your indention due to mistakes; what about simple changes to your code, an if that was scrapped maybe. For that reason, hard, always
|
|
|
|
|
I prefer hard-tabs and not soft-tabs (spaces) because to support coders preferences: Some prefer 4 chars for indention, others prefer just 2 ...
Collective code ownership is easier to mange indenting using tabs and so each coder can use the tab size she/he prefers
Tabs also enables us easier and faster navigation through the code and avoids making mistakes
StyleCop is your friend!
The source code files will be smaller (this shouldn't be the only reason using TABs ^^)
|
|
|
|
|
This does not really matter until you have to diff in your source control tool. Spaces force everyone to be on the same page with respect to indentation size. I hate spaces and always use tab characters. I prefer to make sure everyone has the same IDE configuration than to force everyone to use spaces.
|
|
|
|
|
Absolutely agree with you even Diff (using Subversion) is able to ignore white spaces
But often I see code on MSDN pages using indention of 4 chars using spaces (!). I prefer indention of 2! When using TABs this is no problem
|
|
|
|
|
I am pretty consistant about using tabs. However I am no zelot. Compared to all the other faults I have seen in code, this is less than nothing.
Ken
|
|
|
|
|
Yes and no ...
Often have seen code with a mix of tabs and spaces and it was horrible to read because some coders used tabsize=2, others used tabsize=4 but with spaces ...
I agree with you that it should not be a big deal. In the .NET it is easy: Use StyleCop
|
|
|
|
|
If you do not like it you can run the code through a formatter.
but I use hard tabs.
cheers,
Donsw
My Recent Article : CDC - Change Data Capture
|
|
|
|
|
no stinkin' tabs. Formatting code so that it is easier to read has never helped a compiler that I've used.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
...but it will help the programmer who has to support your code later.
|
|
|
|
|
DonDriskell wrote: but it will help the programmer who has to support your code later.
We don't need no stinkin' programmers to support our code later.
|
|
|
|
|
LOL.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Nemanja Trifunovic wrote: We don't need no stinkin' programmers to support our code later write no stinkin' code.
FTFY
|
|
|
|
|
You use VB.NET?
Opacity, the new Transparency.
|
|
|
|
|
http://astyle.sourceforge.net/[^] I program it for soft, but I can program it anyway anyone needs it.
_________________________
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....
|
|
|
|
|
Looks fine.
But I do not agree: When indenting source code, we as programmers have a tendency to use both spaces and tab characters to create the wanted indentation.
I always using tabs for indention and using the editor setting "keep tabs"
AStyle will be helpful for legacy code where is a mix if tabs/spaces...? Exists there a VS plug-in which checks the code while typing it? (e.g. StyleCop + StyleCop for ReSharper is working wonderful for C#)
|
|
|
|
|
For coding, I use soft tabs (press the tab key but app (VS, etc.) converts to spaces.
The idea of this is that the tabs find neatly aligned locations for me - but once it's done, I want to have the simple (& consistent!) control of spaces.
But, for HTML, etc., I use hard tabs.
Haven't figured out why this bifurcation occurred.
In either case, I always reset to tab=2spaces. My eyes are still good (with appropriate optical filters), so why spread everything across the page? Tab of 2 spaces is quite easy enough to see.
Consistent Inconsistency.
/xml> "The difference between genius and stupidity is that genius has its limits." - Albert Einstein
| "As far as we know, our computer has never had an undetected error." - Weisert
| "If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010
|
|
|
|
|
|
...that's what she said.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
|
... as long as the rules are consistent for all team members. Otherwise, you and up with a mix of tabs and spaces in the same file and that is bad.
In fact, whenever I edit an existing file, I set the option to display invisible characters in my editor, so I can see whether spaces or tabs are used.
Sometimes I miss Fortran 77
|
|
|
|
|
I agree and do the same thing myself.
|
|
|
|
|
For C and C# I use SPACEs (always), but for DCL I use a TAB followed by SPACEs -- so my labels are obvious.
On the other hand, this is another of those bad questions. I believe the survey has it backward; I would say that a TAB character is soft because you don't know how wide it will appear, whereas using SPACEs is hard because they will not vary in width. Respondants who don't read the question may answer wrong, the results will be meaningless.
|
|
|
|
|
Very good point. If you are a stickler for formatting the tab character can be interpreted differently in different editors. Spaces retain the same distance regardless thus retaining your formatting no matter what editor you use. Your source code should be readable. PERIOD.
|
|
|
|