[OBJ] Coding - Coding standard (old)
Moderator: Transport Empire Moderators
[OBJ] Coding - Coding standard (old)
ChrisCF once pulled a coding standard of the net and I have been busy converting it to our new homepage. Some utter crap has been removed but the core issues remain. The coding group needs to evaluate the current coding standard, when needed add to or edit it and finally accept it.
The Coding Standard can be found here.
Members: Grunt, Mek, Pjaytcy, Uzurpator
The Coding Standard can be found here.
Members: Grunt, Mek, Pjaytcy, Uzurpator
Last edited by Hyronymus on 23 Sep 2005 17:32, edited 3 times in total.
Seams like the words that are being defined are missing.Conventions
The use of the word shall in this document requires that any project using this document must comply with the stated standard.
The use of the word should directs projects in tailoring a project-specific standard, in that the project must include, exclude, or tailor the requirement, as appropriate.
The use of the word may is similar to should, in that it designates optional requirements.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
They really should be quoted, then:
The use of the word "shall" in this document requires that any project using this document must comply with the stated standard.
The use of the word "should" directs projects in tailoring a project-specific standard, in that the project must include, exclude, or tailor the requirement, as appropriate.
The use of the word "may" is similar to "should", in that it designates optional requirements.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Currently, I'm mostly watching, but I suppose that may change.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
I just noticed something: there is no indentation in the code samples! I recommend chaning samples like:
Into something like:
(Feel free to change according to your own liking. )
Code: Select all
class NameOneTwo
{
public:
int StartYourEngines(
Engine& rSomeEngine,
Engine& rAnotherEngine);
}
Code: Select all
class NameOneTwo
{
public:
int StartYourEngines(
Engine& rSomeEngine,
Engine& rAnotherEngine);
}
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
The two keywords here are "Fixed width font" and " 's."
For example:
Will give, when a proper stylesheet is applied:
For example:
Code: Select all
<p class="code">
class Something {<br>
int member1;<br>
int member2;<br>
void method(int parameter);<br>
}</p>
Code: Select all
class Something {
int member1;
int member2;
void method(int parameter);
}
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
I thought the magic words were "<pre>" and "</pre>"?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
<pre> is unformatted.. The result will be the same though.
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
I have never worked on a program that had a "coding style" requirement, I've always done it my way, so I absolutely can't comment on this. Ofcourse, I could say what's different from what I usually do, but that doesn't get us any further, because my formatting rules don't get any better than this:
I usually just follow whatever indentation rules the development environment is best automated for and name my variables/functions however I like them (ie underscores, capitalization, ...).
I usually just follow whatever indentation rules the development environment is best automated for and name my variables/functions however I like them (ie underscores, capitalization, ...).
On holiday from 16/07 till 31/07
Hyronymus wrote:I hope you can imagine where it would lead the code to if everyone in the coding team did that, Pjaytycy .
Yes, maybe it wasn't so obvious, but I posted that as the reason why I wouldn't comment on this
Topic locked, a final coding style is chosen (15112006).
On holiday from 16/07 till 31/07
Who is online
Users browsing this forum: No registered users and 3 guests