Indenting: spaces or tabs?
-
A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
If you are worried about tabs and spaces you're using the wrong set of programming tools... :zzz: :zzz: :zzz: Concussus surgo. When struck I rise.
-
I want to use tabs but have to use spaces, and it sucks.. X| With tabs everybody can have the tabwidth they want. If you want to delete the tab you just type you only have to press backspace once. Easier to reformat the code. I cant see a single advantage with using spaces. /Magnus
- I don't necessarily agree with everything I say
_Magnus_ wrote: With tabs everybody can have the tabwidth they want. If you want to delete the tab you just type you only have to press backspace once. Easier to reformat the code. Fully agree. This the main reason I use tabs: everybody can have the tabwidth they want, without reformatting the code. Take a team of 3 space lovers: they all ident text with different number of spaces. This is why spacers suck and tabers rule! ;) Vagif Abilov MCP (Visual C++) Oslo, Norway Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros. Tomasz Sowinski
-
If you are worried about tabs and spaces you're using the wrong set of programming tools... :zzz: :zzz: :zzz: Concussus surgo. When struck I rise.
I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
-
A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
Tabs, without a doubt. I can't understand why you would use spaces when you can set the editor to indent tabs by x for you.
8
SIMON WALTON
SONORK ID 100.10024 -
A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
Tabs, set to 4 spaces :) Elaine (fluffy tigress emoticon) Would you like to meet my teddy bear ?
-
A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
tabs set to 4 spaces. If you need to use notepad for any unfortunate reason, it is better to go to DOS and use it's editor - you can set tabs in that too The following statement about your geekness is true. The previous statement about your geekness is not true. GCS/IT/P d- s: a- C++++$ UL+>++++ P+ L++$ E- W+++$ N !o K+ w++$ O---- M-- PS- PE Y+ PGP--- t !5 X- tv b+++ DI++ D+ G++ e++ h--- r+++
-
I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
Use the DOS editor...;P The following statement about your geekness is true. The previous statement about your geekness is not true. GCS/IT/P d- s: a- C++++$ UL+>++++ P+ L++$ E- W+++$ N !o K+ w++$ O---- M-- PS- PE Y+ PGP--- t !5 X- tv b+++ DI++ D+ G++ e++ h--- r+++
-
How to start a religious war in one easy post :-D LOL Personally I've used tabs since I started in C back in 1989. I have my tab set at 4. The code is readable, which is the most important thing. Michael Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
-
I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
Luca Leonardo Scorcia wrote: If only notepad had the Tab Size option... I use a cool little tool "TextPad" (I'm sure there are others like it) that is a suped-up version of Notepad. You can set tabs to whatever you'd like. I use it to quickly view files without having to open any IDE's. And it has support for syntax coloring for various languages etc. Check it out: http://www.textpad.com [^] Dan Morris _____________________________________ "An eye for an eye makes the whole world blind." - Ghandi
-
A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
Tabs set to 4 spaces. And I usually ident code with open and close braces on a separate row: ex: if () { } else { } Here you'll find some code idented in a funny way :) P.S. In some languages (python, for example) identing is mandatory. -- Looking for a new screen-saver? Try FOYD: http://digilander.iol.it/FOYD
-
Tabs, set to 4 spaces :) Elaine (fluffy tigress emoticon) Would you like to meet my teddy bear ?
Ditto... in vi, notepad, vc++, etc. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder
-
I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
I mainly use VS.NET and UltraEdit. UltraEdit is the one of the best text editors I've seen to date. Highly configurable, but the default configuration rocks! The other editor which brings me good memories is Boxer (for DOS, unfortunately - the Windows version sucks). Concussus surgo. When struck I rise.
-
Ditto... in vi, notepad, vc++, etc. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder
Ahhh, vi. Man's favourite editor. Or: how to make something incredibly difficult, which could be made very easy so that only true geeks can use it... New and improved: kwakkelflap.com "When I hear of Schrödinger's cat, I reach for my gun." - Stephen Hawking
-
Use the DOS editor...;P The following statement about your geekness is true. The previous statement about your geekness is not true. GCS/IT/P d- s: a- C++++$ UL+>++++ P+ L++$ E- W+++$ N !o K+ w++$ O---- M-- PS- PE Y+ PGP--- t !5 X- tv b+++ DI++ D+ G++ e++ h--- r+++
Real programmers use EDLIN. (although the best programmer's editor was TECO on the DEC PDP-11 under RT-11)
"Think of it as evolution in action." - 'Oath of Fealty' by Larry Niven and Jerry Pournelle
-
A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
2 spaces !!
-
Tabs, without a doubt. I can't understand why you would use spaces when you can set the editor to indent tabs by x for you.
8
SIMON WALTON
SONORK ID 100.10024Depends on your alignment preferences, and the TAB's other people use: if you always only care about left indentation, it's almost no problem. however, for thing like
case eOphelia: // is it her?
if (act.inRiver) // yes ==> dead already?
act.dead = true; // yes ==> force dead
// (simon always forgets to update flags)now look at it on a system with a different TAB width...
Auch den Schatten will ich lieben weil ich manchmal lieber frier' Rosenstolz [sighist]
-
Tabs set to 4 spaces. And I usually ident code with open and close braces on a separate row: ex: if () { } else { } Here you'll find some code idented in a funny way :) P.S. In some languages (python, for example) identing is mandatory. -- Looking for a new screen-saver? Try FOYD: http://digilander.iol.it/FOYD
Welcome to your new job, Mr Walton. There's a serious stack overflow bug in this code, we'll need you to solve it by, oh, noon. Or you're fired.
8
SIMON WALTON
SONORK ID 100.10024 -
Real programmers use EDLIN. (although the best programmer's editor was TECO on the DEC PDP-11 under RT-11)
"Think of it as evolution in action." - 'Oath of Fealty' by Larry Niven and Jerry Pournelle
I quite liked "vi". I know I tend towards the "why do things the hard way when there's lovely tool to do it for you?" school of thought but vi was incredibly easy once you'd been using it for a while. Most of the commands were instinctive (but it was always helpful to have a quick reference guide around, just in case) just like anything else after using it constantly for a few weeks. Paul
-
A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)
Luca Leonardo Scorcia wrote: And yours? Tabs set to 1 (in HTML you can get very deeply nested, having Tab set to 4 or 8 means the first letter of a line can start off the page, so 1 is the only option.) No idea why people use spaces. Someone once mentioned it is better for printing, but I never saw any proof.
Paul Watson
Bluegrass
Cape Town, South Africa -
If you are worried about tabs and spaces you're using the wrong set of programming tools... :zzz: :zzz: :zzz: Concussus surgo. When struck I rise.
Daniel Turini wrote: you're using the wrong set of programming tools... So what tools should we be using? Just curious :)
Paul Watson
Bluegrass
Cape Town, South Africa