Re:Ask HN: What are the best programming tricks you know?
by assbuttbuttass on Monday July 25, 2022 @09:41AM
(#32224121)
A simple example might be a function that makes an HTTP request to a server. You could separate out a function that builds the request from a function that sends the request to the server. Then it's easy to unit test that the request is what you expect, without coding up a realistic fake for the server.
[ Parent
| on HN ]
There are no comments on this comment yet.