Marko Novakovic02/22/2023, 5:37 PM
Bryan Buschmann02/22/2023, 8:08 PM
efemoney02/22/2023, 8:21 PM
todd.ginsberg02/22/2023, 8:32 PM
Type-safety is coupling.I’d word that as “Type-safety is explicit coupling” whereas “Non-type-safe is implicit coupling. The coupling is there either way.
Hanno02/22/2023, 8:33 PM
Marko Novakovic02/22/2023, 10:08 PM
Why isn’t CarFactory a below the line implementation detail?than it would be in same module as the implementation and the derivatives. that breaks independent deployability. right?
Bryan Buschmann02/22/2023, 10:10 PM
Marko Novakovic02/22/2023, 10:11 PM
Bryan Buschmann02/22/2023, 10:12 PM
Marko Novakovic02/22/2023, 10:16 PM
Hope you appreciate honest feedbackof course, thank you.
What you call coupling is semantic coupling that wont magically disappear only because you remove the typesas I said above, there absolutely has to be coupling. you are using something, that’s coupling. types just add another layer to it that doesn’t exist in type-unsafe languages. this was tailored example to showcase that exact thing. this is not particularly good factory implementation, it’s rather oversimplified and bad, but it conveys the point. it’s too simple so problem is spotted easily. point is still there regardless of better ways to implement it.
Hopefully i am Not completely off track and Not getting what your points are.explained above. you are not wrong but you kind of missed the point. the thing with unit tests and TDD is that they provide safety, you can write unit tests that make sure that correct
, in this case, is passed to the factory. they will not prevent you from creating non existing implementation but you can’t create non existing implementation with types either. difference is that with
it will crash on runtime and with type-safe approach it will not compile. unit tests can have same function as compiler in this case
Bryan Buschmann02/22/2023, 10:27 PM
Marko Novakovic02/22/2023, 11:12 PM
Also, why would you knowingly ship broken code?who said it’s broken? why is it broken? what I said that mentions shipping broken code
Bryan Buschmann02/22/2023, 11:31 PM
Damien O'Hara02/23/2023, 5:38 AM