Re: [ljc] How to think as "functional language programer"

From: Alex F.
Sent on: Wednesday, October 2, 2013 12:02 PM
This is my main problem, Im glad other people have it as well.

Im going through SICP and learning Scheme and Clojure currently, yet years of thinking in OO and doing Java dev have broken my mind and everytime I see a problem I know how to solve it easlily in Java / OO but cant see a easy way in functional.

Its deffo lack of experiance in functional stuff on my behalf, as opposed to the paradigm being wrong.  I want to find a book that can break my mindset and think in that way rarther than get so far and then re-write it in OO/Procedual.

Im really interested in the OPs question, and hope that any sources are not just solving maths problems but involve state / db / messages etc which I cant see how to solve functionally.

Cheers,

Alex (a LISP / functional lover but idiot (braces included as a means to a joke ;) ))


On 2 October[masked]:43, Martijn Verburg <[address removed]> wrote:
Hi Sivaji,

Thanks for speaking up about this - I think a lot of developers who have been using Java and other OO languages for a long time can and do need time to swap to the functional methodology. It's *not* because the developer isn't smart enough or is incapable, it's simply a very different way of thinking and it takes time to rewire the brain.

A couple of small things which might help:

* The OReilly "Functional Programming for Java Developers" title, whilst not perfect is a good place to start - http://shop.oreilly.com/product/0636920021667.do

* For me it helped that I'd done SmallTalk in the past and saw OO as passing messages/events between immutable objects. This mimics one common aspect of pure FP in that you never change state, e.g. 2 + 4 = 6 - When you add 2 to 4, you're not changing the value of either 2 or 4, you're applying a function (of sorts) and creating a new value 6.

It's not the *only* aspect to functional programming, but I found it helped me overcome one aspect.

I'm sure others more experienced at teaching FP will weigh in :-)


Cheers,
Martijn


On 2 October[masked]:38, Sivaji <[address removed]> wrote:
Hi all,
recently I have started learning Scala course offered by coursera (by martin odersky) but I am still not getting the crux of it by writing programs in functional way. Most of the time I am thinking like a imperative prog language developer and all examples/exercises are given in the course need to be solved with out mutation (complete functional).

so my question is, Is this quite normal for a developer from java background or you have any learning resources to tune my mind to write programs in functional programming language as well... I am loosing confidence for the first time as I am struggling to write a simple dummy tweeter application,.Scala language syntax/constructs/concepts are not a problem to understand but thinking everything in recursion and thinking very abstraction is nightmare for me now. Anybody faced similar issue (may not be with scala but other functional prog language) and want to share their experiences, it is highly appreciated??

thanks
sivaji k




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Sivaji ([address removed]) from LJC - London Java Community.
To learn more about Sivaji, visit his/her member profile
To report abuse or block this person, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Martijn Verburg ([address removed]) from LJC - London Java Community.
To learn more about Martijn Verburg, visit his/her member profile

To report abuse or block this person, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

Our Sponsors

  • Our Blog

    Read the latest news from the LJC

  • RecWorks Ltd

    Fixing Tech Recruitment using the Power of Community

  • jClarity

    Java/JVM Performance Analysis Tools & mentoring for Java related matters

  • LJC Aggrity

    Our LJC Aggrity site contains blog posts from our members

  • LJC Book Club

    Our Book club with book reviews from our members

  • Devoxx UK

    Java Community Conference, in collaboration with the LJC 12/13 Jun 14

  • SkillsMatter

    "Host, help organise, promote, film many of our meetings."

  • New Relic

    New Relic makes sense of billions of metrics a day in real time.

  • Hazelcast

    Hazelcast is the leader in operating in-memory computing.

  • Packt Publishing

    A publishing company specializing on specific technologies and solutions

  • Java.Net

    We are an official Java User Group recognised by Oracle's JUG program

  • JRebel

    Free 3 month J-Rebel license.

  • O'Reilly

    40% discount on printed books and 50% on e-books.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy