trait Foo { val x = 1 }
object FooObj extends Foo
So pointless and unnecessary. And before anyone says this is just planning for the future, the future can go fuck itself.
trait Foo { val x = 1 }
object FooObj extends Foo
So pointless and unnecessary. And before anyone says this is just planning for the future, the future can go fuck itself.
1. Testing. The trait makes it easier to mock a dependency. In this case the second implementation is in the testing codebase.
2. Quick overview and contract.
If you have a `trait DoThing { def firstThis() def thenThis() }` it very clearly shows what the trait is meant to do with what contract, even if the actual implementation is 500 LOC with 15 private methods.
I don't think there's any better way to write large projects.
Instead consider loosely coupled smaller projects.
Perhaps this only moves the complexity elsewhere and you have a dependency hell, but arguably the same can be said for versioning parts of code.