|
|
|
|
|
by 1_player
1988 days ago
|
|
I disagree. I think a common antipattern is piping only one thing. This is good and readable: nuclear_missile
|> open_hatch()
|> open_fuel_lines()
|> fire_thrusters(:all)
|> configure_gps(%Coordinates{...})
This is unnecessary: word_count =
words
|> Enum.count()
This is better: word_count = Enum.count(words)
Pipes read like a list of bullet points. We can easily deal with up to a dozen bullet points, but a single bullet point is bad grammar style. |
|