3 ms·
Without a strongly inferred type system, all of the things you’re describing around “changing everything to change one thing” are just as much a problem. In a
by theobr 5y ago
Without a strongly inferred type system, all of the things you’re describing around “changing everything to change one thing” are just as much a problem.
In a well typed system, you can choose how deep you want your changes to go.
Let’s say you choose to rename a field in db, I.e. “imageUrl” -> “profilePicURL”. Upon making this change, you will receive type errors on the client consuming it.
At this point, you can make a choice. You can go address all the furthest end consumers, which is what you imply is necessary here. You can just as easily re-shape the data being returned though.
return { …user, imageUrl: user.profilePicUrl }
I firmly believe we’re nearing the “best of both worlds” here :)