- You still know your code when 10 years after you come back and look at it.
- You know exactly where to change the stuff
- Common sense (clear when judging the signature itself)
- Brief (don't put createNewNode, put create Node)
- General e.g.
- Separate specific from general (hiearchical relationship)
- Separate task like UI and logic
- Use precise name, not first name in your mind like if it is a start number used startNumber, don't use counter
- Remove redundant node like createNewNode->createNode
- Code one function by one function, other leave as stuff and code later
- Make the correct architecture when start coding, so any additional task you can add later
The
objective of everything is memoriless:
Method Signature is important
Not so
good
private string getNewName(string prefix,
string suffix, List<TreeNode> trs, int startNumber)
Good
private string getNewName(string prefix,
string suffix, List<string>
usedName, int startNumber)
Organization is important, separate when necessary
Naming
Coding
No comments:
Post a Comment