Fork me on GitHub
#off-topic
<
2021-03-25
>
seancorfield00:03:17

I tend to partition my web apps loosely into “handlers”, “model”, and “views” just because I find it a good visual reminder of what sort of code should or should not live in each type of thing — keep web/request stuff out of the model; keep pure business logic out of the handlers; keep view-related concerns together. But as I start a new web app, I tend to have one big handler.clj ns until I have enough code and enough common business logic to warrant refactoring out to multiple handlers, a model section full of business-related namespaces (although a lot of our business logic is already in a shared “library”), and view-specific stuff like how to render templates and header/footer wrappers and JS/CSS stuff etc.

👍 8
seancorfield00:03:20

(that said, some of our simpler web apps have just two namespaces: the “handler” stuff — all of the logic of the app including rendering — and the “bootstrap” stuff — initialize everything, define routing, logging/middleware setup)

🚀 8
Ian Fernandez00:03:22

Now I'm like trying to convince people to use less and less namespaces everyday, and they're like showing scaffold of folders on a application 😢

Ian Fernandez00:03:03

without even knowing what it'll be in the future

solf04:03:45

I have a list of arbitrary long-running commands (listed in a file) I want to start/stop at once, and restart any of them if the process crash. (they are actually a bunch of kubernetes port-forward, that sometimes close for network/other reasons). Any existent tool that would help me? I’m thinking of making a quick babashka script otherwise.

hiredman04:03:32

systemd --user

solf04:03:03

Hmm true, and it would give me an excuse to learn systemd. I’ll check this link: https://wiki.archlinux.org/index.php/systemd/User

solf04:03:40

After googling a bit, it seems that while systemd allows to start multiple process in one unit, it can’t track them individually (to restart them in crash for example)

hiredman04:03:04

Yeah, make them each a unit

solf04:03:16

It’d be annoying to edit multiple files, as the list of commands changes often. In the same google search I found http://supervisord.org/introduction.html that seems to handle that use case

solf04:03:32

Hey wait

solf04:03:46

I forgot I switched to osx on monday….

solf04:03:59

I think I’ll just go with the babashka script 😅

finchharold09:03:22

Any redis (carmine) guys?

jcburley17:03:11

Can anyone remind me of the term (which I'm forgetting, and it's proving difficult to look up) for the "syndrome", I think it's called, in which a person with expertise is repeatedly able to identify substantial errors in journalistic reporting on their field, yet continues to believe those same outlets when reporting on things outside that field?

kelsey-santos17:03:29

Gell-Mann Amnesia

👀 3
jcburley17:03:57

That's it, thanks!!

kenj18:03:51

Is there a good reference for organizational/architectural patterns in code that would describe things like what is an Entity vs Model vs ViewModel? What constitutes a Service or a View? etc.

noisesmith18:03:58

Elements of Clojure is a good book for that level of design question I think

👍 3
noisesmith18:03:46

the classic of course is the gang of four design patterns book

noisesmith18:03:59

(and the many follow ups and responses)

seancorfield18:03:35

https://en.wikipedia.org/wiki/Architectural_pattern is a pretty good overview of the various names of architectural patterns and links to definitions of specific ones.

jjttjj19:03:27

Maybe not exactly addressing your question, but this also might be of interest: http://mishadoff.com/blog/clojure-design-patterns/

kenj19:03:53

hmm, looks like I have a bit of reading to do

ordnungswidrig20:03:53

Also the C2 wiki is a huge resource (fun fact: this is the original wikiwikiweb. the mother of all wikis) https://wiki.c2.com/?CategorySoftwareArchitecture