off-topic

https://github.com/clojurians/community-development/blob/master/Code-of-Conduct.md Clojurians Slack Community Code of Conduct. Searchable message archives are at https://clojurians-log.clojureverse.org/
seancorfield 2021-03-25T00:00:17.278900Z

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.

👍 2
seancorfield 2021-03-25T00:02:20.280400Z

(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)

🚀 2
souenzzo 2021-03-25T00:03:44.281500Z

i have a keybinding to "load file to repl" And a keybinding to "run last test on REPL". Using midje, it show up in stdout. I use splited screen with code // repl So I usually not seeing the "test" namespace. But the main thing is design your namespaces/applications to be reloadable. Some libraries like pedestal and datomic helps A LOT on that. Where the library do not help, I do things like a simple (def register [...]) turns into (defn register [] [...]) so it's way "more reloadble"

2021-03-25T00:04:22.282Z

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 😢

2021-03-25T00:05:03.282500Z

without even knowing what it'll be in the future

vemv 2021-03-25T00:11:27.283Z

thanks for the answer. don't you face edge cases with that approach? for example, you "load file to repl" a changed defmacro how do you determine and reload all namespaces dependent on that defmacro that need to be recompiled? (else they'd be using the old macroexpansion) (Especially on a 100KLOC codebase)

solf 2021-03-25T04:10:45.285600Z

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.

2021-03-25T04:12:32.286200Z

systemd --user

solf 2021-03-25T04:15:03.286700Z

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

solf 2021-03-25T04:17:40.287Z

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)

2021-03-25T04:18:04.287200Z

Yeah, make them each a unit

solf 2021-03-25T04:19:16.287400Z

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

solf 2021-03-25T04:20:32.287600Z

Hey wait

solf 2021-03-25T04:20:46.287800Z

I forgot I switched to osx on monday….

solf 2021-03-25T04:21:59.288Z

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

finchharold 2021-03-25T09:11:22.288500Z

Any redis (carmine) guys?

jcburley 2021-03-25T17:12:11.290Z

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?

aaron-santos 2021-03-25T17:20:29.290100Z

Gell-Mann Amnesia

👀 1
jcburley 2021-03-25T17:41:57.290300Z

That's it, thanks!!

jcburley 2021-03-25T17:49:12.290500Z

https://www.epsilontheory.com/gell-mann-amnesia/

kenj 2021-03-25T18:37:51.292900Z

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.

2021-03-25T18:54:58.293300Z

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

👍 1
2021-03-25T18:55:10.293500Z

https://elementsofclojure.com/

2021-03-25T18:55:46.294Z

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

2021-03-25T18:55:59.294300Z

(and the many follow ups and responses)

seancorfield 2021-03-25T18:59:35.295100Z

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.

2021-03-25T19:06:27.296100Z

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

kenj 2021-03-25T19:21:53.296600Z

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

ordnungswidrig 2021-03-25T20:58:53.300200Z

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