almenal99,
@almenal99@fosstodon.org avatar

hey @coolbutuseless @mattdray

what's your take on pipe-at-the-end vs pipe-at-the-beginning?

(others, feel free to chime in)

Mehrad,
@Mehrad@fosstodon.org avatar

@almenal99
In my head pipes are like comma, as they indicate that there is more to come. So it should come at the end of the line, unless similar to bash we can use escape character to escape the new line. If someone is after aesthetics, they can use indentation.

I also sometimes use -> assignment at the end of a pipe chain to store the results in a variable. So I can see that having it at the beginning of the line can provide some clarity.

@coolbutuseless @mattdray

DataAngler,
@DataAngler@vis.social avatar

@almenal99 @coolbutuseless @mattdray I like the reasons outlined in the resource below for putting |> at the end of the line:

  1. easy to scan verbs on the left to understand what a chunk is doing
  2. easy to add steps to the end of a line

https://r4ds.hadley.nz/workflow-style.html

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • kavyap
  • Durango
  • cisconetworking
  • mdbf
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • osvaldo12
  • Youngstown
  • ethstaker
  • slotface
  • rosin
  • thenastyranch
  • megavids
  • normalnudes
  • modclub
  • khanakhh
  • everett
  • tacticalgear
  • cubers
  • GTA5RPClips
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • lostlight
  • All magazines