4 ms·
Yes I have, I helped teach some CS courses in college, plus I myself learned them in my very earliest days of programming. It's pretty common for those to be am
by ninkendo 5y ago
Yes I have, I helped teach some CS courses in college, plus I myself learned them in my very earliest days of programming. It's pretty common for those to be among the first concepts taught.
I'd say that your list is full of things that have practical examples when you consider how real, physical computers work. Boolean logic can be shown by example by showing physical transistor circuits, and I'd argue that people can understand them quite easily. Pointers/variables can be shown by explaining how memory addressing works on real machines, and what CPU instructions correspond with the actual code you're writing.
Monads however, seem to be this purely abstract mathematical concept that comes from CS-as-a-math-discipline, which although useful, requires you understand ton more theoretical background before you can approach it. At least that's my experience -- I still don't understand them and every tutorial I've read either makes them look like magic (ie. doesn't actually explain them) or tries to take a mathematically rigorous approach and I get lost in the weeds.
I know intuitiveness is very subjective, but I'd wager that by numbers, many more people are able to understand pointers/mutable variables/macros/boolean logic/etc more easily than they can Monads.
- chongli 5y agoYou don’t need much of any theoretical mathematical knowledge to understand monads. What you need is comfort and experience reading mathematical definitions. For most people, that means they’ve studied a lot of math. The famous John von Neumann quote is bang on here: Young man, in mathematics you don't understand things. You just get used to them. —- John von Neumann
- chobytes 5y agoI agree. Almost all of the difficulty is just not getting how mathematicians think or communicate. Honestly I think a lot of effort is wasted starting with this stuff rather than more motivated examples... But the interest is the harder thing to come by, so at least they're learning something.
- ninkendo 5y agoI don’t mean to stir the pot here, but that’s a pretty unhelpful comment. You could basically rephrase it as “you don’t need a lot of math, you just need a lot of math”.
- marcosdumay 5y ago> Monads however, seem to be this purely abstract mathematical concept that comes from CS-as-a-math-discipline Well, if they were, all those people wouldn't be trying to understand them. They are applied on Haskell (and Javascript, Rust, C#... but they are way more visible on Haskell). Write some Haskell and you will get them.
- ninkendo 5y agoWhat would be my motivation for learning Haskell other than learning monads? Learning an entire programming language (one that expressly states practicality as one of its non-goals and ostensibly only exists to advance type theory) just to that I can learn a concept that only appears useful in that language, seems like a waste of my limited time.
- marcosdumay 5y agoIt's "write some Haskell", not "learn Haskell". It's much harder to learn Haskell than understanding monads, you just need to see how some look like on practice. But, well, I don't have any reason for you to do that. You just asked how, and I gave you a way. If you don't have any interest in learning it, there's absolutely no problem, but posting "I never really tried, but that thing is bad because I haven't learned it already" FUD is pretty bad.
- ninkendo 5y agoMy contention is that people are learning monads because they’re on a journey to learn Haskell, then when they finally grok them, they turn around and say they’re this big important thing that all programmers should understand, because Haskell showed them how important they are. But so far, no monad tutorial has made a good case for why they’re actually useful, other than for learning Haskell. And most advice for how to learn them sounds exactly like what you said: “oh if you still don’t get it, you just need to write more Haskell.” You can see why that’s a bit of a disappointment, right? Basically, you have people making this argument: - monads are important outside of Haskell - to understand why, you have to learn them - to learn them, you should write Haskell Which I’m sure you can understand comes off as a bit unconvincing.
- JoelMcCracken 5y agoMy advice: Try these two tutorials: http://www.jerf.org/iri/post/2958 http://www.jerf.org/iri/post/2958 https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/ https://philipnilsson.github.io/Badness10k/escaping-hell-wit... The first one I think cuts through all of the crap surrounding them. They're just a design pattern. And the second one helps motivate them, showing the many contexts where the design pattern many apply.
- JoelMcCracken 5y agoIf you're still confused after having gone through these, and want to understand, shoot me a message (email in bio) and we can hash it out.