logoalt Hacker News

mrkeentoday at 12:15 PM0 repliesview on HN

I lean on types heavily as my vehicle for change.

My UserService doesn't know that it's talking to a UserDB (ironically I learned this from Uncle Bob).

All UserService knows is it has a dependency which, if passed a UserId, will return a User (+/- whatever the failure mode is .. Future<User>? Promise<User>? ReaderT m User?)

When I change my mind about what UserService requires or what UserDB provides (which I frequently do), I immediately look at all the red underlines that my compiler & static types tell me about.