Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #34525

Re: Object oriented programming

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.javascript
Subject Re: Object oriented programming
Date 2018-01-09 00:12 +0100
Organization solani.org
Message-ID <p30tsd$1s1$1@solani.org> (permalink)
References (3 earlier) <f6m15dlj11m1v0av240825ofafor4824vp@4ax.com> <5d1ca5ad-55c3-43b5-b3d0-617e3150355e@googlegroups.com> <qma45ddo79n510n3hbnc8p1s74b2m475if@4ax.com> <p2tam8$jk8$1@solani.org> <a0f65ddecnp6c9o9d27f5ij9tuhiop51jk@4ax.com>

Show all headers | View raw


On 08.01.2018 at 10:39, John G Harris wrote:

> On Sun, 7 Jan 2018 15:26:21 +0100, "Christoph M. Becker"
> <cmbecker69@arcor.de> wrote:
> 
>> On 07.01.2018 at 15:13, John G Harris wrote:
>>
>>> newObject and oldObject have different prototype objects; newObject
>>> can't be a clone of oldObject.
>>
>> You may prefer
>>
>>  let newObject = Object.assign({}, oldObject);
> 
> Um. Object.assign doesn't copy non-enumerable properties, prototype,
> or internal slots. It's a restricted clone operation. For instance, it
> won't clone an Array object.

ACK.  However, it seems that we both missed the point, namely that the
article's[1] definition ("[…] instead a prototype can be cloned
resulting in another concrete and fully functional object.") might
simply be too strict or is using the word "clone" in a very broad sense.
 Interestingly, Wikipedia defines Prototype-based programming as[2]:

| Prototype-based programming is a style of object-oriented programming
| in which behaviour reuse (known as inheritance) is performed via a
| process of reusing existing objects via delegation that serve as
| prototypes.

That fits well to Object.prototype.create() and also to the spirit of
the article (at least for me).

[1]
<https://web.archive.org/web/20100316225046/http://www.helsinki.fi:80/~jppesone/papers/kandi.html>
[2] <https://en.wikipedia.org/wiki/Prototype-based_programming>

-- 
Christoph M. Becker

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-05 10:25 -0800
  Re: Object oriented programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-01-05 11:51 -0800
    Re: Object oriented programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-01-05 23:47 +0100
      Re: Object oriented programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-01-05 15:15 -0800
        Re: Object oriented programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-01-08 03:08 +0100
    Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-05 15:09 -0800
      Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-05 15:21 -0800
        Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-05 15:27 -0800
  Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-05 12:09 -0800
    Re: Object oriented programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-01-05 13:01 -0800
      Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-05 14:38 -0800
        Re: Object oriented programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-01-05 15:29 -0800
          Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-05 15:49 -0800
            Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 02:23 -0800
              Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-06 03:25 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 03:39 -0800
                Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-06 04:24 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 05:26 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 05:28 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 05:34 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 06:08 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 06:27 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 06:36 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 07:34 -0800
                Re: Object oriented programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-01-06 09:56 -0800
                Re: Object oriented programming John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-06 14:21 +0000
                Re: Object oriented programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-01-06 17:42 +0000
                Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-06 11:47 -0800
                Re: Object oriented programming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-01-06 22:11 +0100
                Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-06 13:28 -0800
                Re: Object oriented programming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-01-07 12:40 +0100
                Re: Object oriented programming "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-01-07 13:01 +0100
                Re: Object oriented programming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-01-07 19:43 +0100
                Re: Object oriented programming "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-01-07 20:33 +0100
                Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-07 08:30 -0800
                Re: Object oriented programming John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-07 14:05 +0000
                Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-07 08:33 -0800
                Re: Object oriented programming John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-08 09:46 +0000
                Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-08 03:45 -0800
              Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-06 03:39 -0800
                Re: Object oriented programming Julio Di Egidio <julio@diegidio.name> - 2018-01-06 04:24 -0800
              Re: Object oriented programming bit-naughty@hotmail.com - 2018-01-12 22:57 -0800
                Re: Object oriented programming John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-13 13:27 +0000
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-13 08:24 -0800
      Re: Object oriented programming John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-06 14:10 +0000
        Re: Object oriented programming "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-01-06 23:54 -0800
          Re: Object oriented programming John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-07 14:13 +0000
            Re: Object oriented programming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-01-07 15:26 +0100
              Re: Object oriented programming John G Harris <niam@jghnorth.org.uk.invalid> - 2018-01-08 09:39 +0000
                Re: Object oriented programming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-01-09 00:12 +0100
                Re: Object oriented programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-01-09 02:45 +0100
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-08 21:34 -0800
                Re: Object oriented programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-01-09 12:52 +0100
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-09 04:41 -0800
                Re: Object oriented programming Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-01-09 15:50 +0100
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-09 07:31 -0800
                Re: Object oriented programming "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-01-10 15:03 -0800
                Re: Object oriented programming "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2018-01-10 15:04 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-11 02:06 -0800
                Re: Object oriented programming Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-01-09 09:50 -0800
                Re: Object oriented programming "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-01-09 13:19 +0100

csiph-web