5 ms·
My mind instantly darts to the combination of piping + pattern matching. Edge cases can live as two line adjustments in ways I don't know how to do in any othe
by slindz 6y ago
My mind instantly darts to the combination of piping + pattern matching.
Edge cases can live as two line adjustments in ways I don't know how to do in any other language.
- PaulStatezny 6y agoCouldn't have answered the question better/more succinctly myself. When I'm working on the JavaScript (front end) side of an Elixir project, I repeatedly get into these positions where I'm thinking, "Man, I could express this so succinctly and elegantly in Elixir. There's no way in JavaScript that doesn't feel clunky in contrast."
- enraged_camel 6y agoWorth noting that the concepts of piping and pattern matching don't just exist in the language itself, but also in an architectural level. Plugs, for example, allow you to "pipe" entire web requests in a very elegant and logical fashion.
- noneeeed 6y agoThat makes sense. For a period of my career I did some Prolog and always liked the way pattern matching allowed you to write extremely descriptive code. Funnily enough, I think pattern matching is one of the most exciting things to happen in Ruby for a long time. While it isn't on a par with functional pattern matching it's still going to be incredibly useful.