-
Notifications
You must be signed in to change notification settings - Fork 15
Coding Style
Our coding style generally follows the Microsoft guidelines:
https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/
https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/classes-and-objects
https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/types-and-variables
Although, to guarantee a high level of clarity and transparency, we also follow some additional rules.
- A
.csfile can contain only 1 (one)class, and there is no concept as aHelperorUtilsclass. - The name of the
.csfile is the Name (excluding the namespace) of the class, e.g. theLineclass is in theLine.csfile - For methods, a file can only contain methods whose name is the same as their file, e.g.
Flip(Line line)andFlip(Arc arc)are in the same fileFlip.cs. As a corollary,RandomFlipcannot lie in theFlip.csfile, and must have aRandomFlip.csfile by its own.
Namespaces and the folder structure that contains the .cs files have a close relationship. To define the correct folder structure helps keeping the relationship with the namespaces. This, in turn enables additional functionalities, such as deriving the web address of the source code of a method.
For a class, an Attribute, and Enum, an Interface, the folder structure respects the following rules:
-
If a file is in a sub folder, the namespace of the entity must follow: if
Baris in a sub folderElements, its namespace must suffix theElementswordBH.oM.Structure.Elements. -
An
Enummust be in a separate folderEnums. Although, the namespace remains unchanged. For exampleBarFEATypeis in the sub folderElements, and it is an enum. Its namespace respects A., so it contains theElementsword, but does not contain theEnumword: BH.oM.Structure.Elements. Although, since it is anEnumit is in anEnumsfolder. -
The same rule as B. applies to:
-
Attribute=>Attributes -
interface=>Interfaces
-
-
Introduction to the BHoM:
What is the BHoM for?
Structure of the BHoM
Technical Philosophy of the BHoM -
Getting Started:
Installing the BHoM
Using the BHoM
Submitting an Issue
Getting started for developers -
Use GitHub & Visual Studio:
Using the SCRUM Board
Resolving an Issue
Avoiding Conflicts
Creating a new Repository
Using Visual Studio
Using Visual Studio Code -
Contribute:
The oM
The Engine
The Adapter
The Toolkit
The UI
The Tests -
Guidelines:
Unit convention
Geometry
BHoM_Engine Classes
The IImmutable Interface
Handling Exceptional Events
BHoM Structural Conventions
BHoM View Quality Conventions
Code Versioning
Wiki Style
Coding Style
Null Handling
Code Attributes
Creating Icons
Changelog
Releases and Versioning
Open Sourcing Procedure
Dataset guidelines -
Foundational Interfaces:
IElement Required Extension Methods -
Continuous Integration:
Introduction
Check-PR-Builds
Check-Core
Check-Installer -
Code Compliance:
Compliance -
Further Reading:
FAQ
Structural Adapters
Mongo_Toolkit
Socket_Toolkit