Fork me on GitHub
#clojure-uk
<
2018-01-17
>
jonpither06:01:39

@otfrom glad you like. All credit (for most things) goes to @dominicm

guy10:01:36

Morning!

maleghast11:01:41

Good Morning!

maleghast11:01:49

@rickmoynihan - Thanks for your “further thoughts” yesterday - I had stepped away from the machine for the evening, and I’ve been on conference calls this morning, but this ^^ is all very helpful, so thanks 🙂

maleghast11:01:58

@otfrom - Is that the standing desk you were looking into?

maleghast11:01:29

I really__ want one of those…

yogidevbear11:01:42

I think we all do 😉

maleghast11:01:46

You also now recommend?

maleghast16:01:29

I just got the email about Datomic Cloud from Cognitect - anyone else had a look..? Thoughts..?

dominicm18:01:53

It looked really good to me. I'd like to switch to using itit.

bronsa16:01:10

it was announced at the conj so not a big news, but awesome to finally see it available

maleghast16:01:20

@bronsa - Oops! I missed the announcement; got all excited that this was new news! Oh well… That aside, looking at the blogpost about it and the other info it looks very cool / good for new apps just starting out with a need for Datomic. I am trying to find a cost comparison…

maleghast16:01:40

Gosh, it’s very affordable too…

maleghast16:01:06

@bronsa - Thanks, I will give that a watch…

rickmoynihan17:01:51

I have no idea how to use that calculator

yogidevbear23:01:33

Curiosity getting the better of me... How often do you find yourselves using defmulti and defmethod?

seancorfield23:01:13

We have 13 defmulti in 9 files -- in a codebase of around 75,000 lines.

seancorfield23:01:49

And 19 defprotocol in 10 files.

yogidevbear23:01:23

Safe to say it's not a very common thing compared to other code in the language then?

yogidevbear23:01:48

I've seen it used in a coupe of libraries, but rather far and few between

yogidevbear23:01:27

@seancorfield Would you say there are clear clues as to when you would want to use defmulti?

seancorfield23:01:36

(and 144 defmethod in 11 files, just for completeness)

yogidevbear23:01:11

Is the main purpose for hierarchical stuff?

seancorfield23:01:20

I think it depends on the domain... we don't have all that many things that are inherently polymorphic.

seancorfield23:01:26

Some of our search code uses it (polymorphic on the "type" of search -- we have about six different "shapes" of search), a little bit of our payment logic (polymorphic on the payment provider), some email event handling (polymorphic on the event -- delivered, bounced, etc).

seancorfield23:01:43

I think if we were rewriting some of our core member handling logic, we'd make that polymorphic on the "category" of member (we have roughly three categories but mostly only distinguish between two of those).

yogidevbear23:01:42

Cool, thanks for the explanation 🙂

mccraigmccraig23:01:09

27 defmultis, weirdly also 144 defmethods, and 126 defprotocols in 100kloc here @yogidevbear

mccraigmccraig23:01:56

we use defmulti a bit in the re-frame UI but the main use that springs to mind is in our message routing - different aspects of the routing get defmethods and particular message types combine those aspects

yogidevbear23:01:44

Awesome, thanks for the extra feedback 🙂

seancorfield23:01:55

I think part of this is that Clojure is inherently a lot more generic so the heavy polymorphism you see in Java et al just isn't necessary... the old Perlis quote comes to mind...