2 ms·
Reusability and NIH
- ColinWright 14y agoThis is an alternative viewpoint to that in the article here: http://news.ycombinator.com/item?id=4360345 http://news.ycombinator.com/item?id=4360345 In that article it is suggested that it's better not to call out to the operating system to perform tasks that can be re-implemented in your own program, thereby reducing dependencies and preventing context-switches in future readers. But sometimes using well-known, well-tested, long-standing existing code really is better than re-implementing basic operations in your own code. Yes, if it's just "rm" then perhaps write it yourself. But when it's more substantial, and someone else has already done it, and it's there ready to be used ... Use it.
- EvilTerran 14y agoMy go-to example these days is the `find` utility. Sure, you could try to recurse through directories yourself -- but links (both sym- and hard) make it surprisingly non-trivial to get right.