Article 3J83R Representative Line: Flushed Down the Pipe

Representative Line: Flushed Down the Pipe

by
Remy Porter
from The Daily WTF on (#3J83R)

No matter how much I personally like functional programming, I know that it is not a one-size fits all solution for every problem.

Vald M knows this too. Which is why they sent us an email that simply said: "We have a functional programmer on the team", with this representative line attached.

function groupByBreakdown (breakdowns) { return R.pipe( R.map(R.flatten), R.zip(breakdowns), R.map(R.apply(R.useWith(R.groupBy, [R.prop, R.identity]))) );};

The use of R.pipe is a good argument about why the proposed pipeline operator is a terrible idea whose time isn't going to come. Ever. Yes, there's value in being able to easily compose functions into a pipeline. Shells support pipelining for a reaason, after all. But it's an awkward fit into imperative languages, and unfortunately, the tool is too dangerous to be used in real-world code. Even functional languages, like Elixir, warn you against abusing the pipeline. Mixing opaque functional styles with JavaScript is just flirting with disaster. I mean, more disaster than JavaScript already is.

proget-icon.png [Advertisement] ProGet supports your applications, Docker containers, and third-party packages, allowing you to enforce quality standards across all components. Download and see how! TheDailyWtf?d=yIl2AUoC8zAOTzItEMlrXo
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments