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
djm 2021-06-02T06:09:33.182800Z

:waving:

dharrigan 2021-06-02T06:41:02.183Z

Good Morning!

alexlynham 2021-06-02T07:22:37.183200Z

morning

alexlynham 2021-06-02T07:22:43.183400Z

man i hate spec

alexlynham 2021-06-02T07:23:05.183900Z

it's got all the worst parts of a type checker screaming at you and very little of the usefulness

👍 1
Jakob Durstberger 2021-06-02T07:47:22.185400Z

Morning. I have never really tried to use it so far. I played with the basics but haven’t figured out its benefit yet. I don’t use Clojure at my day job though so, that doesn’t account for much.

Jakob Durstberger 2021-06-02T07:50:48.187300Z

Recently I am finding myself in this weird conundrum where I am convinced that technology choices matter less than we attribute to them and simultaneously catch myself cursing at TypeScript every 10 minutes, thinking it would be so much easier in Clojurescript

➕ 1
mccraigmccraig 2021-06-02T08:10:03.187500Z

månmån

thomas 2021-06-02T08:18:58.187700Z

morning

thomas 2021-06-02T08:19:33.188200Z

what are the problems you are running into @alex.lynham?

alexlynham 2021-06-02T08:49:53.188500Z

IME typescript is probably less painful than cljs

alexlynham 2021-06-02T08:50:04.188900Z

but then we did go Full Monad:tm:

Aron 2021-06-02T09:17:38.189100Z

morning

Aron 2021-06-02T09:18:20.190Z

> IME typescript is probably less painful than cljs I switched to cljs because every frontend js job has become a ts job, and I hate that language much more than you can hate spec 😄

Aron 2021-06-02T09:19:13.190900Z

It has all the bells and whistles when you need it the least, and when you really need it, it's useless. And if you want to do something simple, like write types for your event handler wrappers, good luck.

Jakob Durstberger 2021-06-02T10:40:32.191700Z

> It has all the bells and whistles when you need it the least That’s how I feel about it as-well. It has so many things that I don’t need and so little of what I want. It think the stdlib is lacking … very lacking

jiriknesl 2021-06-02T11:17:54.192100Z

Hi folks

alexlynham 2021-06-02T12:21:40.193500Z

fwiw I wasn't doing frontend, I was doing server-side node in it, but I found it pretty good some annoying leaky abstractions ofc and the lang itself is missing a lot of useful stuff, hence fp-ts and whatnot... ATEOTD strongly typed fp was where it seemed to sit best

alexlynham 2021-06-02T12:25:33.196200Z

it's very verbose unforch until you write a lot of your own wrappers but then if you do go the monad route, they help w/that a lot eventually you get some relatively generic code

2021-06-02T14:23:55.198700Z

I’m going to throw the amongst the pigeons and state that I really really enjoying playing with Elm last year. I really enjoy dynamic languages server side, but less so client side due to the unpredictability of the browser environment, and speed of sufficient tests to gain confidence. I only played in a pet project, but I spent about 100 hours coding in Elm, and was shocked to see not a single run time error. However, as a fairly niche toolset, I’m not sure how easy it is to find monad compliant date pickers etc.

2021-06-02T14:26:13.200Z

Saying that, I did find it a headf**k. Doing GraphQL -> clientside objects mappings made me reevaluate my love of software development 😆

Aron 2021-06-02T14:47:20.200700Z

I liked Elm too, I wonder where they are in terms of getting to 1.0

Aron 2021-06-02T14:48:02.200800Z

I wrote a schema in datascript and just loaded the json into it.

2021-06-02T14:57:09.201100Z

I’m not sure.

2021-06-02T14:57:51.201900Z

I did find documentation poor, and support for components etc.

2021-06-02T14:59:06.203100Z

Playing with more strongly typed languages alongside a massive interest in DDD, has really affected how I write C# / Java in my day job. I now wince when I see variables or parameters of string type.

2021-06-02T14:59:28.203600Z

And yet I’m more than happy passing maps around in CLJ.

djm 2021-06-02T15:05:06.203700Z

https://blog.klipse.tech/java/2021/03/05/data-oriented-programming-in-java.html - there’s always this 😁

Conor 2021-06-02T15:08:22.204Z

I thought that blog was very funny (intentionally or not)

2021-06-02T15:08:37.204200Z

Oh, he presented at ClojureX a couple of years ago.

djm 2021-06-02T15:20:43.204500Z

His book with Manning came out recently, I think

Aron 2021-06-02T15:47:21.204700Z

> funny I did data oriented programming in js, which is actually easy, and everyone was shouting at me that that's not how you do it.

seancorfield 2021-06-02T16:01:30.205400Z

We’ve been heavy users of Spec since it first dropped (all server-side). We like it. We’re looking forward to Spec 2.

djm 2021-06-02T16:03:02.205500Z

When I was a Java developer (last month!), I don't think I would have got code like what's in the blog post through code review

Conor 2021-06-02T16:06:03.205700Z

I agree, which is why I found it so funny

2021-06-02T16:22:41.207600Z

Yeah, I recall discussions with some of my colleagues about value objects exposing final privates cuz why not? THOU MUST USE GETTERS!

2021-06-02T16:23:04.208300Z

Fast forward a few years, and records :man-shrugging:

2021-06-02T16:26:13.211700Z

I enjoyed a company hack a few years ago where I explored gaining ‘leverage’ from spec, by using it to drive a conversational ui. Define what a valid request to book a meeting room looks like, and then iterate trying to populate it with data from the UI, and ask spec to list issues, driving the next question in the UI. It was fun.

djm 2021-06-02T16:31:30.211900Z

foo.startDate.setYear(2030) final doesn't help here

djm 2021-06-02T16:34:00.212700Z

Also breaks things that depend on the usual bean conventions, so maybe it's easier just to always use getters?

djm 2021-06-02T16:35:17.213200Z

Or use Records Kotlin Clojure 😉

2021-06-02T16:36:37.214900Z

Yeah, that was the argument, but neither does foo.getStartDate().setYear(2030) without returning a copy of the internal object which is rarely done. But I get your point.

djm 2021-06-02T16:38:13.215200Z

Some static analysis tools complain if you don't return a defensive copy, so at one place I worked we always did

djm 2021-06-02T16:40:58.215400Z

Even Python does better than Java at properties that can either be just a field or a method

Aron 2021-06-02T17:01:11.215600Z

"A defining characteristic of state machines is that you cannot arbitrarily update the state of a state machine. Instead, a state machine defines how its own state is updated when it responds to an input."

Aron 2021-06-02T17:01:19.215800Z

Sounds so nice, no?

Aron 2021-06-02T17:02:29.216Z

Never mind that those 'arbitrary updates' would follow a spec if js had any such thing.

alexlynham 2021-06-02T22:17:03.217200Z

fwiw if you liked elm then purescript might be worth a look. feels like it has a decent community, reasonable interop story and there's a re-frame equivalent that from a very cursory play is Pretty Cool:tm: