
Better RxJS code with pointfree style - miloszpp
https://codewithstyle.info/Better-RxJS-code-with-pointfree-style/
======
Matthias247
In my opinion (as a non Haskell user) pointfree style is less readable than
the using the normal lambda syntax. In the latter I see at least for each step
the amount of input parameters for a function and how they are used. With
pointfree style I would need to look up which parameters a function consumes,
and what the previous step actually delivers. Type systems at least make this
safe, but I still think readability suffers, and the only gain is a bit
smaller code.

~~~
oldnorthstate
I agree with this completely. This demos well... "I took this 'mess' and
turned it into two clean limes!"

However, actually trying to figure out what the hell the code is doing in
pointfree style is an order of magnitude (or greater) more difficult.

This is a maintainability nightmare, no thank you.

~~~
platz
that's why you need a typed compiler for this kind of stuff

------
pvinis
Hasn't that been like that since rxjs 6, for more than a year? I have been
using this for a loooong time. Don't get me wrong, its awesome, and more blog
posts about rxjs is good. I was just expecting something new. Also I never
heard about pointfree before, only about pipe and pipeable.

Good luck :)

~~~
miloszpp
Sure, pointfree style has been present in RxJS since version 6 but on a
different level. The article is about using `pipe` for composing functions
that you pass as arguments to RxJS opertators. RxJS's `pipe` is about
composing the operators themselves.

RxJS's pipe: `stream$.pipe(map(x => something), filter(x => something)`

The article: `stream$.pipe(map(pipe(something, somethingElse))`

------
TheCoelacanth
Pointless style is nice in a statically typed language like Haskell if you
don't take it overboard, but it's a disaster in a dynamically typed language
like JS. Without the types, it is almost impossible to read.

~~~
miloszpp
It's possible to use Ramda with TypeScript, although it's not perfect. It
actually shows some weaknesses of TypeScript's type system as it's not
possible to properly type some functions.

------
deepsun
Looks similar to Spark implicits. For example, prop('foo') in Spark is $"foo".

Although Spark needs it for building computation DAG, tofigure out what
columns are needed before processing it.

