- Classes consistently organized are easier to read and understand
- Fields should be private
- Consistent internal state is preferable to passing around invalid objects that can communicate they are invalid (immutability vs IDataErrorInfo)
This layout is my hypothesis of what a good consistent layout would be:
- private fields
- constructor(s)
- Initializers and wiring
- for example event wiring
- non-public properties
- public operations
- public properties
- explicit event plumbing
- For example designer auto-generated event handlers
- Other plumbing or utilities
As with any theory or concept, the main ways to learn from it are
- to communicate it out for feedback
- other people's viewpoints can help you find your blind spots
- you can become aware of situations where the idea or solution doesn't fit and why
- apply it
- look at it with a critical eye for places or reasons that it works well and places it doesn't
- keep an open mind that one size does not fit all
- solicit feedback for applications of the idea
- other people can better see past your blind spots
- explaining it helps keep or find perspective
- any critical thinking or discussion is likely to be beneficial to all involved parties
No comments:
Post a Comment