3 ms·
> i could definitely see this leading to some very funky looking chaining. At least for me, thing .doThis() .thenDoThat() .andFinallyThis() is
by xigoi 5mo ago
> i could definitely see this leading to some very funky looking chaining.
At least for me,
thing
.doThis()
.thenDoThat()
.andFinallyThis()
is much more readable than
andFinallyThis(
thenDoThat(
doThis(thing)
)
)
- cupofjoakim 5mo agoWell, nesting is not the only option. ``` thing.doThis() thing.thenDoThat() thing.andFinallyThis() // or doThis(thing) thenDoThat(thing) andFinallyThis(thing) ```
- xigoi 5mo agoThat’s not equivalent.
- keithasaurus 5mo agoYeah, this is the idea. This chaining is exactly the same as the pipeline operator in some some function languages, except that it hopefully reads in a more familiar way to programmers of non-functional languages.