This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-19
Channels
- # announcements (2)
- # beginners (448)
- # calva (10)
- # cider (27)
- # clojure (121)
- # clojure-argentina (2)
- # clojure-brasil (6)
- # clojure-chicago (1)
- # clojure-colombia (9)
- # clojure-ecuador (1)
- # clojure-europe (1)
- # clojure-italy (14)
- # clojure-mexico (1)
- # clojure-nl (19)
- # clojure-spec (11)
- # clojure-uk (160)
- # clojurescript (25)
- # core-async (7)
- # cursive (8)
- # data-science (1)
- # datascript (1)
- # datomic (4)
- # devops (2)
- # graalvm (3)
- # hoplon (1)
- # immutant (1)
- # jackdaw (32)
- # jobs (2)
- # joker (2)
- # keechma (9)
- # leiningen (26)
- # luminus (13)
- # off-topic (2)
- # overtone (2)
- # quil (5)
- # reagent (38)
- # reitit (13)
- # shadow-cljs (16)
- # spacemacs (2)
- # tools-deps (4)
- # xtdb (12)
βοΈ @U899JBRPF?
Lol, thanks @U82DUDVMH, I forgot about that post
Those are older slides, but we will get around to uploading what was presented soon. Hopefully the video will be ready for next week and we will push out a blog with all the links π
Morning
Thanks to the JUXT team for a fascinating evening of bitemporal discovery. And thanks to all at Funding Circle for organising the event.
There is a virtual Clojure data science meetup this Wednesday afternoon. I have enjoyed these very much so far. https://zoom.us/meeting/register/e50c2d960a1ecd1d7510d14dfea9e911
Fun Q: single quotes in identifiers - great idea or horrible abuse of syntax?
(fn f [x]
(fn f' [y]
,,,))
(defn fermat's-last-theorem [a b c n]
(let [** #(Math/pow %1 %2)]
(= (+ (** a n) (** b n)
(+ (** c n)))))
This is all kinds of awful, sorry... To me it shouts out a developer does not understand the purpose of the code they are writing (or are having a bad day and need a hug)
I sometimes use a single quote at the end of a name. clojure.core does too eg +' I've never used a single quote as an apostrophe, nor have I seen it.
@U05254DQM just saw your reply - quite a strong stance. Do you use much currying in your code? I find naming curried functions often to be a bit fiddly/pointless but it is useful to name anonymous functions if only because you get the name in the stack trace if it fails
I think I was referring to the naming of symbols (which is a hard problem I agree) and yes I also agree its useful to name in-line function definitions for debugging, although I tend to refactor in-line functions to defn as soon as they get any sign of complexity.
i've seen that used after the math fashion @djtango , to refer to a derived value. horrid in your second example tho
I concur....
ha - something that is a bit irksome about clojure's stack traces is that if you use function literals, you see a fn-gensym which makes them all the more impenetrable
so fine, name your fn
s in your specs and when using them as higher order functions but if you have a legitimate need to curry something you're left having to think of a name...
I find them hard to read
much less mentally taxing to use f2
f3
rather than f'
f''
I guess f2
f3
is less arcane and leaves the reader less prone to trying to guess what the significance of '
means if they're unfamiliar with the convention
I think its exactly as u say @djtango if you are used to it, its fine. But typically i havent seen it much in clojure.
heh. Under what circumstances is it okay to use non-alphanumerics in a symbol
if its a map, I might name it
(def this->that {:this :that}
so long as that is all that the function does. If it has business logic in the function, then it should be named to represent that logic. If the business logic is in a calling function, then this is correct as of the style guide.
if its the threading sympob in as->
macro I often call it <az->>
to make it bleeedin obvious that this is not a normal variable
otherwise I''d ffavour alphanumberic only
even underscores and hypen are to be treated with suspicion because of how they interop wih json and graphql
I think you can
could be mystifying to a beginner, and presents pitfalls if you were ever to use as->
within a function literal #( ...)
eugh. would you ever do that?
with a clean conscience
I prefer to defer to this if I need to do non-trivial threading: https://github.com/randomcorp/thread-first-thread-last-backwards-question-mark-as-arrow-cond-arrow-bang π
I hope this is a joke library... and you are only kidding about using it...
I saw the video and am relieved you were π
non-trivial threading is usually a sign that your function has grown too large
and needs breaking up
peoply get seduced by "One threading statement"
but you end up with code that is really hard to maintain
I don't find it to be terribly useful
there's quite a hangover that comes when you have to figure out how to safely modify and refactor the code that is already running in production
(and you realise why people bang on about simulation and generative testing)
I've been doing clojure for ages and I'm still a long way away from the change in paradigm to modifying/refactoring code. The talk on speculation was really interesting, in that respect. I'm trying now to aim for accretive change, even when refactoring. Writing new functions function2
rather than changing old functions; adding new keys with clearer meanings rather than changing existing keys...
when I did C# I tended to change the thing at the bottom and then follow the compiler warnings
yeah I tend to do a similar thing in clj
though I hadnβt thought about it until you said thenβ¦
(I suppose with docstrings and names like f-v2
it hopefully becomes clear to new maintainers which thing to use)
It's early days in this approach. Because It's internal, I can remove old functions when they're no longer used anywhere
I think ideally you do one day remove functions unless youβre a library maintainer and cannot
In theory π
our codebase at work quite literally has 3 year old comments saying "delete me in two days time" π
Haha classic
my entire life
In pull request reviews we require TODO be replaced by a Jira ticket number, so at least it is recorded as technical debt in the system.
that's a good idea π
I hope this is a joke library... and you are only kidding about using it...
this is where they introduce it
I think it's more than a joke, it's more like performance art.
Phew... I was a little worried...the video make it clear its a joke π
I have my suspicions there's a kernel of truth in there though
now I am distracted watching the rest of the video... its really funny...
"this is the bread and butter of our codebase"
or the vegan alternative "humous and quinoa of our codebase"
Speaking of great talks, we will be inviting some people to speak at ClojureX so let me know if you have anyone you would like to see - its given that we all would like Rich Hicky π
There was a reddit thread of clojure heroes recently
any of those would be great imo
has the call for proposals gone out already?
Yep, CfP was announced in Mid-April https://skillsmatter.com/conferences/11936-clojure-exchange-2019#get_involved
or in full screen use https://forms.gle/TunyMaMU7UMXR86Q9
nice π
@thomas @yogidevbear @maleghast @agile_geek Are you lot heckling again?
No heckling allowed this year, it's a family show and we have 10 year olds attending (as in chronological age, not iq).... unless your are heckling words of love.... Otherwise please heckle outside of the conf
Sounds like you're heckling those with an iq of 10 years old but are chronologically much older π
@U05254DQM Weβve discussed this before, Iβm 47, not 10 π
In all seriousness, we do have one member of London Clojurians community who is 10 years old cronologically and will be coming to the conference.
I managed to convince Ray McDermot not to swear on stage last year, so the family show is on track. Thanks.
I'm innocent, I swear it
Oh wait, at ClojureX, yeah sure thing π
But just for you β€οΈ
Iβve nothing planned. I could talk about DeskHoppa and thatβs about it. I donβt think anyone is really that interested in Kafka pain which is where most of my time is now.
Saying that Iβve not put a proposal in and declined every other talk invite this year.
@jasonbell - I'll heckle you if you promise to heckle me... π
Ah blockchain heckling @maleghast need proof of heckle.
In pull request reviews we require TODO be replaced by a Jira ticket number, so at least it is recorded as technical debt in the system.
That's a really great idea that I am going to steal, @seancorfield
Sometimes just the pressure of creating a Jira ticket is enough to make the dev go back and fix it properly in the first place π
I usually find that those 'long term' JIRAs get quietly closed by management desperate to > tidy up the board
Doesn't happen here. Management understand "technical debt". We've trained them well π
was verify a clojure project?
wasn't there clojure somewhere in gds?
am I misremembering?
No Clojure at GDS that I am aware of. They did sponsor a ClojureBridge London event though.
I thought someone did a clojurex presentation ~4 years ago about clojure in hmg
kris jenkins or phil potter
ah yes https://skillsmatter.com/skillscasts/6041-clojure-in-the-service-of-her-majesty-s-government
actually perhaps his parting shot from that talk was > we got shut down
Back to the usual channel topic, have you been following Lord of the Rings - the Guinea pig cut? https://twitter.com/jr0cket/status/1141354075281416192?s=19
@U11EL3P9U JUXT is working on a client project that uses protobuf. @U899JBRPF would be able to tell you more about it though. Do you have any particular questions?
I can take a look a bit later and see if any particular libraries jump out at me from that project. Jeremy was more involved with the initial stages on that particular project and had to deal with the more complicated bits of initial setup so would probably be better positioned to make recommendations or point out any particular pain points
Hi π unfortunately I don't think the client has open-sourced that component of their project yet, but I remember them saying they intended to. I haven't studied the code enough to judge it myself but I gather it's a very simple and effective solution vs the other options. I'll ask if they're still interested in open-sourcing it next time I speak to them! (sorry I can't be more helpful...maybe I can get them to chime in directly)
The project I worked on at a certain bank use protobuf for the data the client apps generated and our Clojure system processed. It felt like a bit of a necessary evil (as we didnt have kafka at the time).
In ring handlers , what is it that makes them asynchronous? I don't get the control flow .
@zyxmndaleyjes There are two different arities for handlers. The single arity is synchronous. The multi-arg arity is used for asynchronous behavior, where the handler is passed success/failure functions and calls those when it is done. The actual asynchrony comes from the adapter used to call into the handlers (as I understand it).
@seancorfield cheers, so the success/failure function you mentioned that is fed to the handler runs in a different thread ?
...like I say, I believe it's controlled by the adapters somehow. I've never actually used Ring in async mode.
@zyxmndaleyjes test it out and report back here with your findings please π
My answer to that would be "try it and see!" π