(no title)
time_to_smile | 2 years ago
a(b(c(d))) vs d |> c |> b |> a
but I'm not convinced pipes are better than more verbose code that explains each step:
step1 = c(d)
step2 = b(step1)
result = a(step2)
I've written a lot of tidy R and do understand the specific use cases where it really doesn't make sense to use the more verbose format, but generally find when I'm building complex mathematical models the verbose method is much easier to understand.
joeman1000|2 years ago
_0w8t|2 years ago
In programming the code will be read multiple times and good names will help the future readers. But in data science the calculation will be most likely will not be reused. So efforts to name things will be waste of time.
geokon|2 years ago
I suggest that trying to strictly only bind output to a symbol if it will be used in multiple places.
So when I read code and I see some "intermediary" value bound - it tells me immediately "this thing will be used in several spots". Thereby bindings actually start to convey extra information
Anyway, it's just something that's worked for me. In all other scenarios I will use threading/pipeline (maybe Clojure specific). If steps are confusing/complex then you make a local named lambda or add in the extreme case.. comments
Max-Limelihood|2 years ago