Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33259 > unrolled thread
| Started by | Andrew Poulos <ap_prog@hotmail.com> |
|---|---|
| First post | 2017-05-10 11:59 +1000 |
| Last post | 2017-05-11 09:56 -0700 |
| Articles | 20 on this page of 41 — 9 participants |
Back to article view | Back to comp.lang.javascript
Overriding function and adding a bit Andrew Poulos <ap_prog@hotmail.com> - 2017-05-10 11:59 +1000
Re: Overriding function and adding a bit Doc O'Leary <droleary@2017usenet1.subsume.com> - 2017-05-10 15:33 +0000
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-10 19:14 +0200
Re: Overriding function and adding a bit Doc O'Leary <droleary@2017usenet1.subsume.com> - 2017-05-10 22:57 +0000
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-11 01:49 +0200
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-11 17:03 +0200
Re: Overriding function and adding a bit Andrew Poulos <ap_prog@hotmail.com> - 2017-05-12 08:32 +1000
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-12 22:12 +0200
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-12 03:13 +0200
Re: Overriding function and adding a bit John G Harris <niam@jghnorth.org.uk.invalid> - 2017-05-11 16:33 +0100
Re: Overriding function and adding a bit Tim Streater <timstreater@greenbee.net> - 2017-05-11 18:54 +0100
Re: Overriding function and adding a bit Doc O'Leary <droleary@2017usenet1.subsume.com> - 2017-05-11 22:02 +0000
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-12 01:53 +0200
Re: Overriding function and adding a bit John G Harris <niam@jghnorth.org.uk.invalid> - 2017-05-12 10:05 +0100
Re: Overriding function and adding a bit Doc O'Leary <droleary@2017usenet1.subsume.com> - 2017-05-12 21:43 +0000
Re: Overriding function and adding a bit Tim Streater <timstreater@greenbee.net> - 2017-05-12 23:03 +0100
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-12 17:28 -0700
Re: Overriding function and adding a bit John G Harris <niam@jghnorth.org.uk.invalid> - 2017-05-13 14:39 +0100
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-13 07:17 -0700
Re: Overriding function and adding a bit Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-13 16:25 +0100
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-13 08:30 -0700
Re: Overriding function and adding a bit Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-05-13 17:56 +0200
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-13 09:04 -0700
Re: Overriding function and adding a bit Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-13 20:55 +0100
Re: Overriding function and adding a bit Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-14 00:00 +0100
Re: Overriding function and adding a bit Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-14 03:07 +0100
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-13 18:39 -0700
Re: Overriding function and adding a bit John G Harris <niam@jghnorth.org.uk.invalid> - 2017-05-14 11:23 +0100
Re: Overriding function and adding a bit John G Harris <niam@jghnorth.org.uk.invalid> - 2017-05-14 11:36 +0100
Re: Overriding function and adding a bit Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-14 12:34 +0100
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-14 14:11 +0200
Re: Overriding function and adding a bit Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-05-14 15:37 +0100
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-14 17:16 +0200
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-14 15:40 +0200
Re: Overriding function and adding a bit Gene Wirchenko <genew@telus.net> - 2017-05-11 15:39 -0700
Re: Overriding function and adding a bit Tim Streater <timstreater@greenbee.net> - 2017-05-11 10:39 +0100
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-11 10:05 -0700
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-10 19:13 +0200
Re: Overriding function and adding a bit Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-10 19:22 +0200
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-11 10:08 -0700
Re: Overriding function and adding a bit Julio Di Egidio <julio@diegidio.name> - 2017-05-11 09:56 -0700
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2017-05-13 08:30 -0700 |
| Message-ID | <579d836f-190f-488b-859a-2d1320aa8242@googlegroups.com> |
| In reply to | #33301 |
On Saturday, May 13, 2017 at 5:26:01 PM UTC+2, Ben Bacarisse wrote: > Julio Di Egidio <julio@diegidio.name> writes: > > > On Saturday, May 13, 2017 at 3:39:44 PM UTC+2, John G Harris wrote: > >> On Fri, 12 May 2017 17:28:02 -0700 (PDT), Julio Di Egidio > >> <julio@diegidio.name> wrote: > >> > >> >to suggest OO patterns to architect JS code is simple > >> >an utter mistake, that you propose so or that some vendors now are > >> >proposing so... > >> > >> Are you saying ECMAScript programs can't or shouldn't implement an OO > >> design? If so, how do you justify your belief? > > > > You may have beliefs, I am a software professional and that (what I said, > > not how you rephrase it) is just the A in the ABC of JavaScript. > > ECMAScript uses prototype-based inheritance rather than class-based > inheritance but that does not mean it is not and object-oriented > language not that one should not write object-oriented programs using > it. Yes it does: *at least* read Crockford before you open your mouth again, you *apparently* don't know what you are talking about. Julio
[toc] | [prev] | [next] | [standalone]
| From | Cezary Tomczyk <cezary.tomczyk@gmail.com> |
|---|---|
| Date | 2017-05-13 17:56 +0200 |
| Message-ID | <of7abv$1h6k$1@csiph.com> |
| In reply to | #33302 |
On 13/05/2017 17:30, Julio Di Egidio wrote: > On Saturday, May 13, 2017 at 5:26:01 PM UTC+2, Ben Bacarisse wrote: >> Julio Di Egidio <julio@diegidio.name> writes: >> >>> On Saturday, May 13, 2017 at 3:39:44 PM UTC+2, John G Harris wrote: >>>> On Fri, 12 May 2017 17:28:02 -0700 (PDT), Julio Di Egidio >>>> <julio@diegidio.name> wrote: >>>> >>>>> to suggest OO patterns to architect JS code is simple >>>>> an utter mistake, that you propose so or that some vendors now are >>>>> proposing so... >>>> >>>> Are you saying ECMAScript programs can't or shouldn't implement an OO >>>> design? If so, how do you justify your belief? >>> >>> You may have beliefs, I am a software professional and that (what I said, >>> not how you rephrase it) is just the A in the ABC of JavaScript. >> >> ECMAScript uses prototype-based inheritance rather than class-based >> inheritance but that does not mean it is not and object-oriented >> language not that one should not write object-oriented programs using >> it. > > Yes it does: *at least* read Crockford before you open your mouth again, > you *apparently* don't know what you are talking about. I think you are judging people too fast. I suggest to meet someone a bit more closely before write such a statement. -- Cezary Tomczyk http://www.ctomczyk.pl/ https://www.aslint.org/ - Accessibility validation tool
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2017-05-13 09:04 -0700 |
| Message-ID | <2676403a-37f6-49aa-9bc0-21697630ee8d@googlegroups.com> |
| In reply to | #33303 |
On Saturday, May 13, 2017 at 5:56:51 PM UTC+2, Cezary Tomczyk wrote: > On 13/05/2017 17:30, Julio Di Egidio wrote: > > On Saturday, May 13, 2017 at 5:26:01 PM UTC+2, Ben Bacarisse wrote: > >> Julio Di Egidio <julio@diegidio.name> writes: > >> > >>> On Saturday, May 13, 2017 at 3:39:44 PM UTC+2, John G Harris wrote: > >>>> On Fri, 12 May 2017 17:28:02 -0700 (PDT), Julio Di Egidio > >>>> <julio@diegidio.name> wrote: > >>>> > >>>>> to suggest OO patterns to architect JS code is simple > >>>>> an utter mistake, that you propose so or that some vendors now are > >>>>> proposing so... > >>>> > >>>> Are you saying ECMAScript programs can't or shouldn't implement an OO > >>>> design? If so, how do you justify your belief? > >>> > >>> You may have beliefs, I am a software professional and that (what I said, > >>> not how you rephrase it) is just the A in the ABC of JavaScript. > >> > >> ECMAScript uses prototype-based inheritance rather than class-based > >> inheritance but that does not mean it is not and object-oriented > >> language not that one should not write object-oriented programs using > >> it. > > > > Yes it does: *at least* read Crockford before you open your mouth again, > > you *apparently* don't know what you are talking about. > > I think you are judging people too fast. I suggest to meet someone a bit > more closely before write such a statement. You may think or indeed suggest what you like, including that I am "judging people", that is your problem and that of an entire in-civilisation, indeed. I even remarked that to mean what I said, that it wasn't simply an educated guess: apparent if he or indeed you actually knew the least bit about the matter under discussion. And this is the last reply I give to such kind of contributions. If anybody has anything technical, I am at my desk working anyway, otherwise just have a nice weekend. Julio
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-05-13 20:55 +0100 |
| Message-ID | <878tm0edlc.fsf@bsb.me.uk> |
| In reply to | #33303 |
Cezary Tomczyk <cezary.tomczyk@gmail.com> writes: > On 13/05/2017 17:30, Julio Di Egidio wrote: >> On Saturday, May 13, 2017 at 5:26:01 PM UTC+2, Ben Bacarisse wrote: >>> Julio Di Egidio <julio@diegidio.name> writes: >>> >>>> On Saturday, May 13, 2017 at 3:39:44 PM UTC+2, John G Harris wrote: >>>>> On Fri, 12 May 2017 17:28:02 -0700 (PDT), Julio Di Egidio >>>>> <julio@diegidio.name> wrote: >>>>> >>>>>> to suggest OO patterns to architect JS code is simple >>>>>> an utter mistake, that you propose so or that some vendors now are >>>>>> proposing so... >>>>> >>>>> Are you saying ECMAScript programs can't or shouldn't implement an OO >>>>> design? If so, how do you justify your belief? >>>> >>>> You may have beliefs, I am a software professional and that (what I said, >>>> not how you rephrase it) is just the A in the ABC of JavaScript. >>> >>> ECMAScript uses prototype-based inheritance rather than class-based >>> inheritance but that does not mean it is not and object-oriented >>> language not that one should not write object-oriented programs using >>> it. >> >> Yes it does: *at least* read Crockford before you open your mouth again, >> you *apparently* don't know what you are talking about. > > I think you are judging people too fast. I suggest to meet someone a > bit more closely before write such a statement. I doubt he means it. He often flies off the handle. Anyway, I've read Crockford and he also describes JavaScript (that's the term he uses) as an object oriented language. There can be no reasonable doubt that ECMAScript is an object-oriented language (the language definition says so, as does Crockford -- Julio Di Egidio's preferred authority) but there *are* very significant differences between class-based and prototype-based inheritance (which Crockford discusses of course) which we could have a productive discussion about. If Julio Di Egidio would actually engage in the debate, we might find out what he was getting at with the remark that started this subthread. Oh well... that's Usenet. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-05-14 00:00 +0100 |
| Message-ID | <87wp9kcqh8.fsf@bsb.me.uk> |
| In reply to | #33307 |
ram@zedat.fu-berlin.de (Stefan Ram) writes: > Ben Bacarisse <ben.usenet@bsb.me.uk> writes: >>There can be no reasonable doubt that ECMAScript is an object-oriented >>language > > Alan Kay coined the term »object-oriented« in 1967, > and he wrote to me in an e-mail in 2003: Wikipedia says he coined it with others when at Xerox PARC, but he joined PARC in 1970 (again, just Wikipedia as the source). I'm not saying you're wrong, just curious about the various sources. > »OOP to me means only messaging, local retention and protection and > hiding of state-process, and extreme late-binding of all things. > It can be done in Smalltalk and in LISP. There are possibly > other systems in which this is possible, but I'm not aware of them.« > > JavaScript already existed in 2003, but Alan Kay did not > mention it as a System in which OOP can be done. But what does it mean in general nowadays? Interestingly, whilst JavaScript objects do not naturally lend themselves to what I'll call for the moment "Kay object-oriented" programming, there is more of a connection than many people might think. That's because in Smalltalk (the archetype for "Kay object-oriented" programming) the classes (to which objects belong) are themselves are objects, so you have direct access to what is essentially a prototype in JS. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-05-14 03:07 +0100 |
| Message-ID | <87fug8cht7.fsf@bsb.me.uk> |
| In reply to | #33310 |
ram@zedat.fu-berlin.de (Stefan Ram) writes: > Ben Bacarisse <ben.usenet@bsb.me.uk> writes: >>ram@zedat.fu-berlin.de (Stefan Ram) writes: >>>Ben Bacarisse <ben.usenet@bsb.me.uk> writes: >>>>There can be no reasonable doubt that ECMAScript is an object-oriented >>>>language >>>Alan Kay coined the term »object-oriented« in 1967, >>>and he wrote to me in an e-mail in 2003: >>Wikipedia says he coined it with others when at Xerox PARC, but he >>joined PARC in 1970 (again, just Wikipedia as the source). I'm not >>saying you're wrong, just curious about the various sources. > > He also wrote to me: > > |>When and where was the term "object-oriented" used first? > | > |At Utah sometime after Nov 66 when, influenced by Sketchpad, Simula, > |the design for the ARPAnet, the Burroughs B5000, and my background in > |Biology and Mathematics, I thought of an architecture for > |programming. It was probably in 1967 when someone asked me what I was > |doing, and I said: "It's object-oriented programming". > > (see the web for the complete e-mail) > >>That's because in Smalltalk (the archetype for "Kay object-oriented" >>programming) the classes (to which objects belong) are themselves are >>objects, so you have direct access to what is essentially a prototype in >>JS. > > JavaScript is also inspired by Scheme, which is a kind of LISP. Ah but, critically, not the sort that Kay was talking about. Scheme does not have the sort of late binding of earlier LISPs. Obviously, some late-binding mechanism could be implemented if an object-oriented structure were built on top of Scheme, but it's not there at the core. But JavaScript does have late binding of the sort in question. > Kay wrote »LISP«, which is the classical spelling. Today, »Lisp« > is used to refer to modern Lisps with CLOS. I am not sure whether > Kay was referring to classical LISPs without CLOS, which would not > make a lot of sense to me. He was writing in 2003 so he was very likely reffering to Common Lisp (but not, I think, to the cleaner Lisps). Whether CLOS itself meets his strict definition, I'm not sure. I think it does, but an object system that did could surely be written in Common Lisp. > In Smalltalk, blocks of codes are objects too. This was missing in > Java, C++, and JavaScript in 2003. But today all of these languages > have lambda-like expression which can be use somewhat like > smalltalk code blocks. Right, though I don't think they are central to anyone's view of object-oriented programming. > Stefan Matthias Aust wrote a post in 2004 where he explained > something like this: In Smalltalk, we can create a class > »Boolean« and two subclasses »True« and »False«. In »True« > we can define: > > ifTrue: aBlock > ^aBlock value > > and in »False« > > ifTrue: aBlock > ^nil > > . Now we have implemented an if statement using polymorphism. > It can be used as > > a > 0 ifTrue: [a := 0] > > . »a > 0« will create an object of class »True« or of class > »False«. This object then will receive the message »ifTrue: > [a := 0]«. If the object has the class »True«, the block > will be evaluated, otherwise »nil« will be returned. (End of > what Stefan Matthias Aust explained, here given in my wordings. > All errors in the explanation are mine [Stefan Ram's], not > Stefan Matthias Aust's.) > > So in Smalltalk, even the control structures conceptually > are implemented in terms of messages and polymorphism > (while an implementation might not actually implement them > this way for reasons of efficiency). Yes. Something similar can be done (without classes) in the lambda calculus. In JavaScript you could do this with True = x => y => x False = x => y => y and then, if Boolean constructs gave True or False rather than JavaScript's true or false, a conditional would be written test (()=> then-code) (()=> else-code) () JavaScript's blocks are rather ugly since they require and empty parameter list. Now, Boolean expressions don't yield True or False so we'd have to write the if function like this: If = Cond => Then => Else => (Cond ? True : False)(Then)(Else)() so, finally, we can write If (a > 0) (()=> a = 0) (()=> null) It's not the same, of course, but I thought it would be useful to show how one really does not need control structures at all! <snip> -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2017-05-13 18:39 -0700 |
| Message-ID | <139cf92b-2ca7-4d99-80b7-326888b0717c@googlegroups.com> |
| In reply to | #33307 |
On Saturday, May 13, 2017 at 9:55:32 PM UTC+2, Ben Bacarisse wrote: > Cezary Tomczyk <cezary.tomczyk@gmail.com> writes: > > On 13/05/2017 17:30, Julio Di Egidio wrote: > >> On Saturday, May 13, 2017 at 5:26:01 PM UTC+2, Ben Bacarisse wrote: > >>> Julio Di Egidio <julio@diegidio.name> writes: > >>>> On Saturday, May 13, 2017 at 3:39:44 PM UTC+2, John G Harris wrote: > >>>>> On Fri, 12 May 2017 17:28:02 -0700 (PDT), Julio Di Egidio > >>>>> <julio@diegidio.name> wrote: > >>>>> > >>>>>> to suggest OO patterns to architect JS code is simple > >>>>>> an utter mistake, that you propose so or that some vendors now are > >>>>>> proposing so... > >>>>> > >>>>> Are you saying ECMAScript programs can't or shouldn't implement an OO > >>>>> design? If so, how do you justify your belief? > >>>> > >>>> You may have beliefs, I am a software professional and that (what I said, > >>>> not how you rephrase it) is just the A in the ABC of JavaScript. > >>> > >>> ECMAScript uses prototype-based inheritance rather than class-based > >>> inheritance but that does not mean it is not and object-oriented > >>> language not that one should not write object-oriented programs using > >>> it. > >> > >> Yes it does: *at least* read Crockford before you open your mouth again, > >> you *apparently* don't know what you are talking about. > > > > I think you are judging people too fast. I suggest to meet someone a > > bit more closely before write such a statement. > > I doubt he means it. He often flies off the handle. > > Anyway, I've read Crockford and he also describes JavaScript (that's the > term he uses) as an object oriented language. > There can be no reasonable doubt that ECMAScript is an object-oriented > language (the language definition says so, as does Crockford -- Julio Di > Egidio's preferred authority) but there *are* very significant > differences between class-based and prototype-based inheritance (which > Crockford discusses of course) which we could have a productive > discussion about. You incompetent moron and stupid cunt, you should simply shut the fuck up: you not only don't know what you are talking about, you apparently are so stupid and biased that you cannot even read, or appreciate that you won't understand this stuff in few minutes, and I mean not even if you weren't the retarded cunt that you in fact are. > If Julio Di Egidio would actually engage in the debate, we might find > > Oh well... that's Usenet. Julio Di Egidio won't teach you any more shit unless you change your attitude, because that's lesson number 1 for *any* discipline, you sucker. But I have known *you* for years, and you are simply too stupid and too coward to change your attitude, so just fuck you and *Plonk* Julio
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2017-05-14 11:23 +0100 |
| Message-ID | <1vbghcl4lb3aaf42pcikslf5sadp7aciho@4ax.com> |
| In reply to | #33312 |
On Sat, 13 May 2017 18:39:43 -0700 (PDT), Julio Di Egidio <julio@diegidio.name> wrote: >On Saturday, May 13, 2017 at 9:55:32 PM UTC+2, Ben Bacarisse wrote: <snip> >You incompetent moron and stupid cunt, you should simply shut the fuck up: >you not only don't know what you are talking about, you apparently are so >stupid and biased that you cannot even read, or appreciate that you won't >understand this stuff in few minutes, and I mean not even if you weren't >the retarded cunt that you in fact are. > >> If Julio Di Egidio would actually engage in the debate, we might find >> >> Oh well... that's Usenet. > >Julio Di Egidio won't teach you any more shit unless you change your >attitude, because that's lesson number 1 for *any* discipline, you sucker. >But I have known *you* for years, and you are simply too stupid and too >coward to change your attitude, so just fuck you and *Plonk* What a wonderful contribution to this discussion! Can someone tell me what Julio is saying. So far I've gathered he says ECMAScript is something, and also isn't it. Or is he only criticising the JavaScript implementation of the language? John
[toc] | [prev] | [next] | [standalone]
| From | John G Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2017-05-14 11:36 +0100 |
| Message-ID | <vlcghcp51bem918fu1h8rump5novj5oq40@4ax.com> |
| In reply to | #33307 |
On 13 May 2017 20:51:57 GMT, ram@zedat.fu-berlin.de (Stefan Ram) wrote: >Ben Bacarisse <ben.usenet@bsb.me.uk> writes: >>There can be no reasonable doubt that ECMAScript is an object-oriented >>language > > Alan Kay coined the term »object-oriented« in 1967, > and he wrote to me in an e-mail in 2003: > >»OOP to me means only messaging, local retention and protection and >hiding of state-process, and extreme late-binding of all things. >It can be done in Smalltalk and in LISP. There are possibly >other systems in which this is possible, but I'm not aware of them.« > > JavaScript already existed in 2003, but Alan Kay did not > mention it as a System in which OOP can be done. In a video by one of the Smalltalk inventors, probably Alan Kay, the speaker ended by saying that a language is Object Oriented *ONLY* if it has *ALL* the features of Smalltalk. So Strongly typed languages are not OO. Languages where a garbage collector is optional are not OO. Languages which don't call methods by sending messages are not OO. I think he was biased in favour of Smalltalk, too biased. John
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-05-14 12:34 +0100 |
| Message-ID | <87pofbbrkh.fsf@bsb.me.uk> |
| In reply to | #33315 |
John G Harris <niam@jghnorth.org.uk.invalid> writes: > On 13 May 2017 20:51:57 GMT, ram@zedat.fu-berlin.de (Stefan Ram) > wrote: > >>Ben Bacarisse <ben.usenet@bsb.me.uk> writes: >>>There can be no reasonable doubt that ECMAScript is an object-oriented >>>language >> >> Alan Kay coined the term »object-oriented« in 1967, >> and he wrote to me in an e-mail in 2003: >> >>»OOP to me means only messaging, local retention and protection and >>hiding of state-process, and extreme late-binding of all things. >>It can be done in Smalltalk and in LISP. There are possibly >>other systems in which this is possible, but I'm not aware of them.« >> >> JavaScript already existed in 2003, but Alan Kay did not >> mention it as a System in which OOP can be done. > > In a video by one of the Smalltalk inventors, probably Alan Kay, the > speaker ended by saying that a language is Object Oriented *ONLY* if > it has *ALL* the features of Smalltalk. > > So > Strongly typed languages are not OO. > Languages where a garbage collector is optional are not OO. > Languages which don't call methods by sending messages are not OO. > > I think he was biased in favour of Smalltalk, too biased. Sure, but I don't think it matters too much because he's explicit about the definition he's using (or, indeed, invented) so the discussion can't be derailed by misunderstanding. I like it when people are passionate about technical matters, and I like having definitions that stake out the boundaries of concepts like this, even if they are not universally agreed upon. And I feel inclined to nit-pick a bit: I think you mean "static typing" rather than "strong typing". What he's ruling out is code where the types can be resolved by static analysis of the program text. A language with dynamic or run-time types may enforce strong type checking. In fact, I think he's going further than this. His remark about very late binding would rule out languages (like C++) where the compiler can plant virtual tables making it seem like there is some run-time typing going on. The acid test would be whether you can "wrap" a method at run-time. You can do this in SmallTalk and CLOS (the Common List Object System) and in Python as well. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2017-05-14 14:11 +0200 |
| Message-ID | <1717623.PYKUYFuaPT@PointedEars.de> |
| In reply to | #33317 |
Ben Bacarisse wrote: > John G Harris <niam@jghnorth.org.uk.invalid> writes: >> In a video by one of the Smalltalk inventors, probably Alan Kay, the >> speaker ended by saying that a language is Object Oriented *ONLY* if >> it has *ALL* the features of Smalltalk. >> >> So >> Strongly typed languages are not OO. >> Languages where a garbage collector is optional are not OO. >> Languages which don't call methods by sending messages are not OO. >> >> I think he was biased in favour of Smalltalk, too biased. > > Sure, but I don't think it matters too much because he's explicit about > the definition he's using (or, indeed, invented) so the discussion can't > be derailed by misunderstanding. I like it when people are passionate > about technical matters, and I like having definitions that stake out > the boundaries of concepts like this, even if they are not universally > agreed upon. > > And I feel inclined to nit-pick a bit: I think you mean "static typing" > rather than "strong typing". I think you mean static _type-checking_. If anyone doubts that e.g. Java (which does have static type-checking) is an object-oriented programming language, they did way too much Small talk. -- PointedEars FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix> <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-05-14 15:37 +0100 |
| Message-ID | <87k25jbj2u.fsf@bsb.me.uk> |
| In reply to | #33319 |
Thomas 'PointedEars' Lahn <PointedEars@web.de> writes: > Ben Bacarisse wrote: > >> John G Harris <niam@jghnorth.org.uk.invalid> writes: >>> In a video by one of the Smalltalk inventors, probably Alan Kay, the >>> speaker ended by saying that a language is Object Oriented *ONLY* if >>> it has *ALL* the features of Smalltalk. >>> >>> So >>> Strongly typed languages are not OO. >>> Languages where a garbage collector is optional are not OO. >>> Languages which don't call methods by sending messages are not OO. >>> >>> I think he was biased in favour of Smalltalk, too biased. >> >> Sure, but I don't think it matters too much because he's explicit about >> the definition he's using (or, indeed, invented) so the discussion can't >> be derailed by misunderstanding. I like it when people are passionate >> about technical matters, and I like having definitions that stake out >> the boundaries of concepts like this, even if they are not universally >> agreed upon. >> >> And I feel inclined to nit-pick a bit: I think you mean "static typing" >> rather than "strong typing". > > I think you mean static _type-checking_. Not really, though it would certainly do. I wanted to focus on the static analysis of types more generally including include languages without type declaration where the types are inferred. Obviously some of these might also check some types, but if the semantics are very forgiving there may nothing to "check" (in the usual sense of giving a type error). I don't imagine there are any such languages, but it was not the checking that mattered to me at the time I wrote the above. > If anyone doubts that e.g. Java (which does have static type-checking) is > an object-oriented programming language, they did way too much Small talk. Quite. These days the term obviously doesn't mean what Kay wants it to mean, and I doubt it did even at the time. Simula is usually described as object-oriented and dates form the mod 1960s. It may be that no one put the words "object" and "oriented" together before Kay did, but if he'd asked the Simula people, in 1967, if their programs were "object-oriented" I think they would have said yes because of the obvious meaning of the juxtaposition. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2017-05-14 17:16 +0200 |
| Message-ID | <3108560.iIbC2pHGDl@PointedEars.de> |
| In reply to | #33322 |
Ben Bacarisse wrote: > Thomas 'PointedEars' Lahn <PointedEars@web.de> writes: >> Ben Bacarisse wrote: >>> And I feel inclined to nit-pick a bit: I think you mean "static typing" >>> rather than "strong typing". >> I think you mean static _type-checking_. > > Not really, though it would certainly do. I wanted to focus on the > static analysis of types more generally including include languages > without type declaration where the types are inferred. Obviously some > of these might also check some types, […] <https://en.wikipedia.org/wiki/Type_system#Type_checking> >> If anyone doubts that e.g. Java (which does have static type-checking) is >> an object-oriented programming language, they did way too much Small >> talk. > > Quite. […] This was partly tongue-in-cheek :) -- PointedEars FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix> <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2017-05-14 15:40 +0200 |
| Message-ID | <3321711.kQq0lBPeGt@PointedEars.de> |
| In reply to | #33317 |
Stefan Ram wrote: > let result = decoratum.call( this, ...arguments ); let result = decoratum.apply(this, arguments); > [rest of atrocious code snipped] -- PointedEars FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix> <https://github.com/PointedEars> | <http://PointedEars.de/wsvn/> Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2017-05-11 15:39 -0700 |
| Message-ID | <shp9hc9fk34tc6co46lnb125680p6mr3j0@4ax.com> |
| In reply to | #33266 |
On Thu, 11 May 2017 01:49:35 +0200, Thomas 'PointedEars' Lahn
<PointedEars@web.de> wrote:
>Doc O'Leary wrote:
>
>> Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:
>>> Doc O'Leary wrote:
>>> ^^^^^^^^^^^
>>> Get a real name.
>>
>> Attempt at humor, or trolling from the get-go?
>
>Are the subscribers of this newsgroup supposed to believe that “Doc O’Leary”
>is your real name?
Who cares (besides you)? As long as Doc O'Leary is consistent in
his name use and the name is not in bad taste, I do not care. Aliases
are perfectly legal provided there is no fraudulent intent.
I knew someone who went by the name of "Doc". He even named his
store "Doc's Computers".
Why don't you complain about my name? My first given name is not
actually "Gene"; it is "Eugene". And I have omitted my middle name,
too. Then, there is the issue of my Chinese name.
[snip]
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2017-05-11 10:39 +0100 |
| Message-ID | <110520171039468461%timstreater@greenbee.net> |
| In reply to | #33265 |
In article <of05sh$85g$1@dont-email.me>, Doc O'Leary <droleary@2017usenet1.subsume.com> wrote: >For your reference, records indicate that >Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote: > >> Doc O'Leary wrote: >> ^^^^^^^^^^^ >> Get a real name. > >Attempt at humor, or trolling from the get-go? The latter. PointyHead thinks he owns this ng and that we should follow his posting norms. He's done more to ruin this ng that anyone else. -- Labour - a bunch of rich people convincing poor people to vote for rich people by telling poor people that "other" rich people are the reason they are poor. Peter Thompson
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2017-05-11 10:05 -0700 |
| Message-ID | <87681bb5-2ea5-4ea4-9ff3-3d66a7c5a109@googlegroups.com> |
| In reply to | #33260 |
On Wednesday, May 10, 2017 at 5:36:59 PM UTC+2, Doc O'Leary wrote:
> Andrew Poulos <ap_prog@hotmail.com> wrote:
>
> > var myObjLayerMoveTo = window.ObjLayerMoveTo;
> >
> > window.ObjLayerMoveTo = function(x, y) {
> > if (this.id == "foo") return;
> > myObjLayerMoveTo(x, y);
> > };
> >
> > Is this the way to approach this?
>
> Goodness, no. A major point of OOD is that you can override the
> method in the hierarchy at the appropriate object level.
A major point of OO in general is not to overuse/abuse it. That said,
your approach requires changing the underlying implementation, which
sometimes is simply not possible. Indeed the OP was just asking about
how to wrap a method.
Now, back to OO, the good of JavaScript is that you can easily and naturally
do that kind of stuff and more, while you just cannot do anything like that
in a purely OO language...
Julio
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2017-05-10 19:13 +0200 |
| Message-ID | <2811137.5fSG56mABF@PointedEars.de> |
| In reply to | #33259 |
Andrew Poulos wrote:
> function ObjLayerMoveTo(x, y) {
> /* 100+ lines of spaghetti code */
> }
>
> […]
> var myObjLayerMoveTo = window.ObjLayerMoveTo;
>
> window.ObjLayerMoveTo = function(x, y) {
> if (this.id == "foo") return;
> myObjLayerMoveTo(x, y);
> };
>
>
> Is this the way to approach this?
No, it should be
var myObjLayerMoveTo = ObjLayerMoveTo;
ObjLayerMoveTo = function (x, y) {
if (this.id == "foo") return;
myObjLayerMoveTo(x, y);
};
Do not confuse the “window” object with the ECMAScript global object.
--
PointedEars
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2017-05-10 19:22 +0200 |
| Message-ID | <1565645.VLH7GnMWUR@PointedEars.de> |
| In reply to | #33261 |
Thomas 'PointedEars' Lahn wrote:
> Andrew Poulos wrote:
>> function ObjLayerMoveTo(x, y) {
>> /* 100+ lines of spaghetti code */
>> }
>>
>> […]
>> var myObjLayerMoveTo = window.ObjLayerMoveTo;
>>
>> window.ObjLayerMoveTo = function(x, y) {
>> if (this.id == "foo") return;
>> myObjLayerMoveTo(x, y);
>> };
>>
>>
>> Is this the way to approach this?
>
> No, it should be
>
> var myObjLayerMoveTo = ObjLayerMoveTo;
>
> ObjLayerMoveTo = function (x, y) {
> if (this.id == "foo") return;
> myObjLayerMoveTo(x, y);
> };
>
> Do not confuse the “window” object with the ECMAScript global object.
Or, to keep the global namespace clean:
/* in global context */
(function (global) {
var _ObjLayerMoveTo = global.ObjLayerMoveTo;
global.ObjLayerMoveTo = function (x, y) {
if (this.id == "foo") return;
_ObjLayerMoveTo(x, y);
};
}(this));
or
/* in global context */
ObjLayerMoveTo = (function (global) {
var _ObjLayerMoveTo = global.ObjLayerMoveTo;
return function (x, y) {
if (this.id == "foo") return;
_ObjLayerMoveTo(x, y);
};
}(this));
I recommend either “_ObjLayerMoveTo” or “theirObjLayerMoveTo”, because
“myObjectLayerMoveTo” would semantically be the function with which you
override *their* “ObjLayerMoveTo”.
--
PointedEars
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Julio Di Egidio <julio@diegidio.name> |
|---|---|
| Date | 2017-05-11 10:08 -0700 |
| Message-ID | <a06fbcc9-3913-4e90-854c-4adc6e441ee7@googlegroups.com> |
| In reply to | #33261 |
On Wednesday, May 10, 2017 at 7:13:19 PM UTC+2, Thomas 'PointedEars' Lahn > No, it should be > > var myObjLayerMoveTo = ObjLayerMoveTo; That will not work in strict mode... Julio
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web