This document serves as the official code standards guide for `BinaryObjectScanner` internal development. Please note that this is a work in progress and may not encapsulate all standards expected of new or existing code.
- Methods and classes should use `PascalCase` for naming, even `internal` and `private` ones.
- Class properties should use `PascalCase` for naming, even `protected` and `internal` ones.
- Instance variables should use `camelCase` with a `_` prefix for naming, even `protected`, `internal`, and `private` ones.
- In-method variables should use `camelCase` without a `_` prefix for naming.
- Include explicit access modifiers for all class-level properties, variables, and methods.
- Avoid making everything `public`; only include the necessary level of access.
- Avoid making every method and class instance-based. Use `static` if your method does not need to access instance variables. Use `static` if your class only contains extensions or methods used by other classes.
- Null-coalescing and null-checking operators can be used to make more readable statements and better get across what a statement or string of statements is doing.
-`#region` tags, including nested ones, can be used to both segment methods within a class and statements within a method. Indentation follows the surrounding code.
- Try to avoid including too much duplicate code across methods and classes. If you have duplicate code that spans more than ~5 lines, consider writing a helper method.
- Try to use expressive naming. e.g. use names like `PrintSectionTitles` and not `DoTheThing`.
- Try to avoid having too many parameters in a method signature. More parameters means more things interacting.
- Use method overloading to avoid unnecessary complexity in a single method.
- When using a `switch` statement, if all switch cases are single-expression, they can be written in-line. You can also add newlines between cases for segmentation or clarity.If the expressions are too complex, they should not be.
- When using a `switch` expression, cases that lead to the same value can be combined using `or`. This is not required, especially if readability would be sacrificed.
- All classes and methods should contain a `summary` block at bare minimum to explain the purpose. For methods, it is highly recommended to also include `param` tags for each parameter and a `return` tag if the method returns a value. Do not hesitate to use `remarks` as well to include additional information.
- Comments should be expressive and fully explain what is being described. Try to avoid using slang, "pointed comments" such as "you should" or "we do".
// But here the statements are logically linked but
// needed additional formatting
```
## Project and Class Organization
This section contains information on project and class organization principles that depend on the part of the project you are working in. See the following table for details.
If the project or directory you are looking for is not included in the above, please consider it to be outside the context of this document.
## Code Organization
This section contains information on in-code organization principles that depend on the part of the project you are working in. See the following table for details.
| `ProtectionScan` | New functionality should be added as a combination of a flag with a long and a short form, a new line in the help text, and a new method (if necessary). |