Skip to content

Living Inside Your Own Black Box

prog21.dadgum.com
18 pointskhingebjerg2 comments
On HN

Comments

Treating your program as a black box with set of inputs and outputs to avoid library reliance is useful. As mentioned, it increases portability, eases maintenance and future revision. One downside however might be not taking full advantage of library implementation details for performance concerns. Anyway, this sounds like a case for building for interfaces or abstractions, and the same arguments apply. I would agree though that this is a good approach to take in general.

I tried doing this when learning Haskell, to minimize any connection to monads. For whatever reason, 'twasn't easy.

Then I tried it with Clojure, even though I don't have to, and it seemed a lot simpler. Just pass a map around with all the data in it, or whatever.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.