4 ms·
I am familiar enough with functional programming patterns. I could probably understand this if I had some more experience with Rust. But I think I would be able
by kutkloon7 10y ago
I am familiar enough with functional programming patterns. I could probably understand this if I had some more experience with Rust. But I think I would be able to understand the snippet in most imperative and functional languages.
My point is not that the snippet is bad, just that Rust feels, looks, and probably is, quite complex. As opposed to, for example, Haskell, which also introduced a bunch of nice, new, ideas.
- Sean1708 10y ago> Rust feels, looks, and probably is, quite complex. As opposed to, for example, Haskell Do you really think that Haskell is less complex than Rust, or am I just reading your comment wrong?
- shmageggy 10y ago> I am familiar enough with functional programming patterns. Really? I've never used rust but the code was pretty clear to me except for the >> shift part. > But I think I would be able to understand the snippet in most imperative and functional languages. In Python (ignoring the shift thingy) I'd write prediction = sum(map(lambda c, s: c*s, zip(coefficients, buffer[i-12: i]))) To me, both are equally clear