This week's book giveaway is in the Python forum.
We're giving away four copies of High Performance Python for Data Analytics and have Tiago Rodrigues Antao on-line!
See this thread for details.
Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

blogged about how i started thinking in functional programming

 
author & internet detective
Posts: 40400
821
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote up how I started thinking in functional programming rather than just writing Java code in Groovy.

How did you grasp the switch?
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice post. Next stop, monads!
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That makes my head hurt. I don't know if I'll ever get functional programming. I've tried and failed several times.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kevin, SICP -which I recommended here- is an excellent introduction to FP, IMO, if you want to give it another try.
 
J. Kevin Robbins
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the recommendation. I already have the instructors version of that book on my Wish List.

I've already tried "The Little MLer" and the "The Little Schemer" (not much help), and the site "Learn you a Haskell for Great Good", and tried the Coursera course. All very frustrating. Interesting, but frustrating.
 
Bartender
Posts: 4272
160
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Jeanne,

thanks for the clear blog. It caused me some mixed feelings, though...

Having just received my Scala certification of the Scala course in May and June,
I was certainly impressed by the power of functional programming, and I found it
a pleasure to use.

However, what gives me this mixed feeling, is that the first method
in your blog was very, very comprehensible. I just needed one look to
know what you were doing.

Then, looking at the last method in your block, indeed, powerfull, but I can imagine
someone looking at it needs at least two readings to understand what's going on.
(I'm not talking about all those FP experts around, of course).

Still thinking about this aspect...

Greetz,
Piet
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel the same as Piet. Furthermore, every other snippet of functional programming code/language I have seen, makes me "search for real content" between all those parenthesis, brackets and other such symbols and it straightaway turns my brain off. Maybe it's just a matter of indentation and perhaps getting used to it, but like Piet notes, I have usually found it hard to comprehend functional code. I do admit though that I haven't really put in efforts to learn the languages and get used to it, since I still haven't found a reason (other than everyone seems to want to use it these days) to use functional languages.

 
chris webster
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:... since I still haven't found a reason (other than everyone seems to want to use it these days) to use functional languages.


I'm working on a "skunkworks" project investigating Big Data technology, and we're looking at Apache Spark, which seems to be getting a lot of traction as an alternative/complementary technology to Hadoop and MapReduce. Spark is written in Scala and has strong support for Python, as well as a slightly less comprehensive Java API. It's written by some very clever people who have taken advantage of lots of very clever functional programming magic to make Spark perform well on massive volumes of data. I'm only writing my first, very simple programs with Spark right now, but I'm using Scala and trying to think functionally in order to make most effective use of the platform. And it's good fun to have an opportunity to try this FP stuff out for real.
 
Jeanne Boyarsky
author & internet detective
Posts: 40400
821
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Piet Souris wrote:However, what gives me this mixed feeling, is that the first method
in your blog was very, very comprehensible. I just needed one look to
know what you were doing.



I think that comprehensible feeling is from comfort with the language. This is essentially Java:


Piet Souris wrote:
Then, looking at the last method in your block, indeed, powerfull, but I can imagine
someone looking at it needs at least two readings to understand what's going on.
(I'm not talking about all those FP experts around, of course).



This is the after. It took me two readings at the beginning. But the Java version wouldn't have been immediately obvious to me 15 years ago either.


One reason I like the functional version is there is less to remember at once. grep is UNIX for search (Java 8 doesn't call it that though). So I know that I'm filtering the items for disabled. Then I can forget that and go on to the rest which is getting the names. In a longer chain of actions, this impact becomes more noticeable. I can replace three levels of nested loops with a functional programming chain.
 
Die Fledermaus does not fear such a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic