@davefarley77 YES!
We don't write test just to have tests.
We write tests to keep reshaping the system safely, to change its structure without affecting its existing behavior.
Refactoring is the real goal, tests enable refactoring.
@MatManferdini Back in the old days, everything lived in the view controller. It was hard to maintain, not testable, but that's what we did. Now, everything lives in SwiftUI views. It's similar, just nicer. VM-ish shape tends to emerge naturally when you want automated testing.
@corneliusmark@MatManferdini Sometimes it's hard to see that UIKit (or SwiftUI) is an ~external~ uncontrolled dependency, you can't change it if you want to. We're just using it, not designing it. With that in mind, is better to treat it as legacy code (because it has no tests).
@MatManferdini Yes! Beyond the power of the tool, the real impact (and a bit of the hype), what really matters is the training. We have almost free access to trained models, but not to train them. I recall Tesla training vision—they even built their own "IDE" for it.
@MatManferdini@Dimillian A real project isn’t where you practice DI, testing, or architecture. You should’ve figured that out before. Businesses pay for execution, not for coding experiments and practicing.
@tottinge Fastest feedback is the key. It's also interesting to run these REPL-based cycles inside a test, once it's stable, add the assertions and leave the test to know if something breaks. That test can be deleted if becomes irrelevant.
@twannl When the error is thrown (to try/catch) it has no type. I prefer not to lose the error type. The tuple of two optionals is the worst of the options by sure.
@mecid The view model should access domain objects (product) and expose the visible things (formatted text) so the view renders them. I’d put formatting in the vm and move it to a vm’s collaborator if needed (repeated/similar formatting needs). But that’s an implementation detail.