logoalt Hacker News

mont_tag01/21/20250 repliesview on HN

Better to think of LSP as more of a gray scale than all or nothing. The more the APIs match, the more substitutability you gain.

Switching to composition has its advantages but you do lose all substitutability and often need to write forwarding methods that have to be kept in sync as the code evolves over time.