4 ms·
The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Pyt
by prg318 14y ago
The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc). I'm not really sure from the article what I am supposed to gain by learning Haskell.
I'm not debating the opinion that Haskell is great language to learn, but the benefits of learning the language were not clear to me after reading the article. Does anyone care to elaborate?
- deleted 14y ago[deleted]
- deleted 14y ago[deleted]
- jerf 14y ago"The skill of breaking down large functions into smaller simple functions is a common skill of programming and should be practiced in all languages (C, Java, Python, etc)" Haskell will show you that when you thought you broke your code down into small functions in those languages, you were wrong in ways you currently can't even see and they're still shot through with duplication and mixing of concerns. This is really the core of the "it changes how you program"; the environments you mention are so full of conflation of IO and mutation and state that you don't even see it, because it's just the way it is. Haskell will ungently pry those apart for you, if you stick around long enough to actually become proficient. You can take this back into other programming languages where this separation is not enforced, but I'm not convinced you can learn it where it is not enforced. The feedback cycle is so direct in Haskell ("Type Error: ...") and so diffuse in other languages (two months later "Aw crap, I should have isolated IO from non-IO better..."). (Oh you think that last parenthetical is a joke? Ha! I wish.)
- prg318 14y agoThank you (and jochu and pilgrim689) for elaborating on this. I hope to take the plunge at some point and learn Haskell! It seems like an interesting perspective on programming.
- xaa 14y agoLearning Haskell taught me that mutation and state are good things, present both in the fundamental nature of computers and the real world. Haskell's attempts to eliminate state entirely results in a profound increase in complexity. For me, learning Haskell was like visiting a third-world country: enlightening, very different, but ultimately I leave feeling very grateful that I'm not a permanent resident. All in all, I would recommend the experience.
- papsosouid 14y agoIt doesn't sound like you actually did learn haskell. Haskell does not in any way make any attempt to eliminate state, and the idea that it does is absurd. Why would the language ship with a module called "State" if it were trying to eliminate state?
- rafcavallaro 14y agoSubstitute "treat like a pariah" for "eliminate" and you're good to go!
- ibotty 14y agono state in haskell? not in my haskell. state is usually made explicit, yes. there is a state monad because of a reason...
- nightski 14y agoSo obviously you were not very enlightened because it makes no such attempts.