3 ms·
> Railway Oriented Programming This term needs to die. I have lost count of how many times people have asked me, on my language-ext [1] issues pages, if the l
by louthy 3y ago
> Railway Oriented Programming
This term needs to die.
I have lost count of how many times people have asked me, on my language-ext [1] issues pages, if the library supports "Railway Oriented Programming". The documentation is clear, it is an FP library with many monads, functors, etc.
Inventing new terminology for existing concepts just creates even more confusion.
Creating completely new terminology for existing concepts just because you don't like the words is utterly baffling. Learn them. If you're going to teach monads then by all means use railways as an analogy, but don't call it "Railway Oriented Programming", you are just misleading the reader and not helping them communicate with others in the FP community.
Did anyone know what 'polymorphism' was when they first encountered OOP? No, they learned what it meant. Learn what 'monad' means, learn what 'functor' means, learn what 'applicative' means. You'll be enlightened.
OOP people: not everything needs to be 'oriented' ;-)
[1] https://github.com/louthy/language-ext/ https://github.com/louthy/language-ext/
- FrustratedMonky 3y agoIt is a handy metaphor. Like all handy metaphor's, it helps people conceptualize an idea. That doesn't mean it is a strict technical term, you can break down all metaphors if you want. "He is the light of my life." "NO, he is not a 'Light', he is a human, read a biology book". LOL. Just realized you are Drax? Drax is posting on HN?
- louthy 3y agoSure it's a metaphor and as I state, there's nothing wrong with using the railway analogy, but renaming 'monads' as 'Railway Oriented Programming' is having the effect that newbies to FP-land think that's what _programming-with-monads_ is _called_. Then they try to have discussions with others in FP-land and realise they don't have the lexicon to talk about FP because they've been taught some spurious terminology. This is a monad tutorial, it is over 150 slides worth of explanation (probably the largest 'Yet Another Monad Tutorial' I've seen yet), there's no reason to leave the reader thinking they've learned some new concept called 'Railway Oriented Programming'.
- xupybd 3y agoSpecifically this is the error/result monad. This was the first description that made sense to me as a newbie to all of this. Monad was a scary word. This helped me understand.
- FrustratedMonky 3y agoI was being bit harsh. Upon reflection I think you have a good point. When learning about functional programming, the metaphors did help. But then later it was hard to recognize them in other languages that used different metaphors for same thing. (maybe all language is metaphor?). So if F# Computation Expression, was little more expressly outlined as a 'Monad', and how, maybe that would help. It just can't be all at once when learning. Same for <Option> and error handling. There is the baby-step phase, then growing into details. So this railway presentation might have been helped by a little cross-connecting the 'simple helpful metaphors', with the 'technically correct words you'd find in a math book or something'. Like a few slides at beginning or end, with further reading or examples showing 'simple metaphor' = 'over complicated word'. This does happen in objects. How many 'typical introduction' books spend a lot of time talking about Ducks and Dogs, and Quacking and Barking, Is-A, Has-A, before it gets into technical terminology? People still talk about 'Duck Typing'. Not the technical word. Maybe that is bad also.
- louthy 3y agoThank you for that. One series that I thought did this really well was the Eric Meijer (father of LINQ in C#) lectures on FP fundamentals [1]. It was very much for OO programmers to get up to speed with FP and it was taught using Haskell. He goes through the series, building up a parser in Haskell, and then at the end (or a reasonable way through) he says "and that's a monad". Never once mentioning it until the watcher had grokked all the concepts up until that point. That 'big reveal' idea I think is probably the best way to do a monad tutorial, because it forces the tutor to stick to the motivations and the fundamentals. [1] https://www.youtube.com/watch?v=UIUlFQH4Cvo&list=PLoJC20gNfC2gpI7Dl6fg8uj1a-wfnWTH8 https://www.youtube.com/watch?v=UIUlFQH4Cvo&list=PLoJC20gNfC...
- GhostWhisperer 3y agoif people cannot learn the concepts when presented with the monad and functor names, but somehow are able to understand them when given different names, it seems the issue is the names are bad what is creating confusion is this need to sound like a pompous academic by sticking to old terminology that serves no purpose but to make their users sound enlightened and the subject hard to grok the functional programming community could gain a lot from making it's subject more accessible, not less
- louthy 3y agoHow is it any different to someone learning OOP? * Objects * Class * Interface * Polymorphism * Parametric polymorphism * Methods * Method dispatch * Inheritance * Singleton These bear no relationship to the real world usage of these words and some are straight out of mathematics/academia also. Would you expect FP people landing in OOP land to rename all of these concepts just so FP people can understand OOP languages? Or would you expect them to learn the shared lexicon of OOP-land? It isn't pompous to have a name for something and then expect people to learn those names if they want to learn the subject. Pomposity would be attaching "oriented programming" to the end of all concepts that you don't understand and telling the world to use your new terminology whilst trampling over the existing community. Clearly grokking monads is hard. But it's nothing to do with the terminology. This presentation has over 150 slides - so even when it's called 'Railway Oriented Programming' it takes 150 slides worth of exposition to get the point across. I'd argue that the reader/listener would be in the same place if they'd have used railways as an analogy whilst telling the reader that they're learning their first monad. 'Monad' may well be an awkward word but it's clearly the mental model of the monad that's the problem. I suspect (as someone who's taught how monads work many times) that part of the problem is that once we learn how monads work, we realise they're unbelievably trivially simple. And at that moment we instantly lose the ability to explain it to somebody else because of the 'mental perspective switch' that's just happened in our brains. So we end up with a 1000 'Yet Another Monad' tutorials. This may well be the best one. But it shouldn't mean you get to change the shared lexicon.
- piaste 3y ago
- bregma 3y agoCame here to read discussions on EN 50128. Was awfully disappointed.
- fsloth 3y agoI think it's quite common pragmatic patterns have multiple names and parallel theoretical frameworks within to understand them. "A monad" is just a name to the applied pattern. There is nothing called "monad" in C++ for example, but you can write expressions in C++ that are isomorphic with monads. That does not mean that "monad" is the only correct name for the pattern, given people are familiar with different names and theoretical frameworks for the given pattern. The fact that the pattern is recognized as 'monad' is really usefull of course, since that implies all sorts of other things that may turn out to be usefull. But it does not mean IMO it's wrong to call it by some other popular name. The analogue in mathematics is rotation in a plane of the unit vector. We can present it as pair (cos(alpha),sin(alpha), a 2x2 matrix (m00,m01,m10,11), or even a complex number e^i alpha. "I'm rotating a vector" ... "no no, you are perfoming a matrix multiplication" ... "don't be silly, it's a complex number"...