*** UPDATED: 01/12/2008 ***
There are several Role Playing Game (RPG) Rulesets, so why can't there be a Ruleset for Programming? This was my notion when I started writing DarkCore.
The concept has a simple premise: provide a Programming Ruleset that ensures consistency in the development of source code to improve organization, readibilty, reuseability, and expandability of code between DarkBASIC Programmers. In a nutshell, one who uses the Ruleset would know instantly how to read and use others code who use the ruleset.
Now with that long mission statement out of the way, here's the current DarkCore DarkBASIC Programming Ruleset:
Quote: "
1. Objects are created from User Defined Types combined with Unified Arrays.
2. There are 4 kinds of Objects: Template, Entity, Record, Datatype
a. Template: Used to provide default profile values for an Entity object.
b. Entity: Used to represent both state-based physical and virtual objects.
c. Record: Used to represent table formatted data.
d. Datatype: Used to package a specific set of variables (ie: Type Vector X Y Z EndType)
3a. Template and Entity Objects must contain the following properties: ID, Type, State.
3b. Records must contain the following property: ID.
3c. Datatypes do NOT use these properties.
4. Object ID Management. Each object contains a positive integer ID used to randomly/sequentially access the Object and link objects to other objects via Unified Array. IDs can be Dynamically (recycled) or Statically (permanent) assigned. Dynamic IDs are generated and assigned using a stack or queue for management. Static IDs are generated and assigned on the fly using a Incrementing Counter, assigned over a network, or assigned during load from a file.
5. Template and Entity Objects must contain a function for the following purposes:
a. New: Inserts a new object instance
b. Delete: Deletes object instance
c. Start: Initialize the object and subobjects
d. Stop: Shutdown the object and subobjects removing them from memory.
Entity Objects must also include the following functions:
e. Update: updates objects, usually used in main loop
6. Naming Convention
a. Constants: PREFIX_OBJECT_SUBOBJECT_PROPERTY_PURPOSE
b. Globals: Prefix_ObjectSubobjectPropertyPurpose
c. Types: Prefix_Object Name or Prefix_Subobject Name
d. Type Variable (aka Property): Property Name
e. Arrays: Prefix_ObjectSubobject
f. Functions: Prefix_ObjectSubobjectPropertyPurpose
g. Function Parameter: Prefix_ObjectSubobjectProperty (for values pass to properties of the object)
h. Function Parameter 2: Prefix_ObjectSubobjectFunctionProperty (for values pass to properties used locally within function)
i. Array used as Queue, List, or Stack data structure Names end with the word 'Queue','Deque','List', or 'Stack'
j. For...Next Loop Names end with word 'Loop'
k. A UDT Property used to reference, relate, or link to other object, name must end with `ID.`
7. 'this' variable holds the ID of the current object instance to be manipulated and can only be used in functions that belong to that Object.
8. All functions return a value or 0.
9. Use Tab Indention and Spacing between operators.
10. Use GOSUB Labels with Naming Convention.
11. Use of Colon ( : ) to concenate statements is prohibited.
12. Any Var labels assigned a Memory Address, include 'Ptr' Suffix. Example: varPtr = Make Memory() or Get BackBuffer Ptr
13. Any Var label assigned a value within a Memory Address uses the 'Value' Suffix. Example: varValue = *varPtr
"
In addition to the Ruleset, the DarkCore DarkBASIC Programming Ruleset also features:
DarkCore Council
A DB Programmer or group of DB Programmers who approve and manage the DarkCore Ruleset and Tools. Currently F.L.Taylor (ME) is the Chairman and single member on the DarkCore Council. Applications for DarkCore Councilor are being accepted.
DarkCore Arbiter
Is a DB Programmer who is knowledgeable in the DarkCore DB Programming Ruleset and authorized by the DarkCore Council to review source code and certify it for DarkCore Compliancy. Currently F.L.Taylor (ME) is the only current DarkCore Arbiter serving the DarkBasic Community. Applications for DarkCore Arbiter are being accepted.
DarkCore Certificate
A Certificate of Compliancy w/ Managed Serial Number issued by a Dark Arbiter to DB Source Code Authors whom submit their Source Code for review and certification. This Certificate comes in the form of a Graphic/Text Logo w/Serial Number to be displayed in viewable documentation.
DarkCore Author
Any DB Programmer who authors source code using DarkCore Programming Ruleset and acquires a Certificate of Compliancy for the Source Code.
DarkCore Wizards
A series of Source Code Tools that generate DarkCore Compliant Source Code. These tools are approved for use by the DarkCore Council.