Growing a Framework, Or, Clojure Made Easy
&gt; Also, “complect” means “make more complex.”<p>If you define complex the way Rich does, then I guess it does, but more generally, <i>complect</i> means <i>intertwine</i> and <i>decomplect</i> therefore means something like <i>tease apart</i> (ie tease different concerns apart), which is how the word is used in the Clojure community.<p>&gt; The latter point is why we don’t like frameworks.<p>That... is not why I don&#x27;t like frameworks. Libraries also <i>don&#x27;t handle all use cases</i> and, in fact, I would say that libraries (just because they are smaller) are even less likely to handle all frameworks, which is why I think the former (that frameworks tend to be <i>&quot;don&#x27;t call me, I&#x27;ll call you&quot;</i>) is actually the important point, not that they don&#x27;t handle all use cases.<p>The reason I think this is because if you are calling a library, its just a bunch of functions that do stuff for you: if it doesn&#x27;t cover that one edge case, you can write a new function that does or call a different library. Its just functions. With a framework, there&#x27;s typically more structure to how things interact and are connected, because if the framework calls <i>you</i> instead of you calling it, then you need to play by its rules so that your code fits the connectors provided to you by the framework. For this reason, when a framework doesn&#x27;t cover your edge case, it can be much harder to implement said edge case while still making it fit the frameworks expected shape.<p>Its not that the framework is missing something you want -- nothing ever has everything you might need, not even libraries. Its that a framework expects a rigid structure so that it can call your code generically that makes it harder to implement the missing pieces yourself or use a third party bit of code that does.<p>&gt; What’s really going on here is that frameworks are more likely to be complected.<p>Yes, different aspects of the frameworks concerns are intertwined. This makes it harder to insert your edge case logic. Libraries tend to be independent and you can add your logic without worrying too much about unrelated concerns.<p>&gt; that feels like a framework<p>I&#x27;ve heard people say this exact same thing and I feel like it misses the point (its cargo culting). Its the same as how some people say not to do a thing because its OO and Clojure doesn&#x27;t like OO: that&#x27;s not true, Clojure fully supports the different bits of OO and encourages you to use them <i>when it makes sense</i>, it just discourages you use them just because OO. Framework-like things are fine for many things, what the Clojure community doesn&#x27;t like is complecting things unnecessarily which frameworks often do. If something <i>feels like a framework</i> but isn&#x27;t really complecting different concerns, then there&#x27;s no issue in my opinion.<p>&gt; Frameworks can be good if they’re both simple and easy.<p>Yes.<p>&gt; So how do you make big building blocks that stay simple?<p>I&#x27;ve been wanting to make a &quot;framework&quot; that&#x27;s basically a collection of libraries with some adapter libraries and patterns to make them work together, but with nothing stopping you from swapping them out with others (assuming you write some thin adapter). Anything similar I&#x27;ve seen in the past always relied on code generation to tie libraries together, which I never liked. I&#x27;d rather have more small libraries that provide adapters and tie stuff together. Its still a somewhat unformed idea though, so maybe in reality it doesn&#x27;t work.<p>&gt; it makes my applications much more layered<p>While I do like the top-level logic to be small and easy to understand, I don&#x27;t actually like too many layers. That is, the flatter the hierarchy is, the easier it is to replace things. If things are nested, its often hard to replace layers in the middle (because they need to &quot;fit&quot; on both the caller and callee side) but if they are flat (communicating through, for example, core.async channels) then there&#x27;s a limited surface area where components touch each other, and, other components can often keep running. There used to be a great article on flat vs stacked hierarchies on my.opera.com but sadly there doesn&#x27;t seem to be any wayback machine entries for it :(