so. i've been using ramda for a couple of months now.
and I'm really in love with the idea. but I don't know, maybe I'm alone in feeling this... it feels like whenever I try to do anything real by composing ramda functions, i always go down a rathole.
like i'm spending hours doing something that would take minutes with some plain old imperative code.
and when I return to my code later, it seems completely incomprehensible.
is this normal? have I just not reached zen yet?
i asked a question here two weeks ago or so about the best way to do something, and solved it with some help from the channel. but then it turns out... i hadn't solved it at all. the solution just randomly happened to work for the one test case i used as an example.
so despite several people looking at my snippet, not a single person was able to spot the fact that the code was not even remotely doing what i wanted to.
sorry if that sounded harsh, not what I intended to. just wanted to discuss this a bit.
is just makes me think that coding by composing functions just makes things very hard to reason about.
I'd love to hear more about where it's failing for you. My experience is precisely the opposite. By building my code out of smaller, simpler functions, I almost always find it easier to reason about.
in many cases yes, it can be very elegant and expressive.
i don't know exactly what the problems i run into have in common. maybe when there are many things that need to checked or compared to figure out the final value i want.
maybe there are tools in the toolbox i should use, that i haven't figured out yet.
for the stuff i'm working on right now, there are a lot of objects/hashes, where I need to do things based both on the keys and values. that seems to bring a huge amount of friction compared to working with arrays/lists.
It might simply be that Ramda isn't well-suited for your data structures. That would be a shame, and I'd love to see if we could help, but it's certainly possible.
maybe. i'm not sure how to find old messages in gitter, but that issue that i had a while back was getting the maximum value in a list, by scoring every item with a function.
here's my best attempt at doing it using only ramda.