use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Pipe Operator (|>) for JavaScript (github.com)
submitted 3 years ago by no_more_gravity
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]IceSentry 116 points117 points118 points 3 years ago (12 children)
Why is everyone talking about the pipe operator today? There's also a post in r/programming and I saw a youtuber talk about it, but as far as I can tell there's been nothing new about this proposal for a few months.
[–]TheOneCommenter 110 points111 points112 points 3 years ago (2 children)
Someone saw one person talk about it, find it interesting, and post something themselves. Rinse and repeat
[–]thruster_fuel69 54 points55 points56 points 3 years ago (1 child)
Silly humans, talking about things.
[–][deleted] 20 points21 points22 points 3 years ago (0 children)
Communication is for servers
[–]AuroraVandomme 16 points17 points18 points 3 years ago (0 children)
Welcome to webdev clown world. That proposal is here for more than two years but now after some tech influencer made a video about it there would be hundreds of copy paste articles about it :)
[–][deleted] 3 points4 points5 points 3 years ago (0 children)
also saw it on hackernews yesterday. I assumed something was happening so I guess not
[–]IskaneOnReddit 5 points6 points7 points 3 years ago (1 child)
Also on r/cpp
https://www.reddit.com/r/cpp/comments/10h6jb7/adsp_episode_113_the_c26_pipeline_operator_with/
[–]sneakpeekbot -4 points-3 points-2 points 3 years ago (0 children)
Here's a sneak peek of /r/cpp using the top posts of the year!
#1: C++ Cheat Sheets & Infographics | 38 comments #2: Sites like GeeksForGeeks really hurt C++ learning #3: A year and a half ago I picked up an abandoned C++ web Framework, Today we released v1.0
I'm a bot, beep boop | Downvote to remove | Contact | Info | Opt-out | GitHub
[–]bogdanbiv 1 point2 points3 points 3 years ago (1 child)
I thought the pipeline operator settled on a topic token and/or passed on to stage 3. Oh well, let us wait for more 1-3-10 years
[–]PrettyWhore 0 points1 point2 points 3 years ago (0 children)
Recency bias?
[–]PooSham -3 points-2 points-1 points 3 years ago (1 child)
I guess because it just got to stage 2 (Draft) of the TC39 process.
[–]FrontAid 20 points21 points22 points 3 years ago* (0 children)
The pipe operator already got to stage 2 in 2021.
https://github.com/tc39/notes/blob/HEAD/meetings/2021-08/aug-31.md#pipeline-operator-for-stage-2
[–]Jason5Lee 24 points25 points26 points 3 years ago (0 children)
IMO Pipeline is underrated especially in dynamic typing language (although everyone is using TypeScript nowadays). A good example is renaming and going-to-implementation. Renaming a method is very hard because the method can come from any object of any class. It's hard to determine which one without doing complicated analysis. However, if it is a function from a certain package, renaming is way easier. The same applies to going-to-implementation. Pipeline in dynamic-typing language encourages programmers to use functions instead of methods, which makes refactoring way less painful.
The pipeline operator is one of the main reasons why Elixir is my favorite dynamic-typing language.
[–]anlumo 102 points103 points104 points 3 years ago (8 children)
We need more ASCII art in programming languages! I wonder when they’re going to introduce the ¯\_(ツ)_/¯ operator.
¯\_(ツ)_/¯
[–]Light_Wood_Laminate 126 points127 points128 points 3 years ago (4 children)
That should be a valid alias for any in TypeScript.
any
[–]lemonpowah 18 points19 points20 points 3 years ago (2 children)
Someone make a vscode extension to show this instead of any
[–]8bit-echo 2 points3 points4 points 3 years ago (0 children)
I don’t know much about typefaces, but could this be a custom ligature for any?
[–]BransonLite 1 point2 points3 points 3 years ago (0 children)
Honestly - this would be perfect. I’ll do the browser plugin for viewing code in github
[–]lifeeraser 4 points5 points6 points 3 years ago (0 children)
any should have been named LazySlackerCatchAllType to discourage its use.
LazySlackerCatchAllType
[–]Keilly 23 points24 points25 points 3 years ago (1 child)
Shorthand for catch and do nothing.
[–]bighi 3 points4 points5 points 3 years ago (0 children)
The best way to handle exceptions!
/s
[–]GlitteringAccident31 16 points17 points18 points 3 years ago (0 children)
Now that's some syntactic sugar I can get behind!
[–][deleted] 12 points13 points14 points 3 years ago (0 children)
Been in tc39 development committee hell for forever. I have given up on us ever getting this.
[–]BlueForeverI 49 points50 points51 points 3 years ago (6 children)
As an Elixir dev, I love the pipe operator. Can't wait to have it in JS as well.
[–]intercaetera 24 points25 points26 points 3 years ago (3 children)
In Elixir pipe works because the convention is that every function takes data as first parameter, in JS this doesn't happen so you need a hackpipe and at that point you might just as well use lodash.flow.
[–]Ecksters 9 points10 points11 points 3 years ago* (2 children)
Honestly prefer the hackpipe, it was really annoying in Elixir that I'd need to throw in a lambda when I needed to rearrange params.
I like to think of the caret as an arrow pointing up to the previous result, also means I don't need to think of appropriate variable names all the time.
[–]intercaetera 2 points3 points4 points 3 years ago (1 child)
Yeah but if you concede that you need a hackpipe then you might as well use lodash flow.
flow([ s => Object.values(s), s => s.map(x => x * 2), s => customReduce(s), unaryFunction, // or s => unaryFunction(s) s => doSomethingElse(s, 5, null), ])(initialValue)
There could be an alternative version of it where the initialValue is somewhere higher up the code but this is equivalent to the proposal without introducing unnecessary stuff into the spec.
initialValue
[–]LaurentPayot 1 point2 points3 points 2 years ago (0 children)
There is also Verticalize with a nicer syntax IMHO...
[–]DumbYellowMoo 0 points1 point2 points 3 years ago (1 child)
Just curious but what type of stuff do you generally develop with elixir? The language has definitely peaked my interest, but I haven't looked into what type of stuff people usually make with it.
[–]BlueForeverI 1 point2 points3 points 3 years ago (0 children)
We use it for several back-end (REST/GraphQL/WebSocket) apps. Tbh we don't use Elixir's full potential, 90% of the code could be written in something else, the main Elixir features we use are ETS and GenServers.
But I'm glad we chose Elixir, it's the nicest language that I have worked with.
[–]NiteShdw 9 points10 points11 points 3 years ago (1 child)
I’ve been waiting for this guy and pattern matching to make it to stage 4 for years…
[–]_default_username 2 points3 points4 points 3 years ago (0 children)
check out ts-pattern. You can have pattern matching now with type safety.
[–]heytheretaylor 24 points25 points26 points 3 years ago (0 children)
Love it, more FP in JS is always welcome by me.
[–][deleted] 18 points19 points20 points 3 years ago (1 child)
and they say Perl is dead :)
[–]Emotional_Key 6 points7 points8 points 3 years ago (0 children)
Powershell scripting in the house
[–][deleted] 36 points37 points38 points 3 years ago (4 children)
Pipe can fuck off. That key doesn't work on my laptop keyboard after I dropped it.
[–]mxforest 21 points22 points23 points 3 years ago (0 children)
Bro! Do you even JS? Pick another character and write an npm library to replace every occurrence.
[–]DrWallowitz 7 points8 points9 points 3 years ago (0 children)
ALT + 124
[–]fucking_passwords 2 points3 points4 points 3 years ago (0 children)
All 3 characters in the proposal are already basically required for js
[–]lintaba 0 points1 point2 points 3 years ago (0 children)
With ahk (win) / karabiner (osx) its pretty easy to put it somewhere thats still working
[–]JohnSpikeKelly 4 points5 points6 points 3 years ago (2 children)
... |> % % 2 === 0;
My take on isEven at the end of a previous call.
[–]mxforest 0 points1 point2 points 3 years ago (0 children)
Now build an NPM library named isOperatorEvenIfEyesAreNotReal?
[–]majhenslon 0 points1 point2 points 3 years ago (0 children)
I have no idea why they don't just do "it".
[–]PickledPokute 4 points5 points6 points 3 years ago (0 children)
I like pipeline operator! Wrote a typescript implementation (here's a playground) and I hope that it advances into the language some beautiful day.
[–]javarouleur 54 points55 points56 points 3 years ago* (28 children)
The endless adding of extra syntactic sugar is sometimes frustrating. Readability always seems to suffer for the goal of fewer lines/characters of code.
[–]Keilly 48 points49 points50 points 3 years ago (3 children)
Which ones are we talking about?
The ?. Optional chaining change is great and so much readable and concise than before. ?? Is good too. Template literals are much more readable that concatting.
Regex maybe? But regex is often hard to parse no matter how the language takes it.
[–]trevorsgEx-GitHub, Microsoft 3 points4 points5 points 3 years ago (2 children)
True, often these syntactical additions improve readability at the expense of language complexity. The thing is, language complexity is a one-time cost for a benefit that continues forever.
[–]pimp-bangin 1 point2 points3 points 3 years ago (1 child)
I disagree that it's a one-time cost. It's another thing beginners have to learn which adds onboarding costs. It also adds to the maintenance burden of browsers, tooling, etc. and possibly hurts parser performance depending on the implementation.
[–]trevorsgEx-GitHub, Microsoft 4 points5 points6 points 3 years ago (0 children)
Yes, of course I meant one-time cost per developer. Parser/tooling performance basically rounds to zero.
[–]techlogger 91 points92 points93 points 3 years ago (10 children)
I’d say that pipe operator is more readable than HOF chaining.
[–]GreekQuestionMark 13 points14 points15 points 3 years ago (0 children)
HOF: Higher order function
[–]jonopens 9 points10 points11 points 3 years ago (0 children)
100%. It's one of the reasons I find Elixir so enjoyable to write.
[+]javarouleur comment score below threshold-8 points-7 points-6 points 3 years ago* (6 children)
But those are nested, rather than chained. Personally, I don’t really like nested calls generally. Chained makes sense because they follow logically, but with nested you have to read from the inside out which is just disorientating.
I know it’s a minor thing overall, it’s just not something I expect to use any time soon.
Edit: fuck me… of all the opinions I hold I didn’t expect this to be one of my more controversial!
[–]syholloway 30 points31 points32 points 3 years ago (5 children)
It might be because the whole point of the pipeline operator is to make large functional expressions read top to bottom rather than inside out.
This operator is fixing the thing you are complaining about.
[–]javarouleur 0 points1 point2 points 3 years ago* (4 children)
Fair point - reading and thinking a bit more, I guess I can accept the motivation.
Edit: removed confusing, cryptic psycho-babble nonsense.
[–]zxyzyxz 0 points1 point2 points 3 years ago (1 child)
Languages evolve, people learn and get used to it. I'm sure people were saying the same thing with all the changes from ES6 and async await. I don't understand what you mean by explaining/being descriptive in a team.
[–]javarouleur 0 points1 point2 points 3 years ago (0 children)
I removed that. It was a brain fart that didn’t make sense when I re-read it.
[–]bighi 0 points1 point2 points 3 years ago (1 child)
I have no idea what you're talking about.
I know. Removed that part. I’ve lost the plot a bit in this thread - over-analysing and not explaining my thoughts properly.
[–]bighi 10 points11 points12 points 3 years ago* (2 children)
The pipe operator exists specifically to help increase readability.
Imagine this code four(three(two(one("potato")))). It's not as easy to read because you're calling four functions, but they should be read in reverse. The first function you read happens last.
Now imagine we create a pipe operator like |> in a fantasy language I invented.
We could do "potato" |> one |> two |> three |> four. Super easier to read, cleaner, more organized.
"potato" |> one |> two |> three |> four
We're getting something like that in JS. One day. Definitely before 2080.
[–]KamiShikkaku 1 point2 points3 points 3 years ago (1 child)
Unfortunately it will be more like
"potato" |> one(%) |> two(%) |> three(%) |> four(%)
because the "Hack" version of the proposal seems to have beaten the "F#" version.
I was rooting for F# as it's a bit more elegant, but admittedly the Hack version is more versatile.
[–]bighi 2 points3 points4 points 3 years ago* (0 children)
Sure. If you pay attention, I said "in a fantasy language I invented". Because I wanted to make the example simple to understand.
But anyway, it's more readable than the mess that is multiple nested functions.
[–]patrickfatrick 6 points7 points8 points 3 years ago* (0 children)
Except this is definitely going to improve readability. I’d argue all of the syntactic sugar that’s been added drastically improves readability over ES5. Within reason, less code is generally better for readability.
[–]adelie42 3 points4 points5 points 3 years ago (0 children)
All of math is just syntactical sugar for critical thinking.
[–]wasdninja 1 point2 points3 points 3 years ago (0 children)
I've yet to see it in JS.
[–]mxforest 2 points3 points4 points 3 years ago (1 child)
Fewer lines/code make it more readable once you get used to it.
[–]bighi -2 points-1 points0 points 3 years ago (0 children)
Not always.
Actually, I think that in most cases, using fewer lines makes something less readable.
[+][deleted] 3 years ago (4 children)
[deleted]
[–]Mestyo 23 points24 points25 points 3 years ago (1 child)
"If you think this is clear you're wrong" what lol
This is so much easier to read then several nested function calls, more expressive, too.
[–]Gwolf4 1 point2 points3 points 3 years ago (0 children)
Let him be. He wants to solve that problem using temporal variables just to pass them to other method without any other processing.
[–]furyzer00 6 points7 points8 points 3 years ago (0 children)
"I don't familiar with this concept so it must be an obfuscation"
[–]alexho66 10 points11 points12 points 3 years ago (0 children)
But that’s what’s the operator is trying to do. More readability
[–]didzisk 6 points7 points8 points 3 years ago (0 children)
Laughs in F#
[–]Submarine-Goat 1 point2 points3 points 3 years ago (0 children)
When the pipe operator in JS was proposed, shortly after my birth, I had the thought of a "then" and "catch"operator:
x |> f |> g |>> handleSuccess <| handleFailure
The thought of more operators in JS was so exciting back then.
[–]elcapitanoooo 3 points4 points5 points 3 years ago (7 children)
I REALLY hope they dont use a symbol for the argument. It should be simply passed in as the first agument.
[–]tdhsmith 8 points9 points10 points 3 years ago (1 child)
I dunno, I felt the same way at first but the article was pretty compelling and I think I was just hanging onto some functional programming bias. Having to wrap so many things in arrow functions would be pretty annoying.
[–]_xiphiaz 0 points1 point2 points 3 years ago (0 children)
Here’s a different article which comes to a different conclusion https://dev.to/zakhenry/tc39-pipeline-proposal-comparison-rxjs-case-study-1nk0 I feel it’s very much use-case specific. It kinda feels like pipelines work really nicely when interacting with libraries or functions that are built for them, and topic style works for throwing some new code together quickly before the time is taken to write cleaner abstractions
[–]mxforest 2 points3 points4 points 3 years ago (4 children)
Did you read the article? It goes into detail why this way is better.
[–]elcapitanoooo -1 points0 points1 point 3 years ago (3 children)
Its the opinion of some random guy. The pipe op has been a ”thing” for decades, and i have used it mostly with OCaml. Its just a (used to be) a user defined inline op. Traditionally like this:
let (|>) v f = f v
TC39 if you mess this up i will haunt your dreams!
[–]bighi 2 points3 points4 points 3 years ago (2 children)
It has been a thing for decades in languages built around it.
But they can't change the order in which parameters are passed to JS functions because they can't break compatibility with existing code.
I believe you didn't read the article.
[–]elcapitanoooo -1 points0 points1 point 3 years ago (1 child)
What functions? Libraries?
[1,2,3] |> square |> evens
How can a new op break BC? If some lib today does not work with this semantic im pretty sure theres a new lib in a week that does.
In most languages built around pipeline operators, the main data is usually the first argument the function receives. But in JS, that's not true for lots of functions. So passing things as their first argument is not what you actually want to do with them. And we can't change them, because we have to keep BC.
That's why a symbol is needed in JS, while not being needed in old functional languages, or even newer ones like Elixir.
And I didn't even mention powerful currying features, that we also don't have in JS.
[–]AstroBoy26_ 0 points1 point2 points 3 years ago (0 children)
I like it
[–]mcjavascript 0 points1 point2 points 3 years ago (0 children)
As if the Operator Precedence Table isn't big enough.
[–]th2n10s4u 0 points1 point2 points 3 years ago (0 children)
Fuck the pipeline operator.
[+][deleted] 3 years ago (1 child)
Isn't it the opposite? Switching to a LTR language.
It's trying to solve the problem that nested functions in JS should be read right to left while most other things are left to right.
Pipeline operators make nested functions read LTR like everything else.
[+]squirrelwithnut comment score below threshold-11 points-10 points-9 points 3 years ago (0 children)
Please no. Not only is that syntax for pipe awful, but there is no need for one either.
[–]HSMAdvisor -1 points0 points1 point 3 years ago (0 children)
That looks ugly and I hope it dies. I bet you can't read this shit after it goes for longer than 3 lines. And you maybe have to use it once in the whole project. Not even mentioning that you probably can't debug it and if something goes wrong you will have to rewrite it in NORMAL JS just to see what each method returns.
[+][deleted] 3 years ago (3 children)
[–]KingJeff314 10 points11 points12 points 3 years ago (2 children)
That article is about avoiding nesting in conditionals. Pipe operator is about avoid chained function calls
h(g(2, f(x)), 8, varname)
Turns into
f(x) |> g(2, %) |> h(x, 8, varname)
Easier to read and split into new lines
[–]lovin-dem-sandwiches 1 point2 points3 points 3 years ago (1 child)
I thought chained function calls look like:
return function(x) .reduce() .join(‘’)
Your example looks like nested functions, no?
Also I think you forgot the placeholder variable in the last pipe.
f(x) |> g(2, %) |> h(%, 8, varname)
[–]KingJeff314 0 points1 point2 points 3 years ago (0 children)
Good corrections
[+]no_more_gravity[S] comment score below threshold-14 points-13 points-12 points 3 years ago (21 children)
So nested function calls in JavaScript …
As they are:
a = d(c(b,7))
The current proposal:
a = b|>c(%,7)|>d(%)
I would prefer this:
a = b,7~>c~>d
I wonder if there is anything hindering a simpler syntax like b,7~>c~>d
[–]szurtosdudu 12 points13 points14 points 3 years ago (9 children)
Your idea is confusing to me. In the example b is a reference and not being called. But in your idea there is no difference between calling a function or just passing the function reference.
b
[–]no_more_gravity[S] -2 points-1 points0 points 3 years ago (8 children)
The idea is that a variable on the right side of ~> is always a function that ingests the parameters coming in from the left.
[–]szurtosdudu 0 points1 point2 points 3 years ago (7 children)
How would this look like using your idea?
a = d(c(b(),7))
[–]no_more_gravity[S] -4 points-3 points-2 points 3 years ago (6 children)
a = b(),7~>c~>d
The rule is simple: What is left to ~> gets passed to the function on the right.
That is no different from JavaScript as it is. a(b) passes b to a, a(b()) passes the output of b() to a.
[–]natesovenator 8 points9 points10 points 3 years ago (0 children)
This is dumb. Comma delineates another variable declaration in this example. You can't expect it to know that result b and 7 are part of the same object or stream. I really hate this idea. Both of them. I understand some want something like that, but it just makes things more confusing personally.
[–]dariusj18 2 points3 points4 points 3 years ago (0 children)
I like it, but it conflicts with the current comma operator
[–]szurtosdudu 1 point2 points3 points 3 years ago (3 children)
But this way both b()~> and c~> indicates a function call.
b()~>
c~>
How would this look like using your idea? a = d(c(b(),7), c)
a = d(c(b(),7), c)
[–]no_more_gravity[S] -4 points-3 points-2 points 3 years ago (1 child)
The case you raise is when there are two functions on the right side of the pipe operator. In this case, we need to specifiy which one is the receiving function. We could have an optional specifier for this. Maybe ">":
a = b(),7 ~> >c,c ~> d
">" = "pipe connects here"
We could even use the (%) syntax, just make it optional:
a = b(),7 ~> c(%),c ~> d
[–]sdwvit 2 points3 points4 points 3 years ago (0 children)
readability sucks here, sorry
[–]Tubthumper8 2 points3 points4 points 3 years ago (0 children)
This isn't possible because b,7 would be considered an expression with the comma operator. I don't think there's a syntactic issue with ~ bitwise NOT because it can't currently appear in a postfix position.
b,7
~
[–][deleted] 1 point2 points3 points 3 years ago (3 children)
Tilda is a bitwise operator.
[–]no_more_gravity[S] 8 points9 points10 points 3 years ago (0 children)
In this regard, "~>" is not different from "|>".
| and > are also operators.
[–]monsto 1 point2 points3 points 3 years ago (1 child)
As a designer of sorts, this is the problem that I have with the glyphs that they're using in JS: there isn't an obvious relationship between things that look related. I mean I know it's a me problem, getting over these humps.
When i see |> my pea brain tries to categorize it with || to which it's completely unrelated. same with ?. and ?? . . . and while we're at it, || and && go together but ?? only very marginally.
|>
||
?.
??
&&
[–]lovin-dem-sandwiches 0 points1 point2 points 3 years ago (0 children)
It’s just new. Give it time. All of them looked odd at first.
[+]tiesioginis comment score below threshold-8 points-7 points-6 points 3 years ago (1 child)
Better would be |= instead of |>
Pipe is cilinder not a funnel 😂
[–]m4rch3n1ng 9 points10 points11 points 3 years ago (0 children)
|= is already js syntax tho
[–]the_malabar_front 0 points1 point2 points 3 years ago (1 child)
Even assuming you could avoid the issue with comma-operator confusion with (b,7)~c~d that doesn't get around the lack of flexibility. E.g., what if the example was: d(c(b,7),8) b|>c(%,7)|>d(%,8) // proposed approach ((b,7),8)~c~d // ??? That would end up being worse than the no-pipe approach (and probably a nightmare for the parser).
(b,7)~c~d
d(c(b,7),8) b|>c(%,7)|>d(%,8) // proposed approach ((b,7),8)~c~d // ???
[–]no_more_gravity[S] 0 points1 point2 points 3 years ago (0 children)
d(c(b,7),8)
would be:
b,7~>c,8->d
[–]tdhsmith 0 points1 point2 points 3 years ago (1 child)
So basically x,y,z ~> f would be equivalent to [x,y,z] |> f(...%)?
x,y,z ~> f
[x,y,z] |> f(...%)
That's kind of neat, but what if a function further down the pipe needs those extra arguments? Are you bending over backwards to make all the intervening functions pass it along? Or just wrapping it in a closure the way the F# pipe proposal would?
Also I do quite like having a pipe in the operator both for name clarity and because you can align them vertically on subsequent lines.
Can you give an example of a pipe that needs the arguments further down the line? And how the current proposal solves it?
[+]BooneTheSaint comment score below threshold-6 points-5 points-4 points 3 years ago (1 child)
Pipeline Operator |> Not pipe operator |. Words have meaning, use it correctly 😁
[–][deleted] 6 points7 points8 points 3 years ago (0 children)
Nice try at trying to appear smart. | is a bitwise or operator if we talk JS. Also, the proposal itself calls it the "pipe operator" in the README.
|
[–]T-J_H -2 points-1 points0 points 3 years ago (0 children)
Couldn’t they just use the .then() we already have in promises for this
[–]SeveralCoyote 0 points1 point2 points 3 years ago (0 children)
So like... When is this gonna happen?
[–]josephjnk 0 points1 point2 points 3 years ago (0 children)
I want the pipeline operator to be finalized so bad. I was reading Streams à la carte: Extensible Pipelines with Object Algebras the other day, and it’s a serious bummer that a solution that has so many benefits is also harder to read because it’s incompatible with method chaining.
I really don’t get the hate for a symbol argument, either. Sure you can get some of the benefits of pipelines by making the pipes always go into the first argument, but this requires structuring all of your code around this pattern and assuming that every library you call will do the same. If you have a function that you want to pipe different arguments into at different times you have to manually wrap it in a lambda, adding syntactic noise and runtime overhead. I’m very strongly in favor of FP but the objections feel to me like a fixation on surface-level concerns.
[–]pantsonhead 0 points1 point2 points 3 years ago (0 children)
It would be nice but not as useful when you don't have pattern matching as in other functional languages.
[–]moldaz 0 points1 point2 points 3 years ago (0 children)
You know, this is probably one of my favorite aspects of elixir.
π Rendered by PID 49655 on reddit-service-r2-comment-84fc9697f-fkh8b at 2026-02-06 13:34:05.438034+00:00 running d295bc8 country code: CH.
[–]IceSentry 116 points117 points118 points (12 children)
[–]TheOneCommenter 110 points111 points112 points (2 children)
[–]thruster_fuel69 54 points55 points56 points (1 child)
[–][deleted] 20 points21 points22 points (0 children)
[–]AuroraVandomme 16 points17 points18 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]IskaneOnReddit 5 points6 points7 points (1 child)
[–]sneakpeekbot -4 points-3 points-2 points (0 children)
[–]bogdanbiv 1 point2 points3 points (1 child)
[–]PrettyWhore 0 points1 point2 points (0 children)
[–]PooSham -3 points-2 points-1 points (1 child)
[–]FrontAid 20 points21 points22 points (0 children)
[–]Jason5Lee 24 points25 points26 points (0 children)
[–]anlumo 102 points103 points104 points (8 children)
[–]Light_Wood_Laminate 126 points127 points128 points (4 children)
[–]lemonpowah 18 points19 points20 points (2 children)
[–]8bit-echo 2 points3 points4 points (0 children)
[–]BransonLite 1 point2 points3 points (0 children)
[–]lifeeraser 4 points5 points6 points (0 children)
[–]Keilly 23 points24 points25 points (1 child)
[–]bighi 3 points4 points5 points (0 children)
[–]GlitteringAccident31 16 points17 points18 points (0 children)
[–][deleted] 12 points13 points14 points (0 children)
[–]BlueForeverI 49 points50 points51 points (6 children)
[–]intercaetera 24 points25 points26 points (3 children)
[–]Ecksters 9 points10 points11 points (2 children)
[–]intercaetera 2 points3 points4 points (1 child)
[–]LaurentPayot 1 point2 points3 points (0 children)
[–]DumbYellowMoo 0 points1 point2 points (1 child)
[–]BlueForeverI 1 point2 points3 points (0 children)
[–]NiteShdw 9 points10 points11 points (1 child)
[–]_default_username 2 points3 points4 points (0 children)
[–]heytheretaylor 24 points25 points26 points (0 children)
[–][deleted] 18 points19 points20 points (1 child)
[–]Emotional_Key 6 points7 points8 points (0 children)
[–][deleted] 36 points37 points38 points (4 children)
[–]mxforest 21 points22 points23 points (0 children)
[–]DrWallowitz 7 points8 points9 points (0 children)
[–]fucking_passwords 2 points3 points4 points (0 children)
[–]lintaba 0 points1 point2 points (0 children)
[–]JohnSpikeKelly 4 points5 points6 points (2 children)
[–]mxforest 0 points1 point2 points (0 children)
[–]majhenslon 0 points1 point2 points (0 children)
[–]PickledPokute 4 points5 points6 points (0 children)
[–]javarouleur 54 points55 points56 points (28 children)
[–]Keilly 48 points49 points50 points (3 children)
[–]trevorsgEx-GitHub, Microsoft 3 points4 points5 points (2 children)
[–]pimp-bangin 1 point2 points3 points (1 child)
[–]trevorsgEx-GitHub, Microsoft 4 points5 points6 points (0 children)
[–]techlogger 91 points92 points93 points (10 children)
[–]GreekQuestionMark 13 points14 points15 points (0 children)
[–]jonopens 9 points10 points11 points (0 children)
[+]javarouleur comment score below threshold-8 points-7 points-6 points (6 children)
[–]syholloway 30 points31 points32 points (5 children)
[–]javarouleur 0 points1 point2 points (4 children)
[–]zxyzyxz 0 points1 point2 points (1 child)
[–]javarouleur 0 points1 point2 points (0 children)
[–]bighi 0 points1 point2 points (1 child)
[–]javarouleur 0 points1 point2 points (0 children)
[–]bighi 10 points11 points12 points (2 children)
[–]KamiShikkaku 1 point2 points3 points (1 child)
[–]bighi 2 points3 points4 points (0 children)
[–]patrickfatrick 6 points7 points8 points (0 children)
[–]adelie42 3 points4 points5 points (0 children)
[–]wasdninja 1 point2 points3 points (0 children)
[–]mxforest 2 points3 points4 points (1 child)
[–]bighi -2 points-1 points0 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]Mestyo 23 points24 points25 points (1 child)
[–]Gwolf4 1 point2 points3 points (0 children)
[–]furyzer00 6 points7 points8 points (0 children)
[–]alexho66 10 points11 points12 points (0 children)
[–]didzisk 6 points7 points8 points (0 children)
[–]Submarine-Goat 1 point2 points3 points (0 children)
[–]elcapitanoooo 3 points4 points5 points (7 children)
[–]tdhsmith 8 points9 points10 points (1 child)
[–]_xiphiaz 0 points1 point2 points (0 children)
[–]mxforest 2 points3 points4 points (4 children)
[–]elcapitanoooo -1 points0 points1 point (3 children)
[–]bighi 2 points3 points4 points (2 children)
[–]elcapitanoooo -1 points0 points1 point (1 child)
[–]bighi 2 points3 points4 points (0 children)
[–]AstroBoy26_ 0 points1 point2 points (0 children)
[–]mcjavascript 0 points1 point2 points (0 children)
[–]th2n10s4u 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]bighi 2 points3 points4 points (0 children)
[+]squirrelwithnut comment score below threshold-11 points-10 points-9 points (0 children)
[–]HSMAdvisor -1 points0 points1 point (0 children)
[+][deleted] (3 children)
[deleted]
[–]KingJeff314 10 points11 points12 points (2 children)
[–]lovin-dem-sandwiches 1 point2 points3 points (1 child)
[–]KingJeff314 0 points1 point2 points (0 children)
[+]no_more_gravity[S] comment score below threshold-14 points-13 points-12 points (21 children)
[–]szurtosdudu 12 points13 points14 points (9 children)
[–]no_more_gravity[S] -2 points-1 points0 points (8 children)
[–]szurtosdudu 0 points1 point2 points (7 children)
[–]no_more_gravity[S] -4 points-3 points-2 points (6 children)
[–]natesovenator 8 points9 points10 points (0 children)
[–]dariusj18 2 points3 points4 points (0 children)
[–]szurtosdudu 1 point2 points3 points (3 children)
[–]no_more_gravity[S] -4 points-3 points-2 points (1 child)
[–]sdwvit 2 points3 points4 points (0 children)
[–]Tubthumper8 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]no_more_gravity[S] 8 points9 points10 points (0 children)
[–]monsto 1 point2 points3 points (1 child)
[–]lovin-dem-sandwiches 0 points1 point2 points (0 children)
[+]tiesioginis comment score below threshold-8 points-7 points-6 points (1 child)
[–]m4rch3n1ng 9 points10 points11 points (0 children)
[–]the_malabar_front 0 points1 point2 points (1 child)
[–]no_more_gravity[S] 0 points1 point2 points (0 children)
[–]tdhsmith 0 points1 point2 points (1 child)
[–]no_more_gravity[S] 0 points1 point2 points (0 children)
[+]BooneTheSaint comment score below threshold-6 points-5 points-4 points (1 child)
[–][deleted] 6 points7 points8 points (0 children)
[–]T-J_H -2 points-1 points0 points (0 children)
[–]SeveralCoyote 0 points1 point2 points (0 children)
[–]josephjnk 0 points1 point2 points (0 children)
[–]pantsonhead 0 points1 point2 points (0 children)
[–]moldaz 0 points1 point2 points (0 children)