Simerge spacegame

Developer board for project simerge
It is currently Wed Jun 10, 2026 1:24 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Guildlines
PostPosted: Sat Sep 11, 2010 9:08 am 
Offline
Site Admin

Joined: Mon Jan 12, 2009 11:07 am
Posts: 104
This thread is introducing a few guidlines to contribute to our source code. This list isn't claiming to be complete. Also some guidlines may change in future by request of other developers. I want to start from my position first:

Names:
  • Name prefixes on classes, structures and unions: All Names begin with T[any name]. Examples: class TObject, class TView, class TSegment
  • function names: All function names should start with lowercase letter: Examples: lookupPlanetObject(), createObjectFromGUID()

Headers and Sources:
  • Modularization: An application module in Simerge consists mainly of a single header file and of multiple source files belonging to it. Alternatively a module may be split into multiple headers divided by sub functionalities. Especially then, when it gets too big.
  • Procedures in headers: Better not add big chunks of procedural code into headers, in exception of small inline functions or templates.
  • Grouping in Source: All members of a class inside a source file should be grouped together into a block introduced by a comment "Members of [[classname]]". The same should be done for global symbols introduced by a comment "global symbols".

Objects:
  • Singletons: Better not to use.

Any purposes and discussions are welcome.


Top
 Profile E-mail  
 
 Post subject: Re: Guildlines
PostPosted: Wed Sep 15, 2010 3:39 pm 
Offline

Joined: Wed Sep 08, 2010 2:06 am
Posts: 11
Just curious, why prefix class names with a "T" instead of a "C", or use no prefix at all and rely on the capitalization of class names to make it clear that they are classes?


Top
 Profile E-mail  
 
 Post subject: Re: Guildlines
PostPosted: Sat Sep 18, 2010 6:03 pm 
Offline
Site Admin

Joined: Mon Jan 12, 2009 11:07 am
Posts: 104
T means type. It has it's historical reasons. Originally I took this convention from Borlands TurboVision on which base I created the GUI system. You will meet it also very often in Borland's Delphi applications.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group