Style Guide
Moderator: Coders of Rage
Style Guide
Do you have a standard set for how you indent your code to make it more manageable and readable? I am specifically asking this question to the elysian shadows development team as I don't want to be flooded with every ones personal indentation. Nor do I want this to turn into an Emacs vs Vi war because we all know that Emacs is much better. Anyway thanks.
Re: Style Guide
I think it's more of a personal thing, I bet they all do it the way their used to. Once you get one you like you stick with it...

Re: Style Guide
Not if your working for someone.
OSI examples:
Linux (1TB)
BSD (Allman)
OSI examples:
Linux (1TB)
BSD (Allman)
Re: Style Guide
ahh, I stand corrected, but I bet the team does it the way I said... but I guess we'll find out 


- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Style Guide
Yes. And naming conventions, too.dejai wrote:Do you have a standard set for how you indent your code to make it more manageable and readable? I am specifically asking this question to the elysian shadows development team as I don't want to be flooded with every ones personal indentation.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Style Guide
Of course we god. You can't work in a team without that stuff.
- Innerscope
- Chaos Rift Junior
- Posts: 200
- Joined: Mon May 04, 2009 5:15 pm
- Current Project: Gridbug
- Favorite Gaming Platforms: NES, SNES
- Programming Language of Choice: Obj-C, C++
- Location: Emeryville, CA
- Contact:
Re: Style Guide
...But Vim rules!!!Nor do I want this to turn into an Emacs vs Vi war because we all know that Emacs is much better.

You're writing C++ programs in emacs? What are you, a masochist?
That's too bad, because I'm going to tell you my style and indentation anywayI am specifically asking this question to the elysian shadows development team as I don't want to be flooded with every ones personal indentation.
Code: Select all
class Sprite : public Object {
protected:
type protectedMember1;
type protectedMember2;
type protectedMember3; // no relation to 1 or 2
public:
Sprite();
~Sprite();
virtual void Render();
void SetMemberData(type nData) {protectedMember = nData;}
void SetMemberData(type nData);
return type GetMemberData() {return mData;}
};
//blocks of code
void Sprite::Render() {
local variable declarations;
render code;
if(variable1 == variable2) {
do code;
}
}
/*
Naming conventions:
Class: Sprite -> Extended Class: GameSprite
Members: mImage, mPosition, mAnimIndex
Functions: Move, SetSpriteSheet, StartAnimation
*/
If I were to work for someone else, it wouldn't be difficult for me to conform to their naming conventions/style though. I notice a lot of trained programmers are very similar (in indentation style) anyway.
Current Project: Gridbug
Website (under construction) : http://www.timcool.me
Website (under construction) : http://www.timcool.me
- thejahooli
- Chaos Rift Junior
- Posts: 265
- Joined: Fri Feb 20, 2009 7:45 pm
- Location: London, England
Re: Style Guide
100th post for me
My naming convention is the same as most people from what I have seen.
As for indentation I use the default that visual studio does.
Also curly brackets have nothing on their line and if, for, etc. statements allways have curly brackets even with a single line within them.

My naming convention is the same as most people from what I have seen.
Code: Select all
// Variables start with lowercase and each new word is captial
int playerPosition;
// Functions start with Capital and each new word is capital
void FunctionOne() { }
// Class name is same as a function name
class PlayerClass
{
};
// constants and enums values in all caps, enum name same as class
const int ACONST;
enum Animal { DOG, CAT, BIRD };
Also curly brackets have nothing on their line and if, for, etc. statements allways have curly brackets even with a single line within them.
I'll make your software hardware.
- ismetteren
- Chaos Rift Junior
- Posts: 276
- Joined: Mon Jul 21, 2008 4:13 pm
Re: Style Guide
I see you use capital letters for functions, how manydoes that? (i dosent, unless i use C#, since visual studio is forcing it on me... or maybe im just too lazy to change it. But i does not use C# much anyway... :P)thejahooli wrote:100th post for me![]()
My naming convention is the same as most people from what I have seen.
- thejahooli
- Chaos Rift Junior
- Posts: 265
- Joined: Fri Feb 20, 2009 7:45 pm
- Location: London, England
Re: Style Guide
I can never remember seeing anyone who doesn't do this.ismetteren wrote:I see you use capital letters for functions, how manydoes that? (i dosent, unless i use C#, since visual studio is forcing it on me... or maybe im just too lazy to change it. But i does not use C# much anyway... :P)thejahooli wrote:100th post for me![]()
My naming convention is the same as most people from what I have seen.
EDIT: Actually I have seen some people who switch what I do between variables and functions, but only a very small amount.
I'll make your software hardware.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Style Guide
What?GyroVorbis wrote:Of course we god. You can't work in a team without that stuff.

Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Style Guide

Anyway, I will say that the style that Kendall and I have adopted 100% matches Innerscope:
Innerscope wrote: That's too bad, because I'm going to tell you my style and indentation anywayDefinitely not all there is to show, but you get the basic idea...Code: Select all
class Sprite : public Object { protected: type protectedMember1; type protectedMember2; type protectedMember3; // no relation to 1 or 2 public: Sprite(); ~Sprite(); virtual void Render(); void SetMemberData(type nData) {protectedMember = nData;} void SetMemberData(type nData); return type GetMemberData() {return mData;} }; //blocks of code void Sprite::Render() { local variable declarations; render code; if(variable1 == variable2) { do code; } } /* Naming conventions: Class: Sprite -> Extended Class: GameSprite Members: mImage, mPosition, mAnimIndex Functions: Move, SetSpriteSheet, StartAnimation */
If I were to work for someone else, it wouldn't be difficult for me to conform to their naming conventions/style though. I notice a lot of trained programmers are very similar (in indentation style) anyway.
- M_D_K
- Chaos Rift Demigod
- Posts: 1087
- Joined: Tue Oct 28, 2008 10:33 am
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C/++
- Location: UK
Re: Style Guide
My indentation matches in Innerscope's. But my curly brace placement is different.
Code: Select all
class Sprite : public Object
{
protected:
type protectedMember1;
type protectedMember2;
type protectedMember3; // no relation to 1 or 2
public:
Sprite();
~Sprite();
virtual void Render();
void SetMemberData(type nData) {protectedMember = nData;}
void SetMemberData(type nData);
return type GetMemberData() {return mData;}
};
//blocks of code
void Sprite::Render()
{
local variable declarations;
render code;
if(variable1 == variable2)//usually if it's only one call don't even bother with braces
{
do code;
}
}
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.