Style Guide
Moderator: Coders of Rage
- 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
^
GAYGAYGAYGAYGAYG
GAYGAYGAYGAYGAYG
- 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
I generally only leave the curly brace on the same line when I'm defining a single class in a header file. Anywhere else I move it to the next line just because it makes it much easier to find them. Every now and then I switch between habits for curly braces, but my naming conventions have stayed pretty firm.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Style Guide
I recently started keeping my curly things on the same line... IDK why though... oh well... I like it better

- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: Style Guide
Member functions StartWithCapitalLetter in the engine now, and members start with m? Aw, I dislike both of those. Guess it's a good thing I'm not programming the engine :PGyroVorbis wrote::shock: I have no idea how that happened...
Anyway, I will say that the style that Kendall and I have adopted 100% matches Innerscope:
Although I do occasionally see where it would be beneficial to name members with an m.
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
Oh, actually. I didn't notice that. Maybe not 100%. We don't do mData for members. That does annoy me too.MarauderIIC wrote:Member functions StartWithCapitalLetter in the engine now, and members start with m? Aw, I dislike both of those. Guess it's a good thing I'm not programming the engine :PGyroVorbis wrote:I have no idea how that happened...
Anyway, I will say that the style that Kendall and I have adopted 100% matches Innerscope:
Although I do occasionally see where it would be beneficial to name members with an m.
We did start capitalizing non accessor member functions now like:
object.getMember();
object.setMember();
object.Load();
object.Save();
- 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
I tend to do this for organization sake. I will occasionally use a data type identifier for local variables (i.e. Vector vPosition) if the function is complicated. I hear that's looked down upon here as well.GyroVorbis wrote:Oh, actually. I didn't notice that. Maybe not 100%. We don't do mData for members. That does annoy me too.MarauderIIC wrote:Member functions StartWithCapitalLetter in the engine now, and members start with m? Aw, I dislike both of those. Guess it's a good thing I'm not programming the engine :PGyroVorbis wrote:I have no idea how that happened...
Anyway, I will say that the style that Kendall and I have adopted 100% matches Innerscope:
Although I do occasionally see where it would be beneficial to name members with an m.

Current Project: Gridbug
Website (under construction) : http://www.timcool.me
Website (under construction) : http://www.timcool.me
- Bludklok
- Chaos Rift Junior
- Posts: 241
- Joined: Tue Apr 14, 2009 1:31 am
- Current Project: EnigmaCore
- Favorite Gaming Platforms: PC, N64, Playstation1, Playstation2
- Programming Language of Choice: C++
- Location: New Jersey
- Contact:
Re: Style Guide
Ill show you my style in a simple DoS calculator program...
For the record, a total of 7 brain tumors, a broken leg, a fractured spine, and an I.Q. reduction of about 95% was suffered in the making of this program. I can feel my brain bleeding. (One of my top priorities in a program is neatness and readability)
On a side note... Imagine debugging a program where the entire source code is on 1 line... "Error on line 3".
Code: Select all
#include <iostream>
#include <windows.h>
using namespace std;
int main(){int a,b;a=b=0;cout<<"Input first var: ";cin>>a;cout<<endl;cout<<"Input second var: ";cin>>b;cout<<endl;cout<<a<<" + "<<b<<" = "<<a+b;cout<<endl;system("pause");return 0;}
On a side note... Imagine debugging a program where the entire source code is on 1 line... "Error on line 3".

- MadPumpkin
- Chaos Rift Maniac
- Posts: 484
- Joined: Fri Feb 13, 2009 4:48 pm
- Current Project: Octopia
- Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
- Programming Language of Choice: C/++,Java,Py,LUA,XML
- Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk
Re: Style Guide
what is... readable? and.... manageable?dejai wrote:Do you have a standard set for how you indent your code to make it more manageable and readable?
readable code? what is that?
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock



For God so loved the world that he blessed the thugs with rock



- MadPumpkin
- Chaos Rift Maniac
- Posts: 484
- Joined: Fri Feb 13, 2009 4:48 pm
- Current Project: Octopia
- Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
- Programming Language of Choice: C/++,Java,Py,LUA,XML
- Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk
Re: Style Guide
like wise, mine toM_D_K wrote: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; } }
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock



For God so loved the world that he blessed the thugs with rock



- 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
Mar, I think we need a forum-wide ban on everybody who does their braces like:MadPumpkin wrote:like wise, mine toM_D_K wrote: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; } }
Code: Select all
if(some bullshit)
{
}
Code: Select all
if(proper) {
}
- 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
I'm going to switch just because Falco said that. Falco is my idol. He knows best. 

Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
Re: Style Guide
I guess Falco doesn't get on well with the GNU coding guidelines then....
http://www.gnu.org/prep/standards/html_ ... tting.html
To be honest I prefer the following
but I can understand the need to put up with both depending on the project.
http://www.gnu.org/prep/standards/html_ ... tting.html
To be honest I prefer the following
Code: Select all
if(something){
}
- 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
You can try to ban meGyroVorbis wrote:Mar, I think we need a forum-wide ban on everybody who does their braces like:MadPumpkin wrote:like wise, mine toM_D_K wrote: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; } }
Because everybody knows thatCode: Select all
if(some bullshit) { }
is the proper practice!Code: Select all
if(proper) { }

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.
- 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
Speaking from experience: I wouldn't say that if I were you..M_D_K wrote:You can try to ban me

Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!