-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Practices
Root Order:
- x:Name, x:Class
- All references, maximum 2 per line
- Design properties (Ex. mc:Ignorable="d" d:DesignWidth="230" Foreground="Blue")
- ViewModelLocator?
- Bindings
Rules:
-Wrap lines when they pass more the longest reference line
Controls order:
- x:Name
- Design properties
- Bindings
The FoundOps code structure is broken into these sections
Code Structure
1-2 of something: use //
3 or more of something: use #region
All comments should start capitalized and use proper punctuation.
Class Structure:
//Summary
Properties & Variables
-Public
-Protected
-Locals
Constructors (least parameters => most parameters)
Logic(Always in a region)
Example property:
//Summary
private int _num
public int Num
{
get{...}
set{...}
}
Logic Code Organization
- Code Execution
- Alphabetically
Example code execution section:
Section explanation
1st called method
2nd method called
{
inner method A
inner method B
}
Using Statements
Try to keep in order of shortest to longest
Ex.
c# .Select(_ => true)
Confusing seconds and milliseconds when using RX TimeSpan.
Ex. TimeSpan(0,0,2) is 2 seconds and TimeSpan(0, 0, 0, 0, 300) is 300 milliseconds.
See [http://msdn.microsoft.com/en-us/library/system.timespan.aspx](this link) for more information.