# When to use pipes?

**URL:** https://discourse.julialang.org/t/when-to-use-pipes/59714
**Category:** Offtopic
**Created:** [April 21, 2021, 6:34am UTC](https://discourse.julialang.org/t/when-to-use-pipes/59714 "2021-04-21T06:34:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)
#### Post date: [April 21, 2021, 6:34am UTC](https://discourse.julialang.org/t/when-to-use-pipes/59714/1 "2021-04-21T06:34:14Z")

</div>

I’ve been thinking about pipes lately as @epogrebnyak and I decided to port the Causal Inference Mixtape ([https://mixtape.scunning.com/](https://mixtape.scunning.com/)) to Julia and the original R code is very pipe heavy. My first language was R but I use data.table and not pipes there and have never been a big fan of them. In julia I have used native pipes for one argument functions and think it is still easy to reason about the code. Currently I am looking at `Chain.jl` as a replacement for Magrittr pipes. Are there any opinions on this topic? Should we use pipes? Which package? How many functions make it worth it to use a pipe?  
Thanks for your input!

---

<div class="post-metadata">

### Author: ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)
#### Post date: [April 21, 2021, 6:57am UTC](https://discourse.julialang.org/t/when-to-use-pipes/59714/2 "2021-04-21T06:57:08Z")

</div>

There was a long thread about this recently [How often do you use the |\> operator?](https://discourse.julialang.org/t/how-often-do-you-use-the-operator/56189)

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [April 21, 2021, 7:19am UTC](https://discourse.julialang.org/t/when-to-use-pipes/59714/3 "2021-04-21T07:19:41Z")

</div>

> [@danielw2904](#):
>
> Are there any opinions on this topic?

😅

---

<div class="post-metadata">

### Author: ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)
#### Post date: [April 21, 2021, 9:30am UTC](https://discourse.julialang.org/t/when-to-use-pipes/59714/4 "2021-04-21T09:30:51Z")

</div>

I was searching for “pipe” but of course “|\>” would have been good thanks!

It seems people use it for “hacking” in the REPL and some function composition. I have to think some more about how this translates to a general design decision for the Mixtape translation.

---

<div class="post-metadata">

### Author: ![danielw2904](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielw2904/32/10890_2.png) [@danielw2904](https://discourse.julialang.org/u/danielw2904)
#### Post date: [April 21, 2021, 9:32am UTC](https://discourse.julialang.org/t/when-to-use-pipes/59714/5 "2021-04-21T09:32:45Z")

</div>

I now realize that this was suboptimal phrasing 🤣
