Coding style...

Everything related to the code /
Tout ce qui touche au code
Post Reply
milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Coding style...

Post by milipili » Sat Jun 07, 2008 11:30 am

Is there a coding style guide somewhere ?
Because honestly I don't really understand this coding style (mixed C/C++,Code in headers, useless inlines)...
Or at least if you could explain to me ?
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Jun 07, 2008 12:42 pm

well ... in fact there is no official coding style :?

There are only a few rules:
* don't use too much exceptions (since it prevents debugging efficiently)
* "short" functions usually go in headers, but "short" isn't very well defined here, we're slowly moving functions from headers to .cpp files
* put in the same modules stuffs that do one task (so we don't have things like ai_* modules)
* we mostly use objects for things that really are objects in TA3D (ie units, weapons, unit engine, weapon engine, ...), for example you won't see an object for the renderer (it's split into engine modules, except for water rendering which is done in the main loop considered as the renderer/user interaction loop)

if you need details about modules you can look at the doc/dev.txt file, but it has not been updated since we started networking code ...
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sat Jun 07, 2008 1:36 pm

Well well...
Am I allowed to make some rearrangements ? (in the same time with RW permissions for the svn ^^). In the same time I would add some doxygen documentation.
Damien Gerard
Ta3d & Yuni Developer

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sat Jun 07, 2008 1:39 pm

In fact I would need RW access to begin to make the project compiles under OS X with the new CMake files.
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Jun 07, 2008 2:26 pm

I've asked AF to create an account for you (or at least tell me how to add a new user :D ). It shouldn't take too long :)
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sat Jun 07, 2008 2:32 pm

What is AF ?
I should not know how to add a single user. I have my own servers with my own SVN repositories/trac so I don't use external solutions.
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Jun 07, 2008 3:41 pm

WHO is AF ?

this web site is hosted on AF's server :D and we thank him for all those great services :)
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Post by milipili » Sat Jun 07, 2008 3:49 pm

Oh ^^ Sorry for that AF :)
Damien Gerard
Ta3d & Yuni Developer

User avatar
AF
Administrateur - Site Admin
Posts: 139
Joined: Thu Dec 28, 2006 8:19 pm
Location: NW UK
Contact:

Post by AF » Sun Jun 08, 2008 3:20 pm

hmmm AF, I must figure out who that is oneday

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sun Jun 08, 2008 5:39 pm

AF - buhahaha, cool joke :)

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests