|
|
|
|
|
by freshhawk
4936 days ago
|
|
Heh, never seen someone so defensive about using Haskell before. I'm not sure that the "here's now to do this Ruby thing in Haskell" method of learning Haskell is a good way to go about it. It would work well to teach Python or JS but not a Lisp or Haskell or Prolog. They differ at a lower level and require different mental models to even understand them, nevermind thinking in them. I don't see it helping if you are trying to cram monads, laziness, side effect free programming, inferred types and new syntax into the mental model of code execution you use for Ruby. Has anyone learned that way and found it useful? Do you learn a few things in a familiar context while cargo-culting the rest and then fill in the gaps later? Does it just click all of a sudden? My biggest struggle was learning to think in Haskell and this type of mixed metaphor teaching material would just make things worse. That might not apply to everyone, but if it applies to you then you aren't alone. Try learning the execution model with little toy programs first, then move on to the kind of software you are used to writing once you know how to look at Haskell code and reason about what it does. |
|
That's how I learned to write my first useful programs.
Maybe there is a better way, but that is the direct answer to your direct question.
Except I wouldn't say that it clicks "all of a sudden". It's a long process of learning. One day something doesn't work, and you think it should, and you just keep narrowing it down and eventually come to some deeper realization. It's the top-down approach to learning.
I've been trying to learn haskell bottom-up for a while, and I've done a few things and have some understanding of the theory. But I don't have anything to show for it. Every time I learn some new theoretical thing, I think "wow, what could I program with this?", at which point I've already lost. Because once I start thinking about the language rather than the utility, I'm not likely to create anything amazing.
I think that I'd be more successful if the next idea I had I just coded up in haskell (even though I don't really know it) and pushed through to a solution by any means necessary. But for me, learning a new language is secondary to realizing my visions; and my visions rarely start from an empty file any more.
That being said, I think a mix of bottom-up and top-down is probably best. There are some fundamental things that you need to learn deeply at some point to be good. Not sure the exact stages that these things should be learned, though.