2 ms·
When the implementation detail involves whether or not the function will perform I/O, it is better to let that leak. Excessive hiding of implementation detail
by kccqzy 3y ago
When the implementation detail involves whether or not the function will perform I/O, it is better to let that leak.
Excessive hiding of implementation detail is what leads to things like fetching a collection of user IDs from a database and then fetching each user from an ID separately (the 1+N problem). Excessive hiding of implementation detail is what leads to accidental O(N^2) algorithms. Excessive hiding of implementation detail is what leads to most performance problems.
- pkolaczk 3y ago> When the implementation detail involves whether or not the function will perform I/O, it is better to let that leak. I guess Haskell is fully based around that idea :)
- gpderetta 3y agoBut async does not help with that. As shown elsethread, in most languages you can block from async functions just fine.