Alrighty, having read up on currying in JavaScript (I knew it as lambda 
functions) I agree, there's no good way to name that function so that it 
has a meaning outside of a programing paradigm because it is a 
programing technique.  I suppose you could argue that you can build half 
a car and later, when new materials are available, finish the car but 
either way, the concept of partially evaluating functions and waiting 
until other input is ready is a technique, not really an interface.  
Plus, since currying has a well-known programming meaning, it approaches 
concepts like flow-control or function scoping which are technical terms 
with technical meanings that I would expect a new or old programmer to 
invest the time in learning.  That argument could be made for the 
Prototype API, and in some cases should be made.

Any way, I admit that there are limitations to naming schemes that are 
as accurate as possible inside and outside of the paradigm for which 
they're intended.  However, when it is possible to rename something so 
that it's interface -- in this case the name of a function -- is 
recognizable and understandable to people by name, the ability to use 
that interface is enhanced and the code becomes more beautiful. 

I guess you may wonder, then, if I have a better name the replace 
method, I do not.  I tend to avoid it in my code because of the 
perceptual problems I have with it and, instead, use remove() to 
explicitly get ride of an object and then appendChild() to add a new one 
back into the DOM.  More work? Yes.  More code? Yes.  But it my 
experience, the maintainability of clearly written code is greater than 
that of concise code.

 - Dash -

Christophe Porteneuve wrote:
> David Dashifen Kees a écrit :
>   
>> I agree, but the semantics of the word replace, outside of a programming 
>> paradigm, seems to indicate that the new thing will be similar and act 
>> similarly to the old thing.  If I replace, for example, one of my old 
>>     
>
> Point taken, but are you seriously suggesting that we should use words
> that make sense *even outside of a programming paradigm*?  Why would we?
>  Prototype is very much about programming.  What about upcoming methods
> like "curry" then? :-)
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to