Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: "Christoph M. Becker" Newsgroups: comp.lang.javascript Subject: Re: Can somebody explain this to me Date: Sat, 31 Jan 2015 00:37:37 +0100 Organization: solani.org Lines: 53 Message-ID: References: <92a91101-5f3d-4d1a-b76f-59df633d9642@googlegroups.com> <20o1cal0k4iue9ic55hafskt53sivk7lmg@4ax.com> <8lj9catb74g72e1e4a2ga3os82a46cikb0@4ax.com> <681icahv1um1jp8hr1vhtq70qr9ku8c8h1@4ax.com> <6r2kca574ns6j9mcb13226tdm3a7jk9hta@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1422661045 27999 eJwFwYcBwDAIA7CXGDbjnCaB/0+oRA+NmwgGuNxyXb433XG0slkmNXmhn+RgcRwx+YwYF7cfDm0QUw== (30 Jan 2015 23:37:25 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Fri, 30 Jan 2015 23:37:25 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 X-User-ID: eJwFwYEBACAEBMCVFP9lHML+I3QH5eI7RtAwGIGqFnYFR7o2Ho64Ill9IzxjrnfuMC6Nlg8ZgRFV In-Reply-To: <6r2kca574ns6j9mcb13226tdm3a7jk9hta@4ax.com> Cancel-Lock: sha1:BwxYOAtWofiM9/DBxZg+hnMTiTQ= X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXkNKi5yCT/09YQmipM0QFh4M5bXhntiPKy9Vf1AUy8ugNtXlvWxSMifUDGNoQnw== Xref: csiph.com comp.lang.javascript:26761 John Harris wrote: > On Wed, 28 Jan 2015 18:26:56 +0100, "Christoph M. Becker" > wrote: > >> John Harris wrote: >> >>> On Tue, 27 Jan 2015 14:10:00 +0100, "Christoph M. Becker" >>> wrote: >>> >>>> IMHO, the ECMAScript language is a prototypal language, which allows to >>>> emulate class-based object models. >>> >>> As you've probably realised, my opinion differs. I think that using >>> the word 'prototype' in ECMAScript was unfortunate as it's not being >>> used with the common meaning. >>> >>> There are languages that use 'prototype' with the common meaning. In >>> them you create a new object by copying an existing object which acts >>> its prototype. ECMAScript is not like this (whatever Wikipedia says). >> >> Can you name such a language? > > Self : Indeed, the Wikipedia article about "Prototype-based programming"[1] is somewhat misleading in that it suggests that Self links to prototype objects, whereas the `copy` message makes a copy (i.e. clones the prototype object). However, the only conceptional difference I can see between "delegation" and "concatenation" (to use the terms in the Wikipedia article), is that the former allows to change behavior and state of an object after its construction by changing its prototype, while the latter does not. So the former would be a conceptional superset of the latter, and therefore would allow prototypal programming as well. On the other hand, if one defines prototypal programming as the ability to create new objects by cloning existing ones, ECMAScript also fits well to this definition. Anyhow, actually I understand (though not necessarily acknowledge) your claim "that using the word 'prototype' in ECMAScript was unfortunate as it's not being used with the common meaning", but we're living in a world where words may change their meaning over time[2] -- and this might be such a case. [1] [2] -- Christoph M. Becker