Re: Closures versus objects

Glenn Vanderburg <[email protected]>
Newsgroups gmane.comp.lang.lightweight
Message-ID <[email protected]>
> However if I understand the moral of the tale it is the theoretical
> isomorphism.  But is there no benefit in practice to having access to
> both?

I think there is definitely benefit, because expression (and style of  
expression) is important in software.

I'm an OO guy, for the most part ... I feel very comfortable in Ruby  
and Smalltalk (and to a lesser degree Java), and although I've done  
quite a bit of Lisp over the years, that way of thinking still feels  
a bit awkward to me.

But I find OO languages without closures to be cumbersome to work  
in.  And earlier this week, doing a little work in JavaScript, I  
started out with a design centered around objects, and then found it  
beneficial to switch to closures.  I've experienced other cases where  
moving in the opposite direction improved the design, but in this  
situation objects were definitely a poor man's closures rather than  
the other way around.

(And coincidentally, on Monday I wrote in my design notes about the  
decision, using that very wording taken from van Straaten's little  
koan, before Avi chimed in with it today.  :-)

---Glenn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.