# Indentation Style which is best?

This topic is 4474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

which indentation style do you feel is the best? and can you recommend me the best C++ text editor?

##### Share on other sites
The best is which ever YOU like most.

As far as text editors, I prefer the Visual Studio (Visual C++) editor. You can get the Express version of Visual Studio 2005 for free. For me it's the best, but it may not be for others. Best is relative.

-SirKnight

##### Share on other sites
Personally, I like the 2 space style.

For example:
void main(){  cout << "I like this indentation style!" << endl;    if (true)  {    cout << "See? It's nice." << endl;  }}

This method let's me keep track of whether my brace brackets are lined up properly, and are complete.

As for editors, there are quite a few available. Check out the Forum FAQ

##### Share on other sites
Tabs until indent level, spaces for mid-line alignment. That way, any other people who have different tab sizes will see it how they want to see it and won't have mid-line spacing problems.

##### Share on other sites
Personally, I use BSD/Allman style indentation with 4 space wide hard tabs. And since this will probably come up sooner or later, I use .NET's naming conventions in all languages that I code in.

As for editor, I stick to VS. The vim and emacs people can go on all they like, but I don't buy any of it (and I'm familiar and comfortable with both editors). Simple and direct works fine.

##### Share on other sites
Quote:
 Original post by NypyrenTabs until indent level, spaces for mid-line alignment. That way, any other people who have different tab sizes will see it how they want to see it and won't have mid-line spacing problems.

I've never understood why the majority of people don't seem to do that.

##### Share on other sites
Quote:
Original post by Roboguy
Quote:
 Original post by NypyrenTabs until indent level, spaces for mid-line alignment. That way, any other people who have different tab sizes will see it how they want to see it and won't have mid-line spacing problems.

I've never understood why the majority of people don't seem to do that.

Can you show me an example?

##### Share on other sites
Quote:
 Original post by PromitPersonally, I use BSD/Allman style indentation with 4 space wide hard tabs. And since this will probably come up sooner or later, I use .NET's naming conventions in all languages that I code in.

Yes, that's the indent style I use, except I prefer 2 space tabs. My naming conventions are pretty much a mixture of various other conventions. I do, however, seem to favor the java naming conventions for functions.

Example: void removeObject(...);

That's only because I find it more visually appealing, though.

##### Share on other sites
Quote:
Quote:
Original post by Roboguy
Quote:
 Original post by NypyrenTabs until indent level, spaces for mid-line alignment. That way, any other people who have different tab sizes will see it how they want to see it and won't have mid-line spacing problems.

I've never understood why the majority of people don't seem to do that.

Can you show me an example?

int main() {	int array = {1,	             2,	             3,	             4};	if (/*...*/) {		// ...	}}

Note which spaces are tabs and which aren't. It will all be lined up regardless of the tab size used.

##### Share on other sites
Are the .NET naming conventions the same as the Java naming conventions?

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631424
• Total Posts
3000008
×