4 ms·
Haskell: favor composition over configuration over convention.
by alipang 13y ago
Haskell: favor composition over configuration over convention.
- kaonashi 13y agoIt works well for JS, too. Favor function composition & higher order functions for code reuse over complicated prototype hierarchies.
- platz 13y agofunction composition in js can be tricky to visually parse the "types" (especially if curried).
- kaonashi 13y agoIt depends on the return value, yes. I usually try to keep modules small and use some kind of threading (needle + thread analogy, not os threads/web workers) strategy when building functions -- pulling out common patterns into globally visible utility functions that work with common types (e.g. jQuery events/objects). It's not ideal, but in the absence of a true type system, it's all about mitigating potential problem areas.