• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Grokking FP: data vs types?

 
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's nice to see another book focusing on making FP techniques more palatable to a wider audience! Manning certainly seems to have been a tear with this topic lately, which is a good thing as far as I'm concerned.

Your book focuses on statically typed FP techniques -- comparing Java and Scala -- but we've also recently had Grokking Simplicity, which aims to teach FP using JavaScript as an example language and therefore dynamically typed, and Data Oriented Programming, which uses Java as the example language but focuses on "pure data" using generic data structures and mostly avoiding the static type system.

Could you comment on what you see as the pros and cons of static typing in the context of FP, as a way to compare and contrast your book's approach to those other two?

In particular, how do you feel about Alan Perlis' quote "It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures." which many people feel argues more for generic functions on generic data structures? Alan Perlis -- Epigrams in Programming
 
Author
Posts: 31
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My stance is rather boring and not controversial.

Static vs Dynamic is such a long-running dispute... But there are no real research results that undisputably prove that one of them is better than the other.

So I think it's all a matter of preference and it's good that many FP techniques are shared between static and dynamic languages. This makes them universal!

Having said that, I prefer static languages because I like my compilation errors and tight feedback loops. Also, as far as the book is concerned, static languages are still a bit more popular for bigger enterprise systems which are the majority of systems the readers are working with.

Also, I love the other two books you mentioned.
 
Sean Corfield
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michał Płachta wrote:I think it's all a matter of preference



I agree and, yes, I also see FP techniques as universal, regardless of language and regardless of static vs dynamic typing!

Also, I love the other two books you mentioned.



Oh, cool. Yes, I've enjoyed them both immensely (I know both authors personally so it's been interesting to watch them writing new material in this ever-more-popular field).

Thank you, Michał!

 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm really happy to hear about these three books being discussed together!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic