-
Notifications
You must be signed in to change notification settings - Fork 0
Coding Practices
apohl1111 edited this page Oct 21, 2011
·
20 revisions
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
Implementation
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