Coding Guidelines

Coding Guidelines

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Coding Guidelines

Post by PauloMorfeo »

Here it is:
http://www.mono-project.com/Coding_Guidelines

These are the coding guidelines for the mono project. The ones i adopted some time ago. It seems they changed some stuff.

Now, they're recomending 8 space tabs and the usage of local variables like very_important_value, where i use 6 space tabs and veryImportantValue.

If you're learning how to program or don't have any standard adopted yet, go check that out and either adopt it as it is or adopt a modified version you like best. The important is to keep your code consistent.
User avatar
FireCrack
Posts: 676
Joined: 19 Jul 2005, 09:33

Post by FireCrack »

Consistency is realy all that's important, i myself use 4 space tabs, veryImportantValue and

Code: Select all

if (a) 
{
	code ();
	code ();
}
is far neater IMO

and i'f i'm using nested parentheses i put spaces inside them.
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

Those suggestions are both lame and inconsistent.
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

mmm, I like that, differentiating between instance feilds and global fields. I've always done the thing making them look the same, proper differentiation could make them much easier to read.

I have so many bad habits :P, I'll keep this open the next time I'm doing a coding project.
User avatar
Kuroneko
Posts: 483
Joined: 03 Jan 2005, 05:32

Post by Kuroneko »

[K.B.] Napalm Cobra wrote:Those suggestions are both lame and inconsistent.
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

How so? They are good habitual coding practices that gives code a standard list and makes it easy to read for other people. This is expecially important for high end coding for businesses, but can really help out for open sourcers too.

They also happen to mostly be the habits the best uni's have been teaching in thier comp sci classes for a while now.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

We were told to adopt a style we were comfortable using. :wink:


I tend to use same line open braces for everything, though that tends to be the norm with Java. :|
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I find that as long as your indenting is fine, it doesnt matter if it's anything above 2 spaces.

However a good standard I recommend people adopt is commenting code, far more useful....
Post Reply

Return to “Engine”