clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
dharrigan 2020-10-19T06:05:26.191100Z

Good Morning!

djm 2020-10-19T06:40:06.191600Z

👋

dominicm 2020-10-19T07:14:59.191800Z

Morning

dharrigan 2020-10-19T07:19:35.192400Z

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

dharrigan 2020-10-19T07:19:44.192700Z

I don't subscribe to anything else

djm 2020-10-19T07:22:55.193200Z

I thought only Trump used twitter to make political announcements

alexlynham 2020-10-19T07:23:09.193300Z

morning

mccraigmccraig 2020-10-19T07:34:53.193500Z

mÄnmÄn

codeasone 2020-10-19T07:36:56.193700Z

Morning

thomas 2020-10-19T09:12:44.193900Z

morning

dharrigan 2020-10-19T11:58:43.194200Z

I was reading (and experimenting) with Protocols last night

dharrigan 2020-10-19T11:59:08.194800Z

I love the way you can extend a protocol to an existing datatype and thus add new functionality.

2020-10-19T11:59:48.195100Z

that always seemed a bit underhanded to me

2020-10-19T12:00:02.195400Z

you don't know where you are

2020-10-19T12:00:31.196Z

things that you used to rely on have been changed underneath your feat

2020-10-19T12:00:59.196500Z

it can upset the principle-of-least-surprise

dharrigan 2020-10-19T12:01:19.196900Z

Sure, I can see that. With great power comes great responsibility 😉

dharrigan 2020-10-19T12:01:23.197100Z

or summat like that 🙂

dharrigan 2020-10-19T12:01:43.197600Z

Right now, I don't have a use-case in my applications (I'm getting along very nicely with multimethods)

2020-10-19T12:02:24.198600Z

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

2020-10-19T12:03:19.199300Z

Protocols are a hacky way to play along with Java Interfaces :troll:

dharrigan 2020-10-19T12:04:06.199800Z

I compare them to extension functions in Kotlin

dharrigan 2020-10-19T12:04:23.200300Z

one can extend an existing datatype in Kotlin similiarly.

2020-10-19T12:04:52.200900Z

all very nefarious

2020-10-19T12:05:29.201500Z

but with an intriguing Type Descriptor, certainly

dharrigan 2020-10-19T12:06:25.202100Z

i.e., fun String.spiderMan() => "Don't you mean with great responsibility comes great power?"

dharrigan 2020-10-19T12:06:40.202500Z

"foo bar".spiderMan()

alexlynham 2020-10-19T12:09:57.202600Z

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

alexlynham 2020-10-19T12:10:05.202700Z

nevertheless i prefer multimethods

dharrigan 2020-10-19T12:11:59.203200Z

I think I recall somewhere a diagram about when to use maps, switch to protocols, records etc...

dharrigan 2020-10-19T12:12:08.203400Z

anyone remember the diagram?

dharrigan 2020-10-19T12:13:41.204400Z

that's the one!

dharrigan 2020-10-19T12:13:43.204600Z

ta

minimal 2020-10-19T12:14:11.205100Z

9 years old already

2020-10-19T12:37:13.210200Z

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.

2020-10-19T12:43:07.212Z

Not saying you shouldn’t prefer other things to them though; just that they occupy a useful point in a spectrum of options

💯 1
2020-10-19T15:40:44.213200Z

who is using Clojure in Glasgow at the moment? I know http://previ.se are

2020-10-20T07:41:06.218500Z

Arnold Clark certainly did use it quite a lot, though I think they may have moved away from it now

alexlynham 2020-10-19T15:41:41.213300Z

there was some thoughtworks stuff at some point i think?

2020-10-19T15:42:26.213700Z

yeah they're doing Student Loans Co IIRC

Adrian Smith 2020-10-19T16:06:18.213900Z

https://www.elcom.com/ I think

👍 1
2020-10-19T16:10:29.214100Z

oooh I've not heard of them

mccraigmccraig 2020-10-19T16:18:27.214600Z

@maleghast isn't too far from glasgow iirc

2020-10-19T16:20:11.215900Z

well thats an interesting one; although he is in the Trossachs, his office is firmly in London (last I heard)

2020-10-19T16:20:25.216300Z

well, noone is really in london just at the moment I suppose