There are a lot of strategies to deal with the coupling of reuse. I find that using pure functions makes it easy to split off responsibilities after the fact and add multiple entry points (the hard thing becomes naming those functions). Eventually a new 'essence' of the abstraction will show itself and inspire a larger refactor. That's something I really miss when doing java.
Also, I feel that the reusable clojure code is always doing more work than corresponding java code, so my frustration in refactoring is much greater with java and its IDEs. The refactorings are always superficial compared to what I'm trying to express, and in clojure I can work with data contracts easily. I often end up writing a new version of the reusable abstraction, writing adapters (just data transformations) from the old to the new, then gutting the old implementation, then hopefully gutting the adapters over time. Clojure's data focus makes this easy. On Fri, Oct 2, 2015 at 11:31 AM Colin Yates <colin.ya...@gmail.com> wrote: > It might just be me, but I also find the cost of the explicit coupling > that is re-use is often far more expensive than any saving offered by > re-use of a bunch of text. I also find this _more_ expensive in Clojure > than Java as refactoring in Java was pretty robust (IntelliJ is incredibly > powerful for this). > > On 2 Oct 2015, at 16:25, William la Forge <laforg...@gmail.com> wrote: > > Refactoring for reuse is a kind of early optimization? Agreed! Generally > for me it waits until the second or third rewrite, as by then I have a bit > of an idea about where I am headed with the code. > > OTOH, I finally realized that when I don't know where I am going with > something, keeping the logic in functions instead of methods is probably > safest. I'm thinking now that methods should mostly just be used for their > polymorphism as just a very thin layer over a set of interfaces. > > I was so impressed with the advantages of Java over C++ when I started > using it 20 years ago. But now that I've been exposed to Clojure, I'm > inclined to minimize my use of OO and use objects mostly as what I used > before OO: dispatch tables! > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.