- Feb 4, 2003
- 3,370
- 0
- 71
Originally posted by: igowerf
Do you guys indent with a tab or a couple spaces? I'm in the habit of using two or three spaces now for actual programming code (C, PHP, etc), but I still prefer tabs with HTML.
Originally posted by: notfred
I indent whatever code I actually write. If Im writing perl or PHP, I indent that so that it makes sense. Often the HTML it generates isn't nicely indented, but that's not what I have to maintain.
Originally posted by: notfred
I indent whatever code I actually write. If Im writing perl or PHP, I indent that so that it makes sense. Often the HTML it generates isn't nicely indented, but that's not what I have to maintain.
Originally posted by: notfred
I indent whatever code I actually write. If Im writing perl or PHP, I indent that so that it makes sense. Often the HTML it generates isn't nicely indented, but that's not what I have to maintain.
Tabs are better in theory because everyone can display them at whatever width they prefer. But one person always ends up having spaces instead of tabs and that always fubars everything for everyone else. So the nicest thing is always that you force everyone to use spaces with a standardized number. 3 is the usual. A good editor will handle spaces just like tabs, with backspacing of indents and such so it's no hassle.Originally posted by: igowerf
Do you guys indent with a tab or a couple spaces? I'm in the habit of using two or three spaces now for actual programming code (C, PHP, etc), but I still prefer tabs with HTML.
Originally posted by: kamper
Tabs are better in theory because everyone can display them at whatever width they prefer. But one person always ends up having spaces instead of tabs and that always fubars everything for everyone else. So the nicest thing is always that you force everyone to use spaces with a standardized number. 3 is the usual. A good editor will handle spaces just like tabs, with backspacing of indents and such so it's no hassle.Originally posted by: igowerf
Do you guys indent with a tab or a couple spaces? I'm in the habit of using two or three spaces now for actual programming code (C, PHP, etc), but I still prefer tabs with HTML.
No, in that case, spaces are the devil. If both are using actual tab characters, then what shows up as 4 spaces one editor will show up as 2 on the other. In your example, devA tabs once to indent and sees 4 spaces. He gives the code to devB who looks at that code and sees a 2 space tab. He writes some more, including some new indentation, passes the file back and devA sees everything in 4space again.Originally posted by: fs5
Originally posted by: kamper
Tabs are better in theory because everyone can display them at whatever width they prefer. But one person always ends up having spaces instead of tabs and that always fubars everything for everyone else. So the nicest thing is always that you force everyone to use spaces with a standardized number. 3 is the usual. A good editor will handle spaces just like tabs, with backspacing of indents and such so it's no hassle.Originally posted by: igowerf
Do you guys indent with a tab or a couple spaces? I'm in the habit of using two or three spaces now for actual programming code (C, PHP, etc), but I still prefer tabs with HTML.
tabs are the DEVIL. Imagine 2 developers working on a piece of code one with tab spacing set at 2 one with tab spacing set at 4.
Developer A tabs once to indent and while Developer B tabs twice to match his.
Originally posted by: kamper
No, in that case, spaces are the devil. If both are using actual tab characters, then what shows up as 4 spaces one editor will show up as 2 on the other. In your example, devA tabs once to indent and sees 4 spaces. He gives the code to devB who looks at that code and sees a 2 space tab. He writes some more, including some new indentation, passes the file back and devA sees everything in 4space again.Originally posted by: fs5
Originally posted by: kamper
Tabs are better in theory because everyone can display them at whatever width they prefer. But one person always ends up having spaces instead of tabs and that always fubars everything for everyone else. So the nicest thing is always that you force everyone to use spaces with a standardized number. 3 is the usual. A good editor will handle spaces just like tabs, with backspacing of indents and such so it's no hassle.Originally posted by: igowerf
Do you guys indent with a tab or a couple spaces? I'm in the habit of using two or three spaces now for actual programming code (C, PHP, etc), but I still prefer tabs with HTML.
tabs are the DEVIL. Imagine 2 developers working on a piece of code one with tab spacing set at 2 one with tab spacing set at 4.
Developer A tabs once to indent and while Developer B tabs twice to match his.
A text file contains no info on how many spaces tabs should be represented by, they just contain tab characters. The problem comes when someone starts telling their editor to use a certain number of spaces instead of tabs (which is pretty hard to avoid in my experience).