Good Morning!
đ
Morning
I only use Twitter to follow tech stuff such as library releases (although I also use github watches for that too) and technology content makers, like some interesting blogs
I don't subscribe to anything else
I thought only Trump used twitter to make political announcements
morning
mÄnmÄn
Morning
morning
I was reading (and experimenting) with Protocols last night
I love the way you can extend a protocol to an existing datatype and thus add new functionality.
that always seemed a bit underhanded to me
you don't know where you are
things that you used to rely on have been changed underneath your feat
it can upset the principle-of-least-surprise
Sure, I can see that. With great power comes great responsibility đ
or summat like that đ
Right now, I don't have a use-case in my applications (I'm getting along very nicely with multimethods)
I prefer that t'other way round > With great responsibility > comes great power I like to tell myself that when people blame me for things
Protocols are a hacky way to play along with Java Interfaces :troll:
I compare them to extension functions in Kotlin
one can extend an existing datatype in Kotlin similiarly.
all very nefarious
but with an intriguing Type Descriptor, certainly
i.e., fun String.spiderMan() => "Don't you mean with great responsibility comes great power?"
"foo bar".spiderMan()
i'm super wary of Protocols personally... but i think the pain i associate with them is as much because they tend to be at a boundary of java interop and the real pain is java, not the protocols themselves
nevertheless i prefer multimethods
I think I recall somewhere a diagram about when to use maps, switch to protocols, records etc...
anyone remember the diagram?
https://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/
that's the one!
ta
9 years old already
Nothing wrong with protocols in my book; open for extension polymorphism is very useful. Extending a protocol to a new type shouldnât normally break anything as itâs normally an accretiative change. Providing you follow the rules around protocol extension of course, and either own the protocol or the type. The only difficulty with them Iâve ever had with them, is the common one where youâre at a REPL, and you reload the type or the protocol definition; and you find things donât dispatch properly anymore because youâve got a stale value using the old type.
Not saying you shouldnât prefer other things to them though; just that they occupy a useful point in a spectrum of options
who is using Clojure in Glasgow at the moment? I know http://previ.se are
Arnold Clark certainly did use it quite a lot, though I think they may have moved away from it now
there was some thoughtworks stuff at some point i think?
yeah they're doing Student Loans Co IIRC
https://www.elcom.com/ I think
oooh I've not heard of them
@maleghast isn't too far from glasgow iirc
well thats an interesting one; although he is in the Trossachs, his office is firmly in London (last I heard)
well, noone is really in london just at the moment I suppose