|
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.
|
|
|
|
|
Personally, I prefer spaces instead of tabs, but I generally set up my editors to do the conversion for me.
Having said that, there are a few languages that require tabs rather than spaces, so we make exceptions for them.
Professional Geek,
Amateur Stage-Levelling Gauge
|
|
|
|
|
However, I am stuck in many of my ways and one thing that annoys me to no end is having to delete every single space that is used for formatting. If VS could somehow magically determine, that hey this was a tab then I would have no opinion on the matter. Until then I will use real tabs in all of my code.
|
|
|
|
|
[Ctrl+Shift+Right], [Del].
|
|
|
|
|
I am also sloppy. I hate that combination with a passion. I am constantly deleting code because of it.
|
|
|
|
|
That's what [Ctrl]+[Z] is for...
|
|
|
|
|
I can't say I have given it a moments thought
|
|
|
|
|
VS makes them soft automatically, and I don't care enough to change it. I usually type hard tabs though, it's just faster.
|
|
|
|
|
VS seems to have solved this problem for the most part. I hate when "old schoolers" used 1/2/3 spaces instead of 4. In those cases, if they diverged from 4 spaces I forced them to use hard tabs so that we could all get along. Otherwise, VS automatically defaults to 4 spaces and I make that the coding standard for our group. It also helps when viewing code in different text editors... everything looks the same with soft tabs (IBM VisualAge defaulted to 8 spaces for every hard tab, eek!!)
|
|
|
|
|
1) You can tell VS what you want to use
2) [ctrl]+[k],[ctrl]+[d] will do the magic on the rest of old files
|
|
|
|