Hacker News new | past | comments | ask | show | jobs | submit login

A large application has lots of implementation leak to the API, doesn't it?



For this reason, when mocks are involved (that is, just about any external API), I think Listing 2 is the ideal - extract a small function designed around the desired interface, a facade that's easily mockable and won't change with the library implementation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: