Fork me on GitHub
#clojure-europe
<
2022-09-23
>
genRaiy07:09:17

Good morning

genRaiy07:09:52

I often ponder this cartoon

☝️ 1
❤️ 1
genRaiy07:09:37

Especially the sci-fi / baffling nature of technology to “everyday” management

reefersleep07:09:49

I haven’t experienced it that bad, but I have, in my career, heard management people say things that displayed an absurd ignorance of what the business application was actually doing. I think I get it, though. In essence, their job was not necessarily to know the application, and they had plenty of other stuff to fill up their headspace. It just seems silly from my perspective.

1
Ivar Refsdal07:09:30

Good morning 🙂

😍 5
reefersleep07:09:16

Good morning 🙂

reefersleep08:09:19

Apropos tabmageddon and similar: I just dumped a bunch of todos from my “main” todo into “sub-todos”, and now, my main is only 10ish items. I feel such a huge relief. In recent times, I’ve begun feeling overwhelmed when I see a lot of workitems at once. Sometimes, I miss the days when my responsibility was more like “I’m working on this item until it’s done, then I pick the next one”.

robert-stuttaford10:09:53

if my todo list scrolls, it feels overwhelming to me. silly lizard brain thing

1
reefersleep12:09:02

Same! Ideally, I want maybe 5 items or less.

reefersleep12:09:16

My girlfriend keeps lists of lists for all of the shit she keeps track of. Her head is exploding, even if she’s way more used to it and comfortable with it than me. Just vetting the backlog is a huge task by itself. I think there’s something to be said for “welp, this was on the list forever, but I never got around to it, and apparently, that wasn’t a problem. Out you go”

lemontea13:09:29

Sounds like a B-tree (or B+? who cares)

robert-stuttaford13:09:28

something to try with your girlfriend: 'what is the value of re-prioritising tasks 10+ more than once? would it maybe be more calming and freeing to ignore anything after 10 until you've dealt with 1-10?'

1
robert-stuttaford13:09:35

i.e. roadmaps suck.

robert-stuttaford13:09:54

i realised this during a particularly tough time a couple years back, where i'd spend all day playing planning tetris to try make all the stakeholders happy, and then the USA would wake up, inject fresh opinions, and i'd have to throw the plan in the bin and start again. i realised that it wasn't helping anyone at all to be trying to predict whether we'd finish task 20 3 weeks from now or 3.5 weeks from now, and that we should decide, at most, which 3 things to do next, and then to do them until they're conclusively done! that was the beginning of a much brighter, happier part of my career, one i am still in today 😊

lemontea13:09:01

in other words: things suck, but that’s okay. You’re not a superhero, you don’t need to single-handedly save everything

robert-stuttaford13:09:21

another lens: maybe let future-you deal with future-you's challenges

robert-stuttaford13:09:27

i maintain notes on systems thinking stuff cos i'm babbling about it to people all the time and constantly want to share stuff with them: https://rostnl.notion.site/ one of my most used: https://rostnl.notion.site/Complex-Adaptive-Systems-Cynefin-ae89a77d4e564db7976762acf50f6306

👍 1
reefersleep08:09:45

Even then, there were enough outside disturbances to deal with… But at least, they were outside.

reefersleep09:09:13

What’s the best literature (online included) for organizing Clojure code? I always feel like we could do better in making things easy to navigate, find and overview.

Gabriel Kovacs09:09:15

I would also be interested in what are the Clojure/FP counterparts to the GoF Design Patterns, SOLID principles, ORM, etc.

pez09:09:20

Have you had a look at #polylith?

Gabriel Kovacs09:09:35

@U0ETXRFEW thx, I did not have it on my radar.

Ben Sless09:09:58

Opinions: (and not online resource, sry :man-shrugging: ) There is no such thing as too many namespaces Try to avoid the repository pattern No need for a "util" namespace Group stuff according to functionality and concern - error handling, logging, http, functional transformation (middleware, cps, etc), ring,

👍 3
reefersleep10:09:56

Whats’ “the repository pattern”, @UK0810AQ2?

Ben Sless10:09:03

In short, an abstraction layer to mediate your persistence layer and domain model https://www.martinfowler.com/eaaCatalog/repository.html Problem, it always leaks. Your persistence isn't universal, it's either key value, relational, or something else. You can't paint over it, then I rather build it in terms of function and not domain, eg instead of abstracting operations for the domain, abstract operations over persistence. If it's key value, have a keyvalue namespace and build your operations with it.

robert-stuttaford10:09:29

this is a great article about code org and dealing with abstractions: https://lambdaisland.com/blog/2022-03-10-mechanism-vs-policy

robert-stuttaford10:09:03

lots of simple namespaces is better than fewer bigger ones. a common refactoring i do is to split an ns - an obvious tell is when a subset of defs in there all share a common word e.g. "get-repo" "repos-for-n" "may-use-repo?" tells me i need a new namespace just for "repo"

1
pez10:09:41

Re: Polylith: @U04V70XH6 has written several articles where Polylith is involved. Check out: https://corfield.org/blog/2021/06/06/deps-edn-monorepo-3/

Ben Sless10:09:01

I'll give an example riffing on the post you shared. It's a good example, but I often see stuff like this applied cargo-cultishly, i.e. all namespace that are involved in policy will be under the policy directory and all namespaces involved in mechanism will be under the mechanism directory (which is often also called repository) just call your namespace my-app.json, no need for http://my-app.repository.json

Ben Sless10:09:07

people are weird

Ben Sless10:09:30

Slack is, too. It's not a link!

robert-stuttaford10:09:37

i use the policy/mechanism thing as a way to read the code, rather than a way to organise it

robert-stuttaford10:09:01

one common question i ask myself is, how could i use more data and less functions to represent this policy?

Ben Sless10:09:04

Which is good, and it falls out naturally when you split things up

Ben Sless10:09:09

I have namespaces that contain just one function

Ben Sless10:09:30

Who cares if it's in a different files, it gives the function a better name by just putting it there

robert-stuttaford10:09:35

sometimes i do keep things combined because seeing the whole system on a single screen is also useful. but usually this is when it's an independent, isolated bit that happens to have several abstractions in it

robert-stuttaford10:09:17

e.g. a script to export a bunch of testing data from a production db will deal with db queries and configuration to be used by those queries, and then fns that e.g. a scheduler would call to do that work, all in the same ns

robert-stuttaford10:09:39

most of the time tho its all nicely factored out

Ben Sless10:09:43

huge imac 4k displays have been a disaster for the human race 😄

Ben Sless10:09:20

I just split the editor screen if I need to look at several things. It can be in the same file, too

Ben Sless10:09:30

Those wide screen displays have made code unreadable

Ben Sless10:09:49

I want to be able to read code on my phone screen

robert-stuttaford10:09:24

my eyes are shit, so my big screen is a + for me

Ben Sless10:09:58

That's a different concern; I meant in terms of layout. A big screen with big font is useless for lines 200+ chars long

Gabriel Kovacs10:09:28

What would be the preferred way of creating a graphical representation ( UML like) of the system? Would it make sense to associate a namespace with a class as in UML class diagram. For me it's always easier to reason about the interactions within a systems by means of a diagram.

Ben Sless10:09:17

Namespaces and classes are fundamentally different imo. Classes encapsulate state, namespaces (should) encapsulate ideas. They let you name and organize things

Ben Sless10:09:10

and unlike packages in other languages, it's reified, so you can interact with it

Ben Sless10:09:27

you can render the dependency graph

👍 1
Gabriel Kovacs10:09:49

And if I wanted to see which namespaces and functions are involved in realizing a specific use case what would be my options? For stuff like this I usually make use of something like a sequence diagram.

Ben Sless11:09:31

assuming you're not loading anything dynamically, you can make a dependency graph for vars, not just namespaces. Namespaces are places where vars hang around, you can totally ask "which var definitions use other var definitions"

Ben Sless11:09:40

LSP does this

Gabriel Kovacs11:09:51

thx for the Info!

lemontea13:09:54

@U02AMR8032L FP counterpart to design pattern is a fairly old topic. I remember first reading about it on a presentation by some famous Googler - he claims that a large majority of the GoF patterns become just language features in FP (some would go further and say that design pattern in OOP is mainly a way to compensate for its lack of expressiveness). As an example: https://dev.to/qgabe/functional-programming-design-patterns-part-2-factory-method-pattern-e19 In short, you’d try a combination of HoF/currying/partial application/lambda/closure…

lemontea13:09:51

However, the irony is that later on, ppl seem to find that there are a separate set of design patterns in FP - things like Monad and Combinator

lemontea13:09:45

@UK0810AQ2 why no util ns? I often have one where I put some pure compute functions that are general purpose and not really project specific… (it’s like my personal extension to clojure.core )

lemontea13:09:28

@U0509NKGK a bit of a side-track: the mechanism/policy distinction is also something that happen a lot when you dig into the internals of famous cloud softwares

lemontea13:09:31

re put related stuff all in one ns vs spread it out: feel like the old debate on monolith vs microservice aka phase change due to scale

lemontea13:09:07

one more question to tack on: in some project I get into a “tangled mess” situation where it seems no matter what I do, some form of circular dependency b/w namespaces appear. Putting absolutely everything in a single namespace “solves” it, but as they say, heavy circular dependency is usually indicative of deeper design issue (tight coupling?)… any hints on what to do in such scenario?

Gabriel Kovacs13:09:09

one ns vs spread - I would say that it's one ns vs multiple ns (would imply high cohesion). The thing in between is a modular monolith. As far as I can tell from what I read until now Polylith facilitates the creation of a modular monolith. In case of circular dependency just add a message broker in between 😉.

lemontea13:09:17

message broker………… I’m speechless

lemontea13:09:32

that’s so OP, gg lol

😄 1
Ben Sless14:09:45

@U6L5FFL95 the util ns has unrelated things. That's not just compute stuff. There's stuff for string, for errors, for collections, for maps. All those things should be their OWN namespaces

Gabriel Kovacs14:09:02

so the equivalent of a god class 🙂 ?

lemontea14:09:31

@UK0810AQ2 oh I see… any suggestion for what name to use for the namespace? (keeping in mind that naming things is one of the 2 hard problems in CS - the others being “cache invalidation, and off-by-one error” 😉)

Ben Sless14:09:39

Like I said, for collections call it call the ns collection, for strings, string, for error handling, error, for io, you get the point

👌 1
Ben Sless14:09:47

Absolutely. This is where originality will only cause confusion

robert-stuttaford15:09:39

utils namespaces are like mushrooms in a cupboard 😂

seancorfield16:09:39

What I like about Polylith is that by "forcing" a structure on your code -- a fairly flat, broad structure of "bases" and "components" -- you are "forced" to think more clearly about the names of your components (groups of namespaces) and also their dependencies. So you work much harder at ensuring lower coupling.

metal 2
seancorfield16:09:50

(I covered that in one of my blog posts)

👍 1
reefersleep08:09:45

Lots of good stuff in this thread, I'm glad I asked! ❤️

🙏 1
😄 2
simongray09:09:31

Elements of Clojure

🤓 1
simongray09:09:52

by Zachary Tellman

maleghast09:09:05

Madainn mhath!

agigao11:09:17

Good morning 🍁 I recently created an Unsplash account and posted a couple of my latest shots. This one turned out to be special ☺️ 232K views so far: https://unsplash.com/photos/g06oUV5dWDQ

👍 3
1
wow 3
😍 1
robert-stuttaford11:09:57

you're really good, wow!

agigao10:09:35

Thank you! 😍

Mateusz Mazurczak13:09:00

Good morning, If you like kombucha, this is the shit

1
👍 1
reefersleep15:09:22

you are like ze buzzing of flies to him!

dharrigan15:09:44

A obscure reference to an 1980s comedy that was a dire sequel to a better one.

dharrigan15:09:17

The new (new!) movie is much better, it certainly has an afterlife...

Mateusz Mazurczak15:09:56

Btw is ghostbusters still worth watching for the first time?

dharrigan15:09:13

Ghostbusters is great

reefersleep15:09:18

I thought the sequel was OK 🙂

dharrigan15:09:21

Then skip ahead to Ghostbusters Afterlife

reefersleep15:09:40

it’s all good fun

dharrigan15:09:44

There's nothing that wrong with Ghostbusters II, just that it wasn't as great as the first one.

reefersleep15:09:44

I liked the remake/reimagining one as well. Chris Hemsworth as a himbo worked excellently!

reefersleep15:09:21

But the first one was certainly special compared to the rest.

lemontea15:09:39

I’m quite ignorant on cultural matters, but if I’m not mistaken, ghostbuster becomes kind of a cult/meme once localized in Hong Kong…

lemontea15:09:56

like hitting ghost with chocolate bar 🙈

lread15:09:12

Good morning!

vemv23:09:30

Good night!

1