3 ms·
Programming languages are not natural languages. And where imperative programming can benefit from something that looks like a series of instructions resembling
by rollo 13y ago
Programming languages are not natural languages. And where imperative programming can benefit from something that looks like a series of instructions resembling natural language, functional, declarative programming works better with the language being closer to mathematical notation.
- jkrems 13y agoIf I can't talk to you about it (e.g. I have to literally say "Oh, you forgot to declare a way to apply the greater than-greater-than-equal operator!"), it's hard to actually reason about a problem domain. It's like the magic moment where you go from stumbling through cryptic signs to being able to fluently read (aloud) complex math or logic formulas. I doesn't need to resolve to a normal, casual sentence you'd drop chatting with your cab driver - but there should be a way to pronounce it. P.S.: I guess what I'm trying to say is - every normal mathematical expression has a way to pronounce it. "plus", "for all x", "there exists an x", "sum of", "element of", ...
- codygman 13y agoYou wouldn't have to say "Oh, you forgot to declare a way to apply the greater than-greater-than-equal operator!", you would say "Oh, you forgot to declare a way to apply the bind operator!". Now that you know that, you can stop saying that ">>=" doesn't have a name? You are upsetting poor bind :/ Also here is a great explanation with pictures that helped me understand it: http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html#monads http://adit.io/posts/2013-04-17-functors,_applicatives,_and_...
- jkrems 13y agoThanks! That article is pretty awesome. It would slightly more awesome if it would use the analogies "bind"/"feed"/"chain" that apparently are more often used to speak about it. But I could consider calling it the "shove" operator from now on. ;)
- codygman 13y agoHey no problem! I used to see Haskell as needlessly complex, unapproachable, and not usable in the real world and now realize that was a mistake, so I just try to show people what I've found out/learned when i can :)