Fork me on GitHub
#clojure-uk
<
2020-06-16
>
dharrigan04:06:36

Good Morning!

djm09:06:39

Hello. I'm learning Clojure, and am in the UK 👋

👋 18
djm10:06:30

Do many of you write Clojure for a living? Or just for fun?

flefik10:06:06

both for me!

flefik10:06:21

sadly, sometimes I have to write golang too

djm10:06:15

I get paid to write (mostly) Java and (some) Kotlin

alexlynham10:06:13

quite a few people do, but most oscillate between clojure and other langs as there aren't that many clojure gigs

dharrigan10:06:17

I write mostly Clojure and Kotlin

rickmoynihan10:06:14

99% clojure for a living

djm10:06:55

Cool. I don't think I'll be able to convince others at my company to start writing in Clojure, but moving some things to Kotlin is nice.

dharrigan11:06:53

I got Clojure introduced by writing several emails to the CEO, CTO, showing the benefits and doing a standalone application all in Clojure, which is processing over 250,000 trips per day.

dharrigan11:06:01

Did a few presentations etc..

folcon11:06:07

Both =)…

folcon11:06:32

Don’t forget clojure is just a java library… As long as people are ok with writing xml to “script” stuff, why not add something else that’s a “smaller” xml…

djm11:06:00

@U0JUM502E we can't use new libraries without approval (in theory), but we do have a tools directory in one main repository, that's basically a free-for-all - there's even some Haskell in there

folcon11:06:45

Could you add something to tools? I’ve heard of people doing similar things =)… You can whip up some pretty nifty tools in clj quickly ;)…

djm11:06:26

Yes, at some point. We have ambitious deadlines at the moment, and some people have been furloughed, so there's not much time for anything like that at the moment

folcon11:06:38

Makes sense =)…

mccraigmccraig11:06:23

99% clojure for a living here...

alexlynham13:06:39

what's the 1% @U0524B4UW ? CQL or Terraform (shudder)

mccraigmccraig13:06:44

no terraform anymore... js, SQL, CQL, java, obj-c, python, ruby probably in that order of frequency, highest first

mccraigmccraig13:06:33

although i had to revise the order once i thought about it a bit

Jakob Durstberger13:06:37

I am just lurking, hoping that one day I might be able to use Clojure on my job :white_frowning_face:

3
seancorfield15:06:46

When we introduced Clojure at work (nearly a decade ago now), there was sort of a three-pronged attack: 1) we had a problematic process that folks had already tried to solve in several different tech: I tried Scala first, when I joined, and although it "worked" it had some limitations (and didn't fit the mindset of the team) so I rewrote it in Clojure and, although it was slower at first, it was more reliable and it better fitted the team's mindset (dynamic language). 2) we rewrote some low-level routines in Clojure to improve their performance and/or their Unicode handling. 3) we started writing some standalone tests in Clojure (replacing some brittle old Selenium tests with more flexible WebDriver-based tests).

seancorfield15:06:52

1) was what really convinced management, once I tuned it a bit (making parts of it concurrent was a breeze with Clojure). 3) was what convinced the team I think. 2) was just icing on the cake -- but it paved the way for a bottom-up rewrite of our entire stack over time.

djm15:06:38

Anything to get rid of Selenium 😂

seancorfield16:06:37

Ironically we replaced the legacy app that was tested that way with several new Clojure apps that are tested in a different way so we no longer have the Clojure-based WebDriver tests either 🙂

seancorfield16:06:36

We broke 100k lines of Clojure this past week (22.5k lines of tests, the rest is production code).

🎉 6
mccraigmccraig16:06:57

you made me go and look @U04V70XH6!

mccraigmccraig16:06:16

gulp: 130kloc + 56kloc tests

seancorfield16:06:35

Impressive percentage of tests! I've had a number of people comment that our test:code ratio seems pretty high at around 1:3 but yours is closer to 1:2!

mccraigmccraig16:06:26

ah, but my way of counting lines of code was very primitive - and tests tend to have a lot of literal data-structures and not so many function points, so they aren't really very dense. probably a better counting metric would return a lower test ratio

mccraigmccraig16:06:11

find . -name \*.clj -o -name \*.cljs -o -name \*.cljc | grep /\*/src/ | xargs cat | grep "^.*\S.*$" | grep -v "^\s*;.*$" | wc

mccraigmccraig16:06:23

and this for tests:

mccraigmccraig16:06:26

find . -name \*.clj -o -name \*.cljs -o -name \*.cljc | grep /\*/test/ | xargs cat | grep "^.*\S.*$" | grep -v "^\s*;.*$" | wc

seancorfield16:06:26

We don't bother to exclude comment lines or whitespace lines. I might think about updating our little shell script for that at some point. We don't tend to have a lot of comment lines (we mostly put that sort of thing in docstrings). If I mentally remove one line for each var and each function, that takes about 4k lines off our total.

mccraigmccraig16:06:19

huh, our 130kloc only grows to 134kloc with comments included, although it's 151kloc with whitespace too

alexlynham07:06:29

there are lots of docstrings in the yapster codebase which probably read as strings rather than comments?

alexlynham07:06:50

I think in my current project we're probably closer to 1:1 code to tests

dharrigan12:06:04

So, I’m puzzled

dharrigan12:06:24

Swimming Pools, this recommendation from the government: Avoid butterfly stroke or other wide strokes when lanes become busy

facepalm 6
dharrigan12:06:53

Also, : Please do not overtake whilst swimming.

alexlynham13:06:12

@dharrigan "boys will be boys"

seancorfield15:06:30

@dharrigan I assume those recommendations are to try to maintain social distancing while in the water...? Seems very, very specific tho'... which suggests that perhaps opening up swimming pools is not yet a good idea?!

dharrigan16:06:04

I find it very bizarre. It feels like it's been written by someone who has never been to a public swimming pool.

dharrigan16:06:31

How does doing butterfly increase your chances of getting covid, apart, from you know, sharing the same water as someone else?

rickmoynihan17:06:34

I’ve no idea — my best guess is if everyone was doing butterfly you’d get less distancing because you take up more width in a lane.

rickmoynihan17:06:23

so the cynic in me says the fact they’re saying this just means they want to cram as many people as possible into the pool. Ignoring the reality that in most public baths a max of 1 person is typically doing butterfly at a time. It just lets them say they’ve implemented regulations that make it safe. In reality it’s just covid theatre.

dharrigan17:06:50

Covid Theatre. Precisamundo.

dharrigan16:06:39

or backstroke, or front crawl etc...

seancorfield16:06:01

More splashing? More gulping of air between strokes? 👀

👍 3
3
dominicm16:06:57

Doggy paddling should be banned too

mccraigmccraig16:06:54

but snorkelling should be encouraged ?

Ben Hammond16:06:00

you might spend more time gasping for air whilst doing butterfly?

Ben Hammond16:06:18

thereby spreading your filthy virions

dharrigan16:06:28

Last time I went to one of our local swimming pools, I ended up with a terrible cold

dharrigan16:06:38

I don’t recall doing butterfly… 🙂

Ben Hammond16:06:48

did anyone else?

dharrigan16:06:59

Have you ever seen the amount of used sticky pasters floating about in the detrius?

dominicm17:06:06

I'm leaving

Ben Hammond17:06:07

maybe they are confusing it with the butterfly effect

dominicm17:06:13

please talk about something else for an extended period

Ben Hammond17:06:16

and thought better-safe-than-sorry

dominicm17:06:24

can't get that image out of my head now

dharrigan17:06:33

naw, butterfly - no-one else

Ben Hammond17:06:37

what have you got against doggy paddle anyway?

Ben Hammond17:06:43

its my favourite

dominicm17:06:52

Just seems alike the breast stroke

Ben Hammond17:06:56

(because it makes breathing uncomplicated)

Ben Hammond17:06:22

ah I do miss swimming