Re:Functional programming for Object Oriented programmers
by marshallp on Thursday November 24, 2011 @11:47AM
(#3274781)
One thing missed in a big way by this article and other newbies when it comes to (static) functional programming is the centrality of types. It really is what makes ml-derived languages special and it's a shame it's not promoted to non-functional programmers more. Most of your work is related to specifying your types, the rest falls into place naturally, and is why you can think and write code elegantly (and is super fun).
[ Parent
| on HN ]
Re:Functional programming for Object Oriented programmers
by lifebeyondfife on Thursday November 24, 2011 @12:00PM
(#3274809)
Thanks for the feedback. To be honest I haven't really grasped all the ins and outs of functional programming yet so tried to ignore it as a first step. From what I've seen so far, I do like how much all the typing takes care of itself.
Re:Functional programming for Object Oriented programmers
by mushishi on Thursday November 24, 2011 @02:55PM
(#3275259)
I would really like to hear more about this. I also do type-oriented programming in OO languages, such as Java. The code naturally falls into place, too, but it's just because of Java's verboseness, you end up a lot of hand-waving. But I don't think it differs much from how I would program in functional style, say, in Scala.
Re:Functional programming for Object Oriented programmers
by jberryman on Thursday November 24, 2011 @05:53PM
(#3275638)
This talk by Simon PJ on type classes might be good http://channel9.msdn.com/posts/MDCC-TechTalk-Classes-Jim-but...
Re:Functional programming for Object Oriented programmers
by mushishi on Saturday November 26, 2011 @01:31AM
(#3279256)
I actually have that on a browser tab, and will take a look at it. I know some Haskell (have read maybe 4 books but haven't really ever wrote it).
Re:Functional programming for Object Oriented programmers
by marshallp on Thursday November 24, 2011 @03:38PM
(#3275358)
it all depends on your problem. for gui programming oo code is natural, for transforming complex data structures ml is natural. transforming xml is a horrible mess in java, so xslt is recommended, and xslt is pretty much ml (one of the creators of haskell was a contributor to xslt). it's not matter of java verboseness, even python or lisp isn't well suited to dealing with complex datastructures because they lack the pattern matching over compiler enforced datastructure machinery.