Fork me on GitHub

Good Morning!


man i hate spec


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


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


IME typescript is probably less painful than cljs


but then we did go Full Monad:tm:


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


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


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


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


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.


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


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


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


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


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.


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


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


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


His book with Manning came out recently, I think


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


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


I agree, which is why I found it so funny


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


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


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


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


Or use Records Kotlin Clojure 😉


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.


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


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


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


Sounds so nice, no?


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


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


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.


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: