Vulcan Project Rules
Vulcan Rules Version 1.0
- Procedure
- New code
- Major or global changes will be discussed on the developer list prior to implementation and again prior to checkin.
- Developers are responsible for fixing all down stream references and procedures affected by their changes.
- Code cleanup
- All developers are responsible for general cleanup of code in areas in which they work.
- All developers are responsible for the paragraphing of code in areas in which they work.
- All developers will remove artificial integer types USHORT, SHORT, etc. in areas in which they work.
- Pragmas, deliberate errors in platform conditional code, etc. will not be used as placeholders for missing cleanup.
- Project architect
- The project architect has veto power over all code checkin.
- The project architect must explain all exercises of this power to the developer list.
- New code
- Licenses
- All modules currently licensed under IPL must continue to be licensed under IPL
- New modules must be licensed under IDPL
- No restrictions beyond those of the IDPL may be applied to any modules.
- Classes
- Encapsulation 1. All new code is encapsulated in classes 2. Existing code will be encapsulated when it is modified
- Names
- Class names begin with a capital letter.
- Class member names begin with a lower case letter.
- Underscores are not used in new names
- Names use internal capitalization to indicate word boundaries, e.g.DatabaseMetaData.
- Declaration files
- A class is declared in a file called <ClassName>.h.
- A class declaration file contains only one class.
- A class declaration file also defines all constants required for that class.
- A class declaration file must contain abstract declarations for classes referenced in the declaration
- A class declaration file includes class declaration files for classes included as members.
- A class is declared in a file called <ClassName>.h.
- Implementation files
- A class is implemented in a file called <ClassName>.cpp.
- A class implementation file contains only one class implementation
- C++ usage
- Deprecated
- Use of the C++ std library is deprecated and will be phased out.
- C++ template use is discouraged
- Use of language features not generally and uniformly implemented across the industry is prohibited.
- Multiple inheritance is strongly discouraged except for classes that inherit from the class “RefObject”
- All casting is discouraged and should be avoided by consistent type declarations.
- Function or class method declarations will not use pass by reference
- Macros
- The use of macros is generally discouraged, but permitted when necessary to encapsulate commonly used code sequences
- Use “static const” to name constant values rather than macros
- Prefer switch statements to multiple if statements.
- Deprecated
- Conditional Compilation
- Conditional compilation of specific features is prohibited
- Conditional compilation of debugging routines is permitted when appropriate.
- Conditional code required for platform specific features will be restricted to modules dedicated to platform services.
- Classes should not have conditional compilations for different environments.
- Data declarations
- The use of 8 and 16 bit integer data is strongly discouraged except where required by ODS and API specifications.
- Local variables
- Local variables are declared at first use,
- Local variables are generally be initialized in their declaration
- Character data
- Character data will be declared as “char” or “TEXT”.
- Characters strings will normally be passed as “const char*” or “const TEXT*”.
- Character strings as class members will normally be declared as instances of the string class JString.
- No character string declared as “const char*” may be cast to “char*” for the purposed of passing it to a incorrectly declared function for method.
- Numeric data
- Byte array data will be declared as “UCHAR”.
- Numeric values that can be accommodated in 31 bits or fewer will be declared as type "int" unless they are stored in the database or used in the API ,
- Signed numeric values that are architecturally constrained to 32 bits will be declared as “SLONG” (deprecated) or “INT32”
- Unsigned numeric values that are architecturally constrained to 32 bits will be declared as “ULONG” (deprecated) and “UINT32”.
- Signed and unsigned 64 bit numeric values will be declared as “INT64” and “UINT64” respectively.
- Pointer to objects will normally not be declared as “const”.
- Memory Allocation
- Allocation
- Objects will be created, in general, with the operator “new”.
- Objects are responsible for clearing memory they allocate.
- Deletion
- All objects will be formally deleted
- Objects are responsible for releasing memory and other resources they allocate or control.
- Memory pools
- The existing memory pool mechanism is deprecated and will be phased out.
- Memory pools for placement control will be re-introduced at a future date.
- Allocation
- Coding conventions
- Developers may use whatever coding conventions they prefer in their working areas, but checked in code must follow these conventions
- Indentation
- Indentation is four spaces which may be represented by four space characters or a tab character with a width of four spaces
- Sub-statements of for, while, if, try, catch, and switch are indented.
- Braces are indented with the code they enclose except at the top level.
- Comments
- Comments will be at the same indentation level as surrounding code.
- Block comments at the top of methods and functions will describe the general purpose and algorithm of the method or function
- Comments within a method or function will occur before the statement(s) they describe.
- If you feel the need to insert a comment inside the condition of a for/while/if/switch statement, reconsider and simplify the condition.
- Braces
- Matching braces are vertically aligned
- Braces are not normally used around single statements, but may be used for clarity
- Blank lines
- For, while, if, try, and switch statements will normally be preceded and followed by blank lines.
- Very simple for and if statements used in inner statement blocks may have blank lines omitted.
- Comments will be preceded and followed by blank lines
- Proposing extensions to Vulcan
- Provide background
- Problem to be solved
- Applicability any known standards
- Solutions used by other products address the problem
- Describe solution
- Syntax and semantics of proposal
- Proposed implementation
- Components affected
- Backward and forward compatibility
- Analyze impact of changes on
- External API
- Provider API
- Wire protocols
- Provide background