Fork me on GitHub
#clojure-uk
<
2019-07-02
>
practicalli-johnny04:07:44

@otfrom do you mean names like ->bar-chart-grouped and ->bar-chart-stacked. Hmm, sorry, I don’t think that is what you are asking. Can you give an example in the codebase, Is it in the ingest/transitions.clj file (as this seems to have several similarly named functions?

otfrom09:07:40

so, I think the core of the question is: what do you name functions that are just re-working a data structure so it can feed into something else?

simonkatz10:07:30

If I have a domain concept xxxx, I’ve used things like xxxx-as-cljcsv for a Clojure data structure that’s a fairly direct representation of CSV and xxxx-as-csv for a string version.

simonkatz10:07:45

Sorry, that’s not answering your question about function names. 🙂

simonkatz10:07:33

xxxx->cljcsv, I guess.

otfrom10:07:54

I think my problem is that I have a vector of vectors that is common across csv and xls that I'd like to just factor out and I don't know what to name that

simonkatz10:07:20

With no domain name part?

simonkatz10:07:28

If it’s generic.

otfrom10:07:01

it isn't usually completely generic as there is often a transducer with a map and a juxt to pull out the fields in the order I want

simonkatz10:07:52

xxxx-as-v-of-v? Or xxxx-as-vv?

otfrom10:07:53

I suppose I do have a general "take this seq of maps and turn it into a seq of vectors with column headers at the top" that I should factor out

otfrom10:07:23

that I just pass in a vector of the keys for the order, a map of keys to column names and then the vector of maps of the data

otfrom10:07:38

and then call that... something

otfrom10:07:45

but then I at least only need to name it once 🙂

otfrom10:07:24

I think the pivots where I'm going from a seq of maps to a map of key -> vector of numbers is a bit trickier to name (this is for grouped and column charts)

simonkatz10:07:23

(If I’m following…) Maybe you could have separate concepts of xxxx, xxxx-as-vv and vv. And come up with a name for the “map of key -> vector of numbers” thing. Maybe xxxx-as-grouped-map and grouped-map.

otfrom10:07:55

as I can't do /me

practicalli-johnny09:07:07

A quick reminder that the "Exploring REPL tooling with socket prepl" has moved to Tuesday 16th July, at the same venue, SkillsMatter. https://www.meetup.com/London-Clojurians/events/262000841/

👍 8
jasonbell09:07:51

@otfrom <<that are just re-working a data structure>> As in “transform”? Or am I losing context somewhere?

otfrom09:07:20

Just a transform I think. Sometimes some roll ups, but those are easier to name

jasonbell09:07:23

Can’t use tf as the world and his pigeon will think you’re doing TensorFlow in Clojure and you’ll be considered a god and people will sacrifice nano configs in your name.

otfrom10:07:12

and if I call it xf people will rightly think I mean a transducer

dharrigan10:07:52

how about tfxf, a tensor flow transducer?