Introduction
Traits let us define shared behavior that different types can use. They help write flexible and reusable code.
When you want different types to do the same action in their own way.
When you want to write functions that work with many types that share some behavior.
When you want to organize code by grouping related actions together.
When you want to add new behavior to types without changing their original code.