Ok, a couple of things...
I think we can all agree that if there is one thing that OO is doing
right is polymorphism (well...almost!)...the whole notion of
multiple-dispatch allows us to make decisions on a higher level - one
closer to our mental perspective...personally, whenever i see some piece
of code which is more or less a series of ifs and for-loops after 3-4
minutes i start to feel stupid - my brain starts to melt!!!...you can do
that in any OO language and people do do that!
if you 're talking about performance i totally get your point...on the
other hand, that particular multi-method i wrote will never seek
performance. In other, words noone will ever ask to turn his computer
off more than once, let alone in a tight loop...in fact this
function/multi-method will never see the light of day - i was just
messing about...
I have to grant you this however : i do come from a OO background but it
is not really my fault is it?...that is what they teach you at
practically all universities - nothign else. Basically this is what the
industry expects from you (so you can be replaceable - just as Rich said)...
Peace...
Jim
ps: looking forward to that essay of yours :-)
On 07/05/12 22:37, Aaron Cohen wrote:
I know this is a very common paradigm in OO (with principles such as
"prefer polymorphism to nested ifs"). I want to write a longer essay
here on my feelings about when to use polymorphism in clojure but not
on my iPhone ;)
Suffice it to say, there are definitely cases where polymorphism makes
sense in clojure, particularly when working with datatypes. I'd
recommend thinking about when it's appropriate though, particularly if
it's a lingering OO impulse that is causing you to reach for this tool.
--
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