On Sunday, June 17, 2012 9:09:23 AM UTC-6, Vinzent wrote:
>
> This still requires changing your code to @(:emails contact).  If you use 
>>>> (emails contact) you need change your code in only one place. 
>>>>
>>>
> The name "emails" implies that it's a sequence. Lazy sequence. 
>

Yes it is... emails was not the best example in this case.. think the 
"area" example instead as this is single value rather than collection. Lazy 
sequences also introduce additional problems... they maybe "realized" when 
bindings are no longer in effect which causes all sorts of non-local errors 
with stacktraces that are completely non-intuitive. 


 
>
>> Property is just the OO word for function, semantically they are the 
>> same. OO doesn't have functions they have properties and methods.  
>>
>
> I thought the concept similar to function in OO-world is "method". Ok, so 
> if property is a function, then you want to get rid of data structures at 
> all and have only functions?
>

Yes, always access a map value via a function, this provides a "seam" (see 
Feathers, Working Effectively with Legacy Code 
http://www.informit.com/articles/article.aspx?p=359417) where alternative 
behavior could be introduced. Keywords are functions, but their behavior 
cannot changed therefore they do not make for useful seams.  The data still 
needs to be stored some where so you will have maps and will still need to 
use keywords to access that data... but that keyword usage should be in 
only one place so that when you do change the data structure eventually you 
will need to only update that one function.
 

>
> Agreed, clojure has a much stronger emphasis on immutability than 
>> traditional OO programming and is what I like about it... but it is 
>> possible to write OO code using immutable data structures but is not as 
>> idiomatic.
>>
>
> Well, it's kind of idiomatic in scala, for example. But not in clojure, 
> yes.
>

Agreed, I did not like scala's excessive use of operators, implicit 
conversions and other syntax tricks.  Plus the compiler is painfully slow.
 

>  
>
>>  I don't want clojure to be like CLOS, but I also don't think that we 
>> should ignore more than 50 years of lessons learned and "SOLID" programming 
>> principles.
>>
>
> SOLID is about object-oriented design. 50 years of lessons learned tell us 
> that objects have failed :) 
>

I disagree.  I don't think OO has failed us...MOST software is written in 
OO languages.  Lisp and various functional languages are much older than 
OO, yet were not widely adopted for commercial use. I'm not saying OO is 
perfect or that there is no room for improvement, thats why I tried clojure 
in the first place, but perhaps OO has been far more successful then you 
give it credit for and certainly more successful in practice then these so 
called "academic" languages.

 

-- 
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