Fork me on GitHub
#clojure-uk
<
2021-06-02
>
dharrigan06:06:02

Good Morning!

alexlynham07:06:43

man i hate spec

alexlynham07:06:05

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

👍 3
Jakob Durstberger07:06:22

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 Durstberger07:06:48

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

3
thomas08:06:33

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

alexlynham08:06:53

IME typescript is probably less painful than cljs

alexlynham08:06:04

but then we did go Full Monad:tm:

Aron09:06:20

> 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 😄

Aron09:06:13

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 Durstberger10:06:32

> 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

alexlynham12:06:40

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

alexlynham12:06:33

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

paulspencerwilliams14:06:55

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.

paulspencerwilliams14:06:13

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

Aron14:06:02

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

Aron14:06:20

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

paulspencerwilliams14:06:51

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

paulspencerwilliams14:06:06

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.

paulspencerwilliams14:06:28

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

Conor15:06:22

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

paulspencerwilliams15:06:37

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

djm15:06:43

His book with Manning came out recently, I think

Aron15:06:21

> 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.

djm16:06:02

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

Conor16:06:03

I agree, which is why I found it so funny

paulspencerwilliams16:06:41

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

paulspencerwilliams16:06:04

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

djm16:06:30

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

djm16:06:00

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

djm16:06:17

Or use Records Kotlin Clojure 😉

paulspencerwilliams16:06:37

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.

djm16:06:13

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

djm16:06:58

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

Aron17:06:11

"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."

Aron17:06:19

Sounds so nice, no?

Aron17:06:29

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

seancorfield16:06:30

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

paulspencerwilliams16:06:13

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.

alexlynham22:06:03

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: