On 2010-09-02, at 10:02 PM, HB wrote:

> So in idiomatic Clojure applications, maps are considered like
> objects?
> And to operate on them we pass them to functions?

I think that considering maps as a state representation is reasonable. There 
are alternatives, but that's fine-tuning I think.

There's a lot you're going to have to take in, but I suspect the biggest 
sticking point will be around values/immutable-state, references to that state, 
and when/how the reference changes. When you get this, you'll be able to see 
how state/reference/time relate to the OO concepts you already know. At which 
point you'll be laughing.

I don't remember anybody I've worked with that has had any difficulty with 
picking up functional programming (aside from the immutability thing). It's one 
of those things that changes how you work forever -- you are going to feel pain 
when working with Java :-)

I strongly second the recommendation of the book "Joy Of Clojure" as a next 
thing to read (it's from Manning and you can get from their MEAP in pdf/epub 
formats)

Cheers,
Bob

> 
> On Sep 3, 4:55 am, David Nolen <dnolen.li...@gmail.com> wrote:
>> On Thu, Sep 2, 2010 at 9:29 PM, HB <hubaghd...@gmail.com> wrote:
>>> Hey,
>>> I finished reading "Programming Clojure" and "Practical Clojure" and
>>> I'm hooked :)
>>> Please count me in the Clojure club.
>>> But I failed how to think in Clojure.
>>> My main career is around Java web applications (Hibernate, Spring,
>>> Lucene) and Web services.
>>> Lets not talk about Java web frameworks neither Clojure ones, I want
>>> to talk in general.
>>> Usually we create some domain entities, map them with Hibernate/
>>> iBatis.
>>> I don't know how a Clojure application would be build without objects.
>>> I think Scala really shines here, this OOP/FP is really powerful
>>> approach (please note I'm not saying Clojure isn't good, I don't seel
>>> flame war)
>>> How to think in Clojure? how to achieve this shift?
>> 
>> It does require a significant shift in thinking. I think you'll be surprised
>> how far maps and functions will take you if you're used to thinking in OOP.
>> 
>> And contrary to popular belief Clojure is also a hybrid OOP/FP approach:
>> multimethods, protocols, deftype, defrecord, definterface, etc. will let you
>> utilize the better aspects of OOP design. However you should be cautious to
>> reach for these. They are easily misapplied. Stick with the core
>> datastructures (maps, vectors, sets, lists) and fns and you'll do just fine.
>> 
>> David
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

----
Bob Hutchison
Recursive Design Inc.
http://www.recursive.ca/
weblog: http://xampl.com/so




-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to