Jump to content
  • Advertisement
Sign in to follow this  
Boder

Bracket Conventions

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Sorry to be a copycat, but I just have to know which style most people use for coding in C/C++. With all these debate threads (naming conventions, char* vs. string), I thought maybe we should talk about something that really matters [wink]. Brackets! Also do you use tabs or spaces for indentation. I use: [cool]
function()
{
     // Tab
}


I like the way the brackets line up.

Share this post


Link to post
Share on other sites
Advertisement
I use this:


int Blah( int thing0, int thing1, int thing2 )
{
thing0 = thing0 + ( thing1 * thing2 );
somearray[ thing2 ] = thing1 / thing0;

return SomeFunc( somearray[ thing2 ] );
}




I seperate almost everthing with a space so as that the code is clean and easy to read.

Share this post


Link to post
Share on other sites
I use the One True Brace style :) with tabs for indentation, that are displayed as four spaces by my editor.

Share this post


Link to post
Share on other sites
Presumably, you've all hit a brick wall with your projects if you've got time to reply to this thread...


Yes, i have hit a brick wall.

I'm entering the "More Coffee" phase of development, quickly approaching the "I Hate Stupid Vertex Buffers" phase.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!