The Yii project aims to build and support practical and helpful tools and community.
The values we express in our work support the goal. We try to
- Be practical
- Be helpful
Performance is a necessary condition of practicality. Software shouldn't waste machine resources or human resources.
We prefer sensible defaults and conventions that users can customize. We seek a balance between flexibility, discipline and simplicity that meets common needs.
We prefer practice to theory. For example:
- Solutions for known use cases should avoid excess complexity by providing only needed flexibility.
- Standard implementations should take practical use into account.
- Experience is at least as useful as theory in guiding design.
- Context is critical in determining appropriateness.
This value guides technical decisions as well as community activity. Consideration of how software features help users should guide development. Community-wise, we value any helpful contribution, be it a pull request or an answer in the forum.
When the other principles could conflict, we choose a solution that's more helpful to the community.
Solutions should be simple and expressive:
- We use as much complexity as needed and no more.
- We avoid ugly solutions unless there is no alternative.
- Fewer rules are better than more rules.
We prefer explicit, obvious solutions and code. Solutions should clearly express exactly what they do. For example:
- A straightforward solution is better than an abstract one unless the abstraction has practical purpose.
- Loud fails are better than silent fails or masking errors.
- Explicit casts are better than PHP type juggling, type hints are good.
- No magic unless necessary.
We try to be consistent in:
- Code style
- Naming
- Design
- Structure
- Values and goals