Fork me on GitHub
#clojure-europe
<
2021-04-28
>
djm06:04:10

I'm not the first person to use that in this channel, iirc

pez10:04:48

Good morning!

otfrom10:04:28

I've been thinking more about this and now feel guilty every time I write a function that tweaks a map rather than calling update with a function that just works on the value https://clojurians.slack.com/archives/CBJ5CGE0G/p1619255965278400

otfrom10:04:41

and also thinking how it relates to clojure.spec

borkdude10:04:45

what is the difference between tweaking a map and calling update(-in)?

slipset10:04:56

To me, I guess the difference is what you make top-level

(defn whatever-foo [my-map]
  (update my-map :foo #(...does whatever...)))
vs
(defn whatever [foo]
  ... does whatever...)
I guess it’s in the same vein as https://stuartsierra.com/2015/08/10/clojure-donts-redundant-map

slipset10:04:44

So the latter fn, can do whatever to a foo regardless of wether the foo resides in a map or not (and under which key the foo might be stored.

otfrom12:04:06

@slipset that is what I mean

otfrom12:04:11

I think my only annoyance is that having a function that works on a map does encode knowledge about the structure in the function and this does matter when I'm working on two fields at once (tho maybe that is the right time for a bit of coupling as it relies on the structure of the map to make sense in the domain)

borkdude12:04:26

@slipset are you talking us into "data hiding"

otfrom12:04:37

I think the opposite

👍 2
slipset12:04:11

Let the foos be free!

borkdude12:04:39

It was not clear to me whether you preferred the first whatever or the second whatever

slipset12:04:51

whatever 🙂

borkdude13:04:30

Anyone here got an idea? I could secretly put this dynvar into clojure.core but that would be evil.

borkdude13:04:32

It would be very useful if clojure had something like a proxy-var, which just proxied everything to another var. This would also solve the potemkin/import-vars stuff.

otfrom13:04:20

I was going to say, isn't that what potemkin is doing

pez17:04:30

A bit of a train crash with my presentation. But I’ll use it for learnings.

otfrom17:04:08

sounds like victory to me. 🙂 congrats!

❤️ 2
pez18:04:15

It was partly a miss-communication, I now realize. I thought I had been given more time than I had. So learning there is to double check this several times.

borkdude18:04:39

how much time did you actually get?

pez18:04:21

Not sure actually, will check the recording, but when we planned it there was only two speakers. I thought the time of the event was extended, but apparently we were supposed to shorten down… All that said though. I had underestimated how much I like to talk about Clojure, so I was also going a bit longer on that part than I had plan. In combination: Not good.

ordnungswidrig18:04:22

I've been there. Although by today I'm still convinced that they accidently cut me short on my very first presentation. Midway through i got that sign "5min" and I was speeding up like nothing. It was a little crazy.

ordnungswidrig18:04:07

@pez is the talk available somewhere?

borkdude18:04:08

Better luck next time @pez

borkdude18:04:34

Tomorrow I'll do a presentation for a company for their in-house monthly developer meetup, first time I'm doing something like that

pez19:04:17

@ordnungswidrig it will be made available. Not sure when. What you mention is exactly what happened today. He (the host) apologized deeply for this afterwards. It's new for him as well, so we both learned valuable things today. I'll keep at it. It was fun after all. Even though the live coding ended in a stupid crash of the app and I was too stressed out to see where I had errored.

slipset20:04:02

My very first talk was a Clojure talk and I had live coding in it. I believe it went well, although it’s not recorded, so I don’t know. @ikitommi does 🙂

slipset20:04:38

Then I did a talk with live coding that did not go well at all, and I basically stopped trying to live code after that. Just too much which can go wrong, and personally, I’m unsure about how valuable it is for people to see me evaluate forms which I’ve typed up already. I guess that to demonstrate “hot code reloading” to non believers, it’s worth it.

borkdude20:04:46

For some reason I'm more comfortable with live coding in an online talk than on stage. I try to avoid it on stage, but online it feels more natural since I'm at my own desk... or something...

borkdude20:04:50

Also depends on the length of the talk. When I'm really time constrained (a 20 minute talk) I avoid it

pez20:04:59

Yeah, definitely easier online. This was digital, but much more on stage than what you probably refer to as online.

pez20:04:41

I’d say it was worth it even though I ended up in a crash. And I will probably do it again. There was other factors involved today that threw me off balance so I couldn’t fix my stupid error because my brain totally shut down.

borkdude20:04:07

FWIW, I have given a few presentations that I thought went like shit, but years later someone came to me and told me he is doing Clojure professionally because he started trying it because of those talks (I remember one at a school and one at a non-Clojure IRL meetup).

borkdude20:04:19

So even if you think it was a failure, someone else might feel inspired by it. :)

pez20:04:33

That is worth a lot, FYI. ❤️

3
👍 3
pez20:04:22

I got some super nice comments in the live chat and also in another channel on this Slack. So, yeah, it was probably not all shit. I will need to work hard with figuring out how to stay within my time checkpoints. I get carried away speaking about Clojure, it is a much bigger deal for me than I had realised.

😎 3
simongray06:04:43

Because Clojure feels amazing to program in!