---
# System prepended metadata

title: Guiding Principles
tags: [Required-Components]

---

# Guiding Principles

## Adopted

## Proposed

### Prefer Default Component Values 

Overriding a Required Component's constructor has implications (it creates the potential for clashes / constructors overwriting each other). Whenever possible, we should use default constructors.

### No "implied default values"

For example, `BackgroundColor` _could_ be "optional" (not required) for a UI `Node`, in that we could internally detect `Option<BackgroundColor>` and default to `BackgroundColor(Color::NONE)` when it is missing. I think we should discourage this pattern (aka `Node` should require `BackgroundColor`).

1. It makes it harder to reason about what those are, as they often don't live in / near the struct, but rather in a system somewhere
    - This also makes it possible to have different implied default values, as each system can choose how to interpret it
2. It forces archetype moves when changing to a non-default value
3. It makes it hard to query for things (ex: give me everything with a transparent background) because now you need to check both Option<BackgroundColor> and BackgroundColor(Color::NONE), and it means you need to know to do both.
4. It makes it harder to discover functionality, as the "optional" component is now floating / decoupled
    

