Fork me on GitHub
#missionary
<
2022-01-26
>
ribelo11:01:24

Have any naming conventions been established yet?

ribelo11:01:45

naming functions is the most difficult thing in programming

ribelo11:01:07

I am looking for a clear way to mark functions that return sp or ap and everything looks terrible ; P

ribelo12:01:31

does't convince me

ribelo12:01:56

maybe < and >?

ribelo12:01:11

leonoel often uses >f for flow holding variables

ribelo12:01:26

so functions returning flow would be consistent with this

Ben Sless12:01:29

but how will you know if it's sequential or ambiguous?

ribelo12:01:42

in core.async functions returning channel sometimes have > prefix

ribelo12:01:33

sp is a bit like go block

ribelo12:01:13

So maybe sp should have < prefix and ap have > prefix?

ribelo12:01:35

one char is better than two...

Ben Sless12:01:57

but what do < and > mean in this context?

ribelo13:01:27

it has no semantic meaning, except that after a function with a < prefix we can expect one value in the future, and after a > many values in the future

ribelo13:01:58

and imho it looks better than !! and !?, but this is a subjective feeling

Ben Sless13:01:05

| for sp and & for amb?

ribelo13:01:38

@U053XQP4S do you have any preferences?

ribelo13:01:40

currently, missionary with its sigils looks a bit like a brainfuck, and adding the remaining characters from the keyboard probably won't improve the aesthetic feeling 😜

Ben Sless13:01:44

Just suffix sync and amb?

ribelo13:01:55

I don't know, I'm not the decision maker either

leonoel21:01:46

I've never really felt the need for a naming convention. Functions returning task/flow are usually pure so there's no need for a ! IMO. The function call is very often inlined in the ? form so the task/flow itself doesn't have to be named. When needed, >f is used at hyperfiddle as a loose convention for naming signals, but it's not used that much in our codebase because we use photon as an intermediate layer. @U0BBFDED7 if a naming scheme works for you, you're totally entitled to communicate about it.

ribelo21:01:51

clojure is not typed and good function naming helps, at least for me

ribelo21:01:33

a docstring would probably suffice, but there is never enough time or willingness for that

ribelo21:01:15

btw, @U053XQP4S, we started using missionary on production

🎉 3
ribelo21:01:51

not me, because unfortunately I don't have the possibility, but colleagues on another project

leonoel21:01:48

glad to hear that ! I'd love to know more, if you and/or your colleagues want to discuss feel free to DM me

ribelo21:01:27

there is not much I can say and the man who runs it is a ninja who rarely leaves his cave to chat on slack

ribelo21:01:33

the previous project used a re-frame, which generally did not work well for us, and now a homemade solution has been created using rumext+missionary

ribelo21:01:38

re-frame is actually a graph too, but how the subscriptions work is mega complex, and reagent doesn't help at all

ribelo21:01:38

In fact, reimplementing a re-frame using missionary will probably be a <500 loc