Fork me on GitHub
#clojure-uk
<
2019-09-02
>
thomas07:09:43

Morning...

thomas07:09:38

and the only way I qualify as a cycling giant is my hight... nothing else about my cycling is gigantic, that is for sure.

dominicm10:09:04

Speaking of the REPL, someone suggested the other day that the reloaded workflow discourages repl use. As you're more likely to just hit reset and reload your browser, rather than tweak and re-eval.

mccraigmccraig10:09:27

@dominicm uh, does reloaded work for cljs too ?

dominicm10:09:58

@mccraigmccraig Depends what you're doing

mccraigmccraig10:09:30

well, i've to c.t.n.r/refresh stuff in clj, and websocket/browser stuff for cljs - but the workflows are kinda different

mccraigmccraig10:09:29

although maybe there's a c.t.n.r/refresh equivalent for self-hosted cljs ? never used it, so not sure...

dominicm10:09:13

I think the point was somewhat that refresh is bad to a repl flow too

dominicm10:09:00

Stu Halloway mentioned something to the effect of "if you need something like that, you have to ask yourself why?" I think the implication is that if you can't keep in your head everything that you're changing, then your software is possibly complected.

dharrigan10:09:05

@dominicm as a relative newcomer to the scene, I do both. I normally tweak tweak, but when I want to have a tabula rasa, I reset 🙂

dominicm10:09:26

You might be more disciplined than others ;)

dharrigan10:09:28

having the option to do both is ideal 🙂

dominicm10:09:48

Or, you might be building actual simple software.

mccraigmccraig10:09:47

we do live in a somewhat complected world... jvm class files compiled from clojure protocol definitions, refs to stale classes left lying around etc - clean-slate is quite useful in such situations

mccraigmccraig10:09:16

but yeah, doing c.t.n.r/refresh all the time is quite smelly

dominicm10:09:52

I'm curious to know if anyone thinks they have some strategy or approach that helps or harms how much they use the repl and data as opposed to integration testing their code

dominicm10:09:41

(Especially as you both acknowledge that refresh is smelly, you're good candidates for sharing how your application has achieved this)

dominicm10:09:31

I've worked on projects where a lot of logic is in the web handler, so you can either attempt to create a ring request at the repl, or you reload your browser / use curl.

mccraigmccraig11:09:44

we have refresh... i only tend to use it occasionally though, and i'm ok with that

mccraigmccraig11:09:04

our domain logic got moved (is getting moved) down to the model layer - the api layer only does api stuff - http handling, schema checking, coercion, and configurable mapping of any (pure-data) responses to http responses

mccraigmccraig11:09:48

'course then there is still the client to test against the api...

simonkatz11:09:35

I use both REPL-based and reloaded workflows. I see them as providing different levels of feedback loop. Even within REPL-based development, there are different levels of feedback loop. Shameless plug: I wrote a fair bit about this stuff a while ago at http://blogish.nomistech.com/repl-based-development-and-feedback-loops/ and, in more detail, at another article that’s linked to from there.

simonkatz11:09:07

I like thin web layers, with domain logic in a separate layer. My mental model is that it should be easy to attach a different kind of interface (eg a command line interface) if I ever wanted to (even if I would never want to). I think it makes things clearer and easier to test.

dominicm11:09:56

One might argue that the REPL is that second interface!

dominicm12:09:10

My current conclusion is that you need to split into a domain layer for target by the repl. You have a chance of writing a coherent spec for your own domain model.

dominicm12:09:16

Although, ring requests do just take data. So maybe I'm screwing that up :)

seancorfield18:09:10

I see beginners picking up that reloaded/refresh-based workflow all the time -- seems to be the "default" recommendation in a lot of tutorials?

seancorfield18:09:20

I never use the reload/refresh approach. I always eval forms as I write them, occasionally recompiling a whole file. It was interesting to do Eric Norman's RDD course and find he also avoids the reload/refresh approach.

dharrigan18:09:33

For me, I came to use reload/refresh due to using mount then integrant

👍 4
dharrigan18:09:45

I would not have known about that aproach otherwise

dominicm18:09:31

I'm wondering if I should remove integrant from my stack

seancorfield18:09:56

We use Component heavily but I've still never felt the need for "reloaded". I just remembered that both ProtoREPL and Chlorine sort of assume you'll go the full auto-refresh route -- Jason's "opinionated" setup for ProtoREPL and (until recently) the default in Chlorine was to do namespace refreshes at startup and on save etc. Which I just find... kind of ridiculous as it gets beginners off on the wrong foot in my opinion.