On Saturday, August 4, 2012 8:30:50 PM UTC-4, Luc wrote:
>
> Count me as a fan I designed and wrote complex systems in assembly 
> language 
> many of them above 10k lines. 
>
>  
I can only admire you for that. Assemly language certain has its uses, but 
it is not really for average folks like me (I use assemly too for 
performance critical part, but not anything like 10k lines of code)
 

> Contrary to many commonly used languages, most assemblers have powerful 
> macros, 
> that feature alone allows you to implement sophisticated designs. 
>
> As far as your OO related comments, may I point to you that in Java you 
> will 
> find a common pattern (I hate this pattern concept) called a factory. 
>
> When I worked on Java (10 years ago, so I can be outdated), factory 
function was usually used to create different concrete objects confoming to 
common interfaces. Maybe now it is used a lot more, but still, I assume 
even nowadays you also "find constructors everywhere".
 

>
> Adding constructors to meet your need is against what OO does these days. 
> On what basis other than OO then should Clojure support constructors as 
> you suggest to allow some complex tweaking when creating a record ? 
>
>
The argument here is not "on the basis of OO", it is "on the basis of 
reasons that lead people to do some of the OO practices". I am not saying 
we do everything as current common OO does, but we also don't need to 
reject things too quickly "on the basis of OO".
 

> Just use a high order fn as a factory to create your records and place it 
> along you record definition in the same name space with proper 
> documentation. 
>
> High order fns can be passed around and this can be quite valuable to be 
> able 
> to specify a factory fn as a parameter. 
>
>  
That will work. And it is valuable to have factory functions to create 
objects more dynamically. But OO like constructors is also valuable because 
it frames a pattern that is clear and intuitive for vast majority of use 
cases. And it does not do any harm to whatever people is using now (if you 
want to continue to use factory function, there is no impact of that) 
 
If it does not do any harm to anybody but have benefits for some people (of 
course not just me), I reason it is a good feature. 


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