def is better in traits (vals can override defs) because vals have issues with initialization order (they can call NPE in some cases of initialization of inheritance accessing the val in the subclass constructor).