Another thread was about this, I was just wondering: how do you indent your source code?
I prefer indenting with two spaces.
Printable View
Another thread was about this, I was just wondering: how do you indent your source code?
I prefer indenting with two spaces.
4 spaces. I used to use tabs until I realized it made the source code look different depending on what application was viewing it.
2 spaces
@Echo bithub
I bet a bunch of newbies are going to read this thread and be like "huh? wuzzat???". :p
Anyway, one tab or 6 spaces.
So, we need to periodically hold this poll so as to determine some trend? :)
Well, there seems to be several threads about indent style, but the one that most closely matches this poll is... How far do you indent?
I use tabs (set to the width of 4 spaces) because we use Visual C++ exclusively for our coding and tabs are easiest to work with.
On personal projects I often set my editor to convert tabs to spaces (still at 4 spaces per tab). For code I post on forums I have a macro that converts all tabs to 4 spaces that I run before posting since tabs don't look so good on these forums.
I'd like to add that one space just isn't sufficient. On a side note, I wonder if anyone indents using only semicolens? :p
I follow Linus's lead:Quote:
Originally Posted by Linus Torvalds
When I'm indenting blocks of code like functions, conditionals, etc... I use tabs.
When I'm trying to get various parts of the code to line up (like when I have very similar lines of code and I want to emphasize their similiarity and clarify the different parts of each line, I use spaces (that way it doesn't get messed up if someone uses 4-space-tabs instead of my 8-space-tabs).
edit: Linus Torvalds endorses my 8-space-tabs? YES!
That just makes the three of you heathens :pQuote:
Originally Posted by sean
Who is Linus Torvalds?
EDIT: Just found it on Wikipedia. Didn't look too impressive. But 8 space tabs surely look impressive on C++ generic programming...