Contents in this wiki are for entertainment purposes only
This is not fiction ∞ this is psience of mind

Vintage VB6 Code Conventions

From Catcliffe Development
Jump to navigation Jump to search


Code Conventions
1. User-Defined Types (UDTs) for Class Internal Properties
Purpose: Enhance encapsulation and maintain a clean, organized structure within classes.
Convention: All internal properties of a class are encapsulated within a UDT. This UDT is private to the class and is named with a 'm' prefix (e.g., Dim m As udtMyClass).
2. Naming Conventions for UDT and Class
Purpose: Ensure consistency in naming, making it easier to understand the relationship between classes and their internal structures.
Convention: The UDT for a class's properties mirrors the class's name. For example, clsMyClass will have a corresponding UDT named udtMyClass.
3. Organization of Class Event Methods
Purpose: Improve readability and logical flow within class modules.
Convention: Event methods are positioned immediately following the declarations section, providing a clear entry point to the class's functionality.
4. Comment Header Block
Purpose: Offer essential information at a glance, including authorship, copyright, and module purpose, while also delineating the conventions followed.
Convention: Each code module begins with a comment header block, crediting "Grimoire" as the author, "XenoEngineer" with copyright under "GPT Prompt Engineering," alongside a brief description of the module's role and the conventions adhered to.
5. Simplified Property Accessors
Purpose: Streamline code for properties that require minimal logic, reducing clutter and enhancing clarity.
Convention: Properties that can be expressed in a single line of code utilize the colon (:) as a line-continuation character, condensing getter and setter logic into a compact form.