Re: [WSG] JavaScript clarification please - versions

2008-10-29 Thread Keryx Web

Brett Patterson skrev:
I am sorry, but I must ask. Are you saying that the term JavaScript is 
owned by Sun? Or just the Java part? And, yes, JavaScript is implemented 
in Internet Explorer.




I see that your question has already been answered. I will give some 
additional points.


Mocha was Brendan Eich's internal name during initial development at 
Netscape. It was renamed LiveScript by him and his fellow enginers, but 
changed to JavaScript by the *marketing* department.


JScript in MSIE 6 and 7 is *roughly* comparable to JavaScript 1.2 and to 
ECMAScript 3.0.


There is a document, produced by MS, that in very high detail outlines 
how JScript, and other browsers JS engines, differs from the spec. It is 
available at https://developer.mozilla.org/en/JavaScript


The JavaScript support in Safari, Google Chrome and Opera is *roughly* 
comparable to JavaScript 1.5, and some parts of JavaScript 1.6.


(Note: 99 % of the time when one curses the differences between 
browsers, it is not because of their deviations from each other in 
Java/J/EcmaScript, but how they differ from each other on the DOM.)


Mozilla is allowed by the ECMAScript spec to develop JavaScript as a 
superset to ECMAScript, and indeed they have. JavaScript 1.8 contains 
quite a few features that (probably) will not even make it into 
ECMAScript 3.1 (generators, iterators, let-blocks - personally I really 
like let blocks!).


A few years ago Netscape proposed a JavaScript 2.0 version. Many 
features from that proposal has made it into ActionScript and into 
JScript.NET (used on the server). ECMAScript 4.0 that was being worked 
upon altered from the original JS 2.0 proposal in some ways. That work 
has however been halted. One group, led by Mozilla and Adobe, wanted to 
*add* to ECMAScript in radical ways. One group, led by MS and Yahoo 
(Doug Crockford), wanted primarily a *subset*, getting rid of the bad 
parts. They soon added features, though, and the language was in 
essence forked.


A compromise has been reached. ECMAScript Harmony will most probably 
be released as version 4, but not for a couple of years. And it will 
differ from the ES 4 proposal as stood in June.


It is the intention of the EcmaScript working group to release ES 3.1 
next year, at which time they hope to have two interoperable and 
complete implementations. One will most probably be SpiderMonkey 
(Mozilla) and the other might be V8.


The new ES 4, i.e. Harmony, will probably not see the light of day 
until 2010 or 2011.



Lars Gunther


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please - object methods are properties

2008-10-29 Thread Keryx Web

Keryx Web skrev:
JavaScript has no pure hash-tables, aka associative arrays. Object 
properties can be used to emulate associative arrays, though. A PHP 
programmer will feel very limited, though.


A JavaScript object *is* not an array ...
It can have methods as well as properties.


geekspeak
Nitpicking on myself. JavaScript makes no real distinction between a 
property value that is a function (and therefore becomes an object 
method) and property values that simply store a simple type. i.e. a 
method *is* a property, that stores a function, which is possible since 
they are first class objects.

/geekspeak


Lars Gunther


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please - versions

2008-10-29 Thread Brett Patterson
I like that explanation. I get it now. Thanks. One more quick question
though, what is a let-block, in general? Thanks. That really does make it a
lot easier to understand.

Brett

On Wed, Oct 29, 2008 at 6:04 AM, Keryx Web [EMAIL PROTECTED] wrote:

 Brett Patterson skrev:

 I am sorry, but I must ask. Are you saying that the term JavaScript is
 owned by Sun? Or just the Java part? And, yes, JavaScript is implemented in
 Internet Explorer.


 I see that your question has already been answered. I will give some
 additional points.

 Mocha was Brendan Eich's internal name during initial development at
 Netscape. It was renamed LiveScript by him and his fellow enginers, but
 changed to JavaScript by the *marketing* department.

 JScript in MSIE 6 and 7 is *roughly* comparable to JavaScript 1.2 and to
 ECMAScript 3.0.

 There is a document, produced by MS, that in very high detail outlines how
 JScript, and other browsers JS engines, differs from the spec. It is
 available at https://developer.mozilla.org/en/JavaScript

 The JavaScript support in Safari, Google Chrome and Opera is *roughly*
 comparable to JavaScript 1.5, and some parts of JavaScript 1.6.

 (Note: 99 % of the time when one curses the differences between browsers,
 it is not because of their deviations from each other in Java/J/EcmaScript,
 but how they differ from each other on the DOM.)

 Mozilla is allowed by the ECMAScript spec to develop JavaScript as a
 superset to ECMAScript, and indeed they have. JavaScript 1.8 contains quite
 a few features that (probably) will not even make it into ECMAScript 3.1
 (generators, iterators, let-blocks - personally I really like let blocks!).

 A few years ago Netscape proposed a JavaScript 2.0 version. Many features
 from that proposal has made it into ActionScript and into JScript.NET (used
 on the server). ECMAScript 4.0 that was being worked upon altered from the
 original JS 2.0 proposal in some ways. That work has however been halted.
 One group, led by Mozilla and Adobe, wanted to *add* to ECMAScript in
 radical ways. One group, led by MS and Yahoo (Doug Crockford), wanted
 primarily a *subset*, getting rid of the bad parts. They soon added
 features, though, and the language was in essence forked.

 A compromise has been reached. ECMAScript Harmony will most probably be
 released as version 4, but not for a couple of years. And it will differ
 from the ES 4 proposal as stood in June.

 It is the intention of the EcmaScript working group to release ES 3.1 next
 year, at which time they hope to have two interoperable and complete
 implementations. One will most probably be SpiderMonkey (Mozilla) and the
 other might be V8.

 The new ES 4, i.e. Harmony, will probably not see the light of day until
 2010 or 2011.


 Lars Gunther


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please - let blocks

2008-10-29 Thread Keryx Web

Brett Patterson skrev:
I like that explanation. I get it now. Thanks. One more quick question 
though, what is a let-block, in general? Thanks. That really does make 
it a lot easier to understand.


Brett


Normally JavaScript does not have block scope.

var foo = 1;
{
foo = 2;
}
alert(foo); // will give you 2

Let-blocks will provide block-scope on an opt in basis:

var foo = 1;
{
let foo = 2;
alert(foo); // 2
let bar = 3;
}
alert(foo); // 1
alert(bar); // undefined

Block scope is one feature that makes it easy to write interoperable 
code. My variables won't mess with your variables. Today we use function 
scope to accomplish the same thing:


var foo = 1;
(function() {
var foo = 2;
alert(foo); // 2
})() // last parenthesis invokes anonymous function
alert(foo); // 1


Let blocks are really handy in for loops:

var i = Hi there;
for ( let i = 0; i  10; i++) {
alert(i); // 0 - 9
}
alert(i); // Hi there

Self executing functions have another kind of power through closures and 
possible return values, so the two do not completely overlap.


More info on the New in JavaScript 1.7 article on MDC.


Lars Gunther



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please - let blocks

2008-10-29 Thread Brett Patterson
OK. Thanks

On Wed, Oct 29, 2008 at 11:00 AM, Keryx Web [EMAIL PROTECTED] wrote:

 Brett Patterson skrev:

 I like that explanation. I get it now. Thanks. One more quick question
 though, what is a let-block, in general? Thanks. That really does make it a
 lot easier to understand.

 Brett


 Normally JavaScript does not have block scope.

 var foo = 1;
 {
foo = 2;
 }
 alert(foo); // will give you 2

 Let-blocks will provide block-scope on an opt in basis:

 var foo = 1;
 {
let foo = 2;
alert(foo); // 2
let bar = 3;
 }
 alert(foo); // 1
 alert(bar); // undefined

 Block scope is one feature that makes it easy to write interoperable code.
 My variables won't mess with your variables. Today we use function scope to
 accomplish the same thing:

 var foo = 1;
 (function() {
var foo = 2;
alert(foo); // 2
 })() // last parenthesis invokes anonymous function
 alert(foo); // 1


 Let blocks are really handy in for loops:

 var i = Hi there;
 for ( let i = 0; i  10; i++) {
alert(i); // 0 - 9
 }
 alert(i); // Hi there

 Self executing functions have another kind of power through closures and
 possible return values, so the two do not completely overlap.

 More info on the New in JavaScript 1.7 article on MDC.


 Lars Gunther



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-28 Thread liorean
 liorean wrote:
 (Netscape had originally intended to use the name LiveScript.)

2008/10/28 Hassan Schroeder [EMAIL PROTECTED]:
 Actually, it was initially released as LiveScript and renamed later.

IIRC Navigator 2.0 also supported a mocha: pseudo-protocol like the
javascript: pseudo-protocol we have today, from the name it was given
before it became LiveScript. Anyway, by the time the first full
version of Navigator that had it was released (2.0) it had already
been renamed to JavaScript, so I'd hardly say it was released under
the LiveScript name.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-28 Thread Brett Patterson
When you say support, are you saying that Internet Explorer will not execute
JavaScript, or it will execute JavaScript as JScript? And in the
http://en.wikipedia.org/wiki/JavaScript link you provided it states that
JavaScript is heavily object-based, so should I assume this as well to be
correct?

On Tue, Oct 28, 2008 at 3:55 AM, liorean [EMAIL PROTECTED] wrote:

  liorean wrote:
  (Netscape had originally intended to use the name LiveScript.)

 2008/10/28 Hassan Schroeder [EMAIL PROTECTED]:
  Actually, it was initially released as LiveScript and renamed later.

 IIRC Navigator 2.0 also supported a mocha: pseudo-protocol like the
 javascript: pseudo-protocol we have today, from the name it was given
 before it became LiveScript. Anyway, by the time the first full
 version of Navigator that had it was released (2.0) it had already
 been renamed to JavaScript, so I'd hardly say it was released under
 the LiveScript name.
 --
 David liorean Andersson


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

RE: [WSG] JavaScript clarification please

2008-10-28 Thread michael.brockington
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Brett Patterson
 Sent: 28 October 2008 12:35
 To: wsg@webstandardsgroup.org
 Subject: Re: [WSG] JavaScript clarification please


 When you say support, are you saying that Internet Explorer will not
execute 
 JavaScript, or it will execute JavaScript as JScript? And in the
 http://en.wikipedia.org/wiki/JavaScript link you provided it states
that 
 JavaScript is heavily object-based, so should I assume this as well to
be correct?
 
As far as I can see, it does not say that.

The facts are that the JScript run-time engine will attempt to execute
whatever is thrown at it. In most cases something that looks like valid
Javascript will produce something like what was intended.  Think of it
like support for CSS: IE is always a little bit different, but it is
still CSS. And at the end of the day, JScript, ECMAscript, ActionScript
and JavaScript are more or less the same beast as far as this discussion
is concerned. They are all based on objects, they all implement
inheritance, and all of them can be used to write linear, procedural
code if required.

Regards,
Mike


Mike Brockington
Web Development Specialist

www.calcResult.com
www.stephanieBlakey.me.uk
www.edinburgh.gov.uk

This message does not reflect the opinions of any entity other than the
author alone.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-28 Thread Brett Patterson
Actually it did say it is heavily object-based. But now, under Dynamic
Programming -- Objects as associated arrays, it says it is almost entirely
object-based. Looks like it just got updated. Internet Explorer does read
JavaScript, but does it support JavaScript as a whole, or does it read
JavaScript as JScript?

On Tue, Oct 28, 2008 at 10:43 AM, [EMAIL PROTECTED] wrote:

  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 On Behalf Of Brett Patterson
  Sent: 28 October 2008 12:35
  To: wsg@webstandardsgroup.org
  Subject: Re: [WSG] JavaScript clarification please
 
 
  When you say support, are you saying that Internet Explorer will not
 execute
  JavaScript, or it will execute JavaScript as JScript? And in the
  http://en.wikipedia.org/wiki/JavaScript link you provided it states
 that
  JavaScript is heavily object-based, so should I assume this as well to
 be correct?

 As far as I can see, it does not say that.

 The facts are that the JScript run-time engine will attempt to execute
 whatever is thrown at it. In most cases something that looks like valid
 Javascript will produce something like what was intended.  Think of it
 like support for CSS: IE is always a little bit different, but it is
 still CSS. And at the end of the day, JScript, ECMAscript, ActionScript
 and JavaScript are more or less the same beast as far as this discussion
 is concerned. They are all based on objects, they all implement
 inheritance, and all of them can be used to write linear, procedural
 code if required.

 Regards,
 Mike


 Mike Brockington
 Web Development Specialist

 www.calcResult.com
 www.stephanieBlakey.me.uk
 www.edinburgh.gov.uk

 This message does not reflect the opinions of any entity other than the
 author alone.


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-28 Thread Hassan Schroeder

liorean wrote:


  Anyway, by the time the first full
version of Navigator that had it was released (2.0) it had already
been renamed to JavaScript, so I'd hardly say it was released under
the LiveScript name.


Well, at this point I don't know exactly when a version of Navigator
was released with it under either name but certainly remember reading
plenty about LiveScript before the name change.

And there were certainly some interesting internal discussions at
JavaSoft about the whole issue. :-)

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-621-3445   === http://webtuitive.com

  dream.  code.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-28 Thread liorean
2008/10/28 Brett Patterson [EMAIL PROTECTED]:
 Actually it did say it is heavily object-based. But now, under Dynamic
 Programming -- Objects as associated arrays, it says it is almost entirely
 object-based. Looks like it just got updated. Internet Explorer does read
 JavaScript, but does it support JavaScript as a whole, or does it read
 JavaScript as JScript?

That depends on what you mean by JavaScript. Do you mean the language
that Netscape JavaScript and later Mozilla JavaScript reference[1] and
guide[2] specs specifies? JavaScript as in the language
text/javascript is interpreted as in browsers? Do you mean the
entire language and host environment making up the client side
scripting language for web pages?

The word JavaScript means different things in different contexts to
different people.


Internet Explorer uses Microsof't JScript engine which implements
ECMAScript, some parts of it buggy, some parts of it with proprietary
extensions. It doesn't in general implement Mozilla JavaScript
additions to ECMAScript. It does send all content that tells it it is
JavaScript/LiveScript/JScript/ECMAScript to the same engine.


[1] https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference
[2] https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-28 Thread Brett Patterson
There is only one JavaScript, as created by Netscape. Though it can be used
for other things, such as programming an application, I think that is worded
right.

On Tue, Oct 28, 2008 at 12:10 PM, Hassan Schroeder [EMAIL PROTECTED]wrote:

 liorean wrote:

   Anyway, by the time the first full
 version of Navigator that had it was released (2.0) it had already
 been renamed to JavaScript, so I'd hardly say it was released under
 the LiveScript name.


 Well, at this point I don't know exactly when a version of Navigator
 was released with it under either name but certainly remember reading
 plenty about LiveScript before the name change.

 And there were certainly some interesting internal discussions at
 JavaSoft about the whole issue. :-)

 --
 Hassan Schroeder - [EMAIL PROTECTED]
 Webtuitive Design ===  (+1) 408-621-3445   === http://webtuitive.com

  dream.  code.


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-28 Thread Breton Slivka
JScript was originally created as an exact reverse engineering of
Javascript (including the mistakes), so that IE could read pages with
javascript on them. This was of course, during the browser wars when
they were competing for features. Jscript has fallen a bit behind
Javascript by now, so there are many features in Javascript that
Jscript does not support, such as Array extras, continuations and
function expressions.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Mark Harris

Anthony wrote:

My sentiments exactly.


On 27/10/2008, at 3:46 PM, Breton Slivka [EMAIL PROTECTED] wrote:



I'm afraid I will have to throw up
my hands and give up on you. You are a lost cause. you cannot be
reached.



Oh, good. Can we return the list to web standards now?


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Brett Patterson
Yes. But, one final question. Was the *first ever* implementation of
JavaScript designed to be object-oriented, object-based, or prototype-based?
Thank you all.

Oh and to David and Christian, in regards to the w3schools, I reread parts
of their site, and I understand now what you mean. My apologies.  :)

Thanks again,

Brett

On Mon, Oct 27, 2008 at 1:59 AM, Mark Harris [EMAIL PROTECTED] wrote:

 Anthony wrote:

 My sentiments exactly.


 On 27/10/2008, at 3:46 PM, Breton Slivka [EMAIL PROTECTED] wrote:


  I'm afraid I will have to throw up
 my hands and give up on you. You are a lost cause. you cannot be
 reached.


 Oh, good. Can we return the list to web standards now?



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-27 Thread liorean
2008/10/27 Brett Patterson [EMAIL PROTECTED]:
 Yes. But, one final question. Was the first ever implementation of
 JavaScript designed to be object-oriented, object-based, or prototype-based?
 Thank you all.

The first implementation of JavaScript is still alive in the form of
Mozilla SpiredMonkey, even though much of it has been changed since
then. It was designed to be object oriented through usage of the
prototypal inheritance scheme, so it's pretty much all three at once.
Since everything in JavaScript is an object, it can be said to be
object based as well as object oriented. Anthony Ziebell's argument
that it's prototype-based rather than object oriented is a false
dichotomy since prototypal inheritance is in fact one of the ways to
achieve objevt orientation. As such, a system can become object
oriented as a result of adding prototypal inheritance to an object
based system.

Anthony Ziebell is arguing that it's not object oriented based on the
false premise that classical inheritance is the way to achieve object
orientation and prototypal inheritance is not, despite himself linking
articles stating the contrary.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread liorean
2008/10/27 liorean [EMAIL PROTECTED]:
 The first implementation of JavaScript is still alive in the form of
 Mozilla SpiredMonkey

Or SpiderMonkey, as it is properly called :)
--
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread James Jeffery
My statement was not worded correctly.

I use Java, C++, PHP and Javascript and I can tell you that out of the lot
of them, Javascript is the most difficult to incorperate conventional Object
Orientated design. For example you cannot simply define classes, or use
visability keywords (you can do it, but not the conventional way) and some
of the OOP design patterns are difficult to put into Javascript.

I have the Apress book on Javascript Design Patterns, which helped alot when
learning OOP in JS.

Sorry my wording was wrong. I think the above is what I meant.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-27 Thread Anthony

Not exactly.

My arguement was that while javascript has objects, it is indeed  
prototype-based


It is only through arguement did any mention of javascripts  
inheritence get a mention, which is also still true. This was not the  
underlying factor, but something somone brought up.


I'm not sure why it is so bad that javascript be prototype-based? I  
have said again and again that it still does have objects, sighted  
many sources which state javascript as a prototype-based language and  
other examples for the arguement along the way... It is still a good  
language and there is nothing negative about prototype?


Anyway I only respond again because I don't like to be miss- 
represented. If you still feel I am wrong and disprove of the wiki  
articles stating it is prototype-based, you really should edit them as  
it must be a miss-representation of javascript.


Regards,
Anthony.

Sent from my iPhone!

On 28/10/2008, at 12:43 AM, liorean [EMAIL PROTECTED] wrote:


2008/10/27 Brett Patterson [EMAIL PROTECTED]:

Yes. But, one final question. Was the first ever implementation of
JavaScript designed to be object-oriented, object-based, or  
prototype-based?

Thank you all.


The first implementation of JavaScript is still alive in the form of
Mozilla SpiredMonkey, even though much of it has been changed since
then. It was designed to be object oriented through usage of the
prototypal inheritance scheme, so it's pretty much all three at once.
Since everything in JavaScript is an object, it can be said to be
object based as well as object oriented. Anthony Ziebell's argument
that it's prototype-based rather than object oriented is a false
dichotomy since prototypal inheritance is in fact one of the ways to
achieve objevt orientation. As such, a system can become object
oriented as a result of adding prototypal inheritance to an object
based system.

Anthony Ziebell is arguing that it's not object oriented based on the
false premise that classical inheritance is the way to achieve object
orientation and prototypal inheritance is not, despite himself linking
articles stating the contrary.
--
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread liorean
2008/10/27 Anthony [EMAIL PROTECTED]:
 My arguement was that while javascript has objects, it is indeed
 prototype-based

Oh, we're not disputing that. But look at some of your earlier comments.



This for instance:
2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
 Sure, that's what an object is. But OOP is not just about an object.
 There is a lot more involved.

 Don't get me wrong, I am a fan of JavaScript - but it has faux classes and
 objects, and this is why my opinion of JavaScript is that it is prototype,
 not object.

First of all I'm assuming you meaning object-based and prototype-based
there, because the sentence as written just does not make sense.
Anyway, it's a false dichotomy because JavaScript is object-based AND
prototype-based. It's also object oriented.

Also, while you can say it's got faux classes (it actually has in the
ECMAScript specification, but nothing author accessible) those classes
have no greater importance to the author as they are not available to
user JavaScript.


Here's another such statement of yours:
2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
 Forgot to clarify one thing: ECMAScript is fully OO in my opinion, however
 JavaScript is not a full implementation of ECMAScript, unfortunately.

This sounds like you're insinuating that while ECMAScript is fully
object oriented, JavaScript is not. That's just plain false.


Another one:
2008/10/27 Anthony Ziebell [EMAIL PROTECTED]:
 There is a difference between the use of object and object-oriented
 programming. Coad / Yourdon suggests object-oriented being classes and
 objects, inheritance and communication with messages. Does JavaScript have
 classes?

Not user classes, no. Only implementation/host.

Can inheritance of JavaScript occur without prototype?

Not automatically, no. Why would it need another inheritance mechanism
in order to be object oriented?

 [snip]
 Object-oriented programming consists of native inheritance. Are you
 suggesting that a prototypical approach to inheritance one in the same as
 native inheritance?

Do you mean native as in the implementation language (machine
native, if you will) or native as in user JavaScript?

Anyway, the inheritance mechanism in JavaScript is prototype
delegation, and it certainly is the native method of inheritance for
JavaScript. It may or may not be the method of inheritance for host
objects, but that's another story.




2008/10/27 Anthony [EMAIL PROTECTED]:
 It is only through arguement did any mention of javascripts inheritence get
 a mention, which is also still true. This was not the underlying factor, but
 something somone brought up.

It's the core part of being a prototype-based language, so even if
you've not mentioned inheritance you've certainly talked about it. But
you have at several occasions mentioned inheritance, so that's beyond
the point.

 I'm not sure why it is so bad that javascript be prototype-based? I have
 said again and again that it still does have objects, sighted many sources
 which state javascript as a prototype-based language and other examples for
 the arguement along the way... It is still a good language and there is
 nothing negative about prototype?

We're not arguing about that. We're arguing that it being
prototype-based is the very factor that makes it object oriented. But
you on the other hand have at least seemingly argued that it is not
object oriented, which is the point we've been addressing all along.

 Anyway I only respond again because I don't like to be miss-represented. If
 you still feel I am wrong and disprove of the wiki articles stating it is
 prototype-based, you really should edit them as it must be a
 miss-representation of javascript.

We're not arguing against the articles. We've been arguing constantly
throughout this thread that JavaScript may be prototype-based, but
that does not make it any less object oriented. And I don't think I'm
missrepresenting you at all when I say you've argued against that
point.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Anthony
Not once did I hear someone say it was prototype-based. Intact others  
have flat out denied it.


The question was is it either object or prototype. I merely stated if  
anything it should be seen as prototype, but it does have objects.


Then, it followed with all sorts of garbage from those trying to  
debunk the notion of javascript being prototype. Not once did I say it  
does not have objects. Intact I offered that it does.


Regards,
Anthony.

Sent from my iPhone!

On 28/10/2008, at 7:40 AM, liorean [EMAIL PROTECTED] wrote:


2008/10/27 Anthony [EMAIL PROTECTED]:

My arguement was that while javascript has objects, it is indeed
prototype-based


Oh, we're not disputing that. But look at some of your earlier  
comments.




This for instance:
2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
Sure, that's what an object is. But OOP is not just about an  
object.

There is a lot more involved.

Don't get me wrong, I am a fan of JavaScript - but it has faux  
classes and
objects, and this is why my opinion of JavaScript is that it is  
prototype,

not object.


First of all I'm assuming you meaning object-based and prototype-based
there, because the sentence as written just does not make sense.
Anyway, it's a false dichotomy because JavaScript is object-based AND
prototype-based. It's also object oriented.

Also, while you can say it's got faux classes (it actually has in the
ECMAScript specification, but nothing author accessible) those classes
have no greater importance to the author as they are not available to
user JavaScript.


Here's another such statement of yours:
2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
Forgot to clarify one thing: ECMAScript is fully OO in my opinion,  
however

JavaScript is not a full implementation of ECMAScript, unfortunately.


This sounds like you're insinuating that while ECMAScript is fully
object oriented, JavaScript is not. That's just plain false.


Another one:
2008/10/27 Anthony Ziebell [EMAIL PROTECTED]:

There is a difference between the use of object and object-oriented
programming. Coad / Yourdon suggests object-oriented being classes  
and
objects, inheritance and communication with messages. Does  
JavaScript have

classes?


Not user classes, no. Only implementation/host.


Can inheritance of JavaScript occur without prototype?


Not automatically, no. Why would it need another inheritance mechanism
in order to be object oriented?


[snip]
Object-oriented programming consists of native inheritance. Are you
suggesting that a prototypical approach to inheritance one in the  
same as

native inheritance?


Do you mean native as in the implementation language (machine
native, if you will) or native as in user JavaScript?

Anyway, the inheritance mechanism in JavaScript is prototype
delegation, and it certainly is the native method of inheritance for
JavaScript. It may or may not be the method of inheritance for host
objects, but that's another story.




2008/10/27 Anthony [EMAIL PROTECTED]:
It is only through arguement did any mention of javascripts  
inheritence get
a mention, which is also still true. This was not the underlying  
factor, but

something somone brought up.


It's the core part of being a prototype-based language, so even if
you've not mentioned inheritance you've certainly talked about it. But
you have at several occasions mentioned inheritance, so that's beyond
the point.

I'm not sure why it is so bad that javascript be prototype-based? I  
have
said again and again that it still does have objects, sighted many  
sources
which state javascript as a prototype-based language and other  
examples for
the arguement along the way... It is still a good language and  
there is

nothing negative about prototype?


We're not arguing about that. We're arguing that it being
prototype-based is the very factor that makes it object oriented. But
you on the other hand have at least seemingly argued that it is not
object oriented, which is the point we've been addressing all along.

Anyway I only respond again because I don't like to be miss- 
represented. If
you still feel I am wrong and disprove of the wiki articles stating  
it is

prototype-based, you really should edit them as it must be a
miss-representation of javascript.


We're not arguing against the articles. We've been arguing constantly
throughout this thread that JavaScript may be prototype-based, but
that does not make it any less object oriented. And I don't think I'm
missrepresenting you at all when I say you've argued against that
point.
--
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm

Re: [WSG] JavaScript clarification please

2008-10-27 Thread Breton Slivka
It is my understanding that the bulk of those OOP design patterns are
useful to get around the limitations of static languages like C++ and
Java, that don't allow you to arbitrarily add/remove properties from
instances, change the type of a value, or allow higher order functions
(functions that return functions values), or allow you to pass in
functions as values.   Given that javascript allows all those things,
much of those traditional OOP design patterns don't make much sense,
because they're getting around a limitation that doesn't exist.

I haven't extensively used the OOP facilities in PHP, I've always
found the syntax to be ugly as hell, I could never bring myself to
type that crap willingly. So unfortunately, I cannot speak
knowledgably about how difficult or hard it is in PHP.




On Tue, Oct 28, 2008 at 1:17 AM, James Jeffery
[EMAIL PROTECTED] wrote:
 My statement was not worded correctly.

 I use Java, C++, PHP and Javascript and I can tell you that out of the lot
 of them, Javascript is the most difficult to incorperate conventional Object
 Orientated design. For example you cannot simply define classes, or use
 visability keywords (you can do it, but not the conventional way) and some
 of the OOP design patterns are difficult to put into Javascript.

 I have the Apress book on Javascript Design Patterns, which helped alot when
 learning OOP in JS.

 Sorry my wording was wrong. I think the above is what I meant.

 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Keryx Web

Brett Patterson skrev:
 I am in the middle of a conversation with this guy who says that 
JavaScript is an object-oriented language. Is he correct? Could you 
please site some references?


I have read the whole thread up until now, but will answer your starting 
message, since I am not addressing a single specific respondent.


I am in charge of developing DOM Scripting courses for the Curriculum 
Framework of the WaSP Education Task Force[1]


I have therefore tried to read every single resource about JavaScript, 
ECMAScript and the DOM that has been written from a computer science 
perspective. There are not that many, which might be a reason behind the 
confusion.


Anyway: JavaScript (a term owned by Sun, licensed to Mozilla, and used 
by all browser vendors but Microsoft) is in all essence, as Liorean has 
stated, a superset of ECMAScript 3.0. That is also the sentiment of 
Brendan Eich - and should therefore be taken as a final word. (Anthony 
was indeed wrong about this.) JScript as implemented in Internet 
Explorer is roughly equivalent, but deviates in some small ways.


JavaScript is a mix of Self, Scheme and C (according to the ECMAScript 
3.1 draft, the love child between Scheme and C according to Brendan Eich).


JavaScript is indeed Object Oriented, but even though every script is 
run within a host object - usually the window object of a browser - a 
procedural style is possible to use. 90's DHTML scripts were usually 
procedural and used document.write (which is not ECMAScript but part of 
the DOM) in a way that reminds me of *standard streams*, which could be 
provided by the host object, but usually aren't.


Public, private and protected methods and properties are not easily 
implemented. Object Oriented design patterns (singletons, factories, 
registry, adaptors...) can usually be emulated. Sometimes this is only 
done through considerable wizardry using concepts like lambda and closures.


ECMAScript 4.0 aka JavaScript 2.0 was supposed to get a limited class 
based inheritance mechanism to *complement* the prototype based one we 
use today. Those plans have been halted. ECMAScript Harmony will most 
probably *not* get any class based inheritance.


(At least two JavaScript engines (V8 and Squirrelfish Extreme) emulate 
class based object creation as part of their just in time compilation, 
but that really is a compiler issue.)


ECMASCript 3.1 will get a few new methods to facilitate easier 
inheritance patterns. E.g. Object.freeze(). Many popular libraries also 
have methods that facilitate OO-patterns.


As old school cut' n' paste coding is getting superseded by libraries 
procedural code is becoming less seen and OO-style coding is getting 
more used.


Indeed, using object chaining in JQuery et al, the programming is even 
well on its way to become *declarative*.


Summary:

1. JavaScript *is* OO.
2. JavaScript uses a prototypal - class-less - inheritance mechanism.
3. Anyone writing a script can use procedural style, OO-style or even 
make forays into a declarative style.


Nit picking on some stuff in the thread:

JavaScript has no pure hash-tables, aka associative arrays. Object 
properties can be used to emulate associative arrays, though. A PHP 
programmer will feel very limited, though.


A JavaScript object *is* not an array (once again Anthony got it wrong). 
It can have methods as well as properties. asideArrays are however 
objects, and confusingly


typeof [ 1, 2 ]

evalutes to object, not array. A major design flaw.

The best known way to test for an array is:

Object.prototype.toString.apply(value) === '[object Array]'

Discovered by Mark Miller of Google./aside

From a very strict computer science point of view averything in 
JavaScript is *not* an object. (No matter how much Alex Dojo Russel et 
al. reiterates that mantra.) In practice everything is. JavaScript has 
got a few primitives (numbers, strings, booleans, undefined). Whenever 
a primitive is referenced with an OO-syntax it is converted into its 
corresponding wrapper object. This was modeled after Java according to 
Brendan, and he has stated that it probably was a bad idea. (Search the 
ES4 mailing list for a reference.)



Lars Gunther

Sources:

MDC, including https://developer.mozilla.org/En/About_JavaScript
ES 3.0 spec
ES 3.1 spec draft
JavaScript, The Definitive Guide (latest edition)
ES3.1 mailing list
ES 4/Harmony mailing list
Doug Crockfords site and book (JavaScript, the good parts)
Numerous other JavaScript books

1. 
http://www.webstandards.org/2008/07/31/announcing-the-wasp-curriculum-framework/




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Breton Slivka
On Mon, Oct 27, 2008 at 11:00 PM, Brett Patterson
[EMAIL PROTECTED] wrote:
 Yes. But, one final question. Was the first ever implementation of
 JavaScript designed to be object-oriented, object-based, or prototype-based?
 Thank you all.


Here is Brenden Eich, Javascript's creator, pontificating on the
history and genesis of javascript

http://weblogs.mozillazine.org/roadmap/archives/2008/04/popularity.html#more

Quote:  I'm not proud, but I'm happy that I chose Scheme-ish
first-class functions and Self-ish (albeit singular) prototypes as the
main ingredients.

So in short, Yes, it was object oriented, with prototype-based
inheritence, first class scheme like functions, and (thanks to
netscape management) Java like syntax right from the start.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Anthony Ziebell




Hey Breton,

I think the examples you gave are implemented in the PHP object and are
relatively simple to implement.

Cheers,
Anthony.

Breton Slivka wrote:

  It is my understanding that the bulk of those OOP design patterns are
useful to get around the limitations of static languages like C++ and
Java, that don't allow you to arbitrarily add/remove properties from
instances, change the type of a value, or allow higher order functions
(functions that return functions values), or allow you to pass in
functions as values.   Given that _javascript_ allows all those things,
much of those traditional OOP design patterns don't make much sense,
because they're getting around a limitation that doesn't exist.

I haven't extensively used the OOP facilities in PHP, I've always
found the syntax to be ugly as hell, I could never bring myself to
type that crap willingly. So unfortunately, I cannot speak
knowledgably about how difficult or hard it is in PHP.




On Tue, Oct 28, 2008 at 1:17 AM, James Jeffery
[EMAIL PROTECTED] wrote:
  
  
My statement was not worded correctly.

I use Java, C++, PHP and _javascript_ and I can tell you that out of the lot
of them, _javascript_ is the most difficult to incorperate conventional Object
Orientated design. For example you cannot simply define classes, or use
visability keywords (you can do it, but not the conventional way) and some
of the OOP design patterns are difficult to put into _javascript_.

I have the Apress book on _javascript_ Design Patterns, which helped alot when
learning OOP in JS.

Sorry my wording was wrong. I think the above is what I meant.

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

  
  

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***


  




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Anthony Ziebell




Thanks Keryx,

Some interesting information. Nice point on the arrays actually being
objects. At one point you did mention _javascript_ is object-based, then
in another, prototype-based. So that confuses me a little. If your
point is that it is object-based and uses prototype to inherit objects,
I think I understand your point.

Still confuses me though - if someone is object-orientated but is in
essence prototype-based (with regards to object, inheritance, etc), why
is it incorrect to say _javascript_ is prototype-based?

Cheers,
Anthony.



Keryx Web wrote:
Brett
Patterson skrev:
  
 I am in the middle of a conversation with this guy who says that
_javascript_ is an object-oriented language. Is he correct? Could you
please site some references?
  
  
I have read the whole thread up until now, but will answer your
starting message, since I am not addressing a single specific
respondent.
  
  
I am in charge of developing DOM Scripting courses for the Curriculum
Framework of the WaSP Education Task Force[1]
  
  
I have therefore tried to read every single resource about _javascript_,
ECMAScript and the DOM that has been written from a computer science
perspective. There are not that many, which might be a reason behind
the confusion.
  
  
Anyway: _javascript_ (a term owned by Sun, licensed to Mozilla, and used
by all browser vendors but Microsoft) is in all essence, as Liorean has
stated, a superset of ECMAScript 3.0. That is also the sentiment of
Brendan Eich - and should therefore be taken as a final word. (Anthony
was indeed wrong about this.) JScript as implemented in Internet
Explorer is roughly equivalent, but deviates in some small ways.
  
  
_javascript_ is a mix of Self, Scheme and C (according to the ECMAScript
3.1 draft, the "love child between Scheme and C" according to Brendan
Eich).
  
  
_javascript_ is indeed Object Oriented, but even though every script is
run within a host object - usually the window object of a browser - a
procedural style is possible to use. 90's DHTML scripts were usually
procedural and used document.write (which is not ECMAScript but part of
the DOM) in a way that reminds me of *standard streams*, which could be
provided by the host object, but usually aren't.
  
  
Public, private and protected methods and properties are not easily
implemented. Object Oriented design patterns (singletons, factories,
registry, adaptors...) can usually be emulated. Sometimes this is only
done through considerable wizardry using concepts like lambda and
closures.
  
  
ECMAScript 4.0 aka _javascript_ 2.0 was supposed to get a limited class
based inheritance mechanism to *complement* the prototype based one we
use today. Those plans have been halted. ECMAScript "Harmony" will most
probably *not* get any class based inheritance.
  
  
(At least two _javascript_ engines (V8 and Squirrelfish Extreme) emulate
class based object creation as part of their just in time compilation,
but that really is a compiler issue.)
  
  
ECMASCript 3.1 will get a few new methods to facilitate easier
inheritance patterns. E.g. Object.freeze(). Many popular libraries also
have methods that facilitate OO-patterns.
  
  
As old school cut' n' paste coding is getting superseded by libraries
procedural code is becoming less seen and OO-style coding is getting
more used.
  
  
Indeed, using object chaining in JQuery et al, the programming is even
well on its way to become *declarative*.
  
  
Summary:
  
  
1. _javascript_ *is* OO.
  
2. _javascript_ uses a prototypal - class-less - inheritance mechanism.
  
3. Anyone writing a script can use procedural style, OO-style or even
make forays into a declarative style.
  
  
Nit picking on some stuff in the thread:
  
  
_javascript_ has no pure hash-tables, aka associative arrays. Object
properties can be used to emulate associative arrays, though. A PHP
programmer will feel very limited, though.
  
  
A _javascript_ object *is* not an array (once again Anthony got it
wrong). It can have methods as well as properties. asideArrays
are however objects, and confusingly
  
  
typeof [ 1, 2 ]
  
  
evalutes to "object", not "array". A major design flaw.
  
  
The best known way to test for an array is:
  
  
Object.prototype.toString.apply(value) === '[object Array]'
  
  
Discovered by Mark Miller of Google./aside
  
  
>From a very strict computer science point of view averything in
_javascript_ is *not* an object. (No matter how much Alex "Dojo" Russel
et al. reiterates that mantra.) In practice everything is. _javascript_
has got a few "primitives" (numbers, strings, booleans, undefined).
Whenever a primitive is referenced with an OO-syntax it is converted
into its corresponding wrapper object. This was modeled after Java
according to Brendan, and he has stated that it probably was a bad
idea. (Search the ES4 mailing list for a reference.)
  
  
  
Lars Gunther
  
  
Sources:
  
  
MDC, including https://developer.mozilla.org/En/About_JavaScript
  
ES 3.0 spec
 

Re: [WSG] JavaScript clarification please

2008-10-27 Thread liorean
2008/10/27 Anthony [EMAIL PROTECTED]:
 Not once did I hear someone say it was prototype-based. Intact others have
 flat out denied it.

 The question was is it either object or prototype. I merely stated if
 anything it should be seen as prototype, but it does have objects.

Now you're doing that again. What do you mean when you say is it
either object or prototype? Because the sentence as you write it is
nonsensical. If you mean object-based and prototype-based
respectively, then say that. If you mean object oriented, then say
that. If you mean that it has objects, then say that. But saying
javascript is object or javascript is prototype is nonsensical.

For the record, pretty much everyone has said either that it uses
prototypal inheritance - which means the same thing as saying it's
prototype-based - or have said that it is prototype-based.


 Then, it followed with all sorts of garbage from those trying to debunk the
 notion of javascript being prototype. Not once did I say it does not have
 objects. Intact I offered that it does.

it has objects does not mean the same as object oriented. It doesn't
even mean the same as object-based.

You've argued that it's prototype-based rather than object oriented,
and every time we've said that it's both you've argued against us. We
have not debunked that it's prototype-based, in fact we've brought up
the fact it has prototypal inheritance and this is one of the
mechanisms that makes it object oriented several times.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Keryx Web

Anthony Ziebell skrev:
Still confuses me though - if someone is object-orientated but is in 
essence prototype-based (with regards to object, inheritance, etc), why 
is it incorrect to say JavaScript is prototype-based?




Your confusion comes from comparing apples to steam trains.

Prototypes are an inheritance mechanism for objects.

Classes are another inheritance mechanism.

A language may implement either one or both (very rare).

It does not matter which inheritance mechanism that is used. It is still 
an OO language.


It is *not* incorrect to say JavaScript is prototype based. It is. No 
one is denying it.


It is *not* incorrect to say JavaScript is OO. It is, since OO is a 
paradigm for programming which JS fits very neatly in. It is de facto 
called OO in the ECMAScript spec.


It is *not* incorrect to say JavaScript is object based. It is - since 
it has object wrappers for all primitive values.


You really did seem to say that classes are needed for a language to be 
called OO. Now you have stated that you did not intend to say that. Case 
closed.



Lars Gunther


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Anthony Ziebell




Ok, great.

It was my intent to acknowledge some standards / submissions for OO
which inferred classes / native inheritance were needed.

Thanks for your help :)

Cheers,
Anthony.

Keryx Web wrote:
Anthony
Ziebell skrev:
  
  Still confuses me though - if someone is
object-orientated but is in essence prototype-based (with regards to
object, inheritance, etc), why is it incorrect to say _javascript_ is
prototype-based?


  
  
Your confusion comes from comparing apples to steam trains.
  
  
Prototypes are an inheritance mechanism for objects.
  
  
Classes are another inheritance mechanism.
  
  
A language may implement either one or both (very rare).
  
  
It does not matter which inheritance mechanism that is used. It is
still an OO language.
  
  
It is *not* incorrect to say _javascript_ is prototype based. It is. No
one is denying it.
  
  
It is *not* incorrect to say _javascript_ is OO. It is, since OO is a
paradigm for programming which JS fits very neatly in. It is de facto
called OO in the ECMAScript spec.
  
  
It is *not* incorrect to say _javascript_ is object based. It is - since
it has object wrappers for all primitive values.
  
  
You really did seem to say that classes are needed for a language to be
called OO. Now you have stated that you did not intend to say that.
Case closed.
  
  
  
Lars Gunther
  
  
  
***
  
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
  
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
  
Help: [EMAIL PROTECTED]
  
***
  
  
  




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Brett Patterson
I am sorry, but I must ask. Are you saying that the term JavaScript is owned
by Sun? Or just the Java part? And, yes, JavaScript is implemented in
Internet Explorer.

On Mon, Oct 27, 2008 at 6:18 PM, Anthony Ziebell 
[EMAIL PROTECTED] wrote:

  Ok, great.

 It was my intent to acknowledge some standards / submissions for OO which
 inferred classes / native inheritance were needed.

 Thanks for your help :)

 Cheers,
 Anthony.

 Keryx Web wrote:

 Anthony Ziebell skrev:

 Still confuses me though - if someone is object-orientated but is in
 essence prototype-based (with regards to object, inheritance, etc), why is
 it incorrect to say JavaScript is prototype-based?


 Your confusion comes from comparing apples to steam trains.

 Prototypes are an inheritance mechanism for objects.

 Classes are another inheritance mechanism.

 A language may implement either one or both (very rare).

 It does not matter which inheritance mechanism that is used. It is still an
 OO language.

 It is *not* incorrect to say JavaScript is prototype based. It is. No one
 is denying it.

 It is *not* incorrect to say JavaScript is OO. It is, since OO is a
 paradigm for programming which JS fits very neatly in. It is de facto called
 OO in the ECMAScript spec.

 It is *not* incorrect to say JavaScript is object based. It is - since it
 has object wrappers for all primitive values.

 You really did seem to say that classes are needed for a language to be
 called OO. Now you have stated that you did not intend to say that. Case
 closed.


 Lars Gunther


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-27 Thread liorean
2008/10/28 Brett Patterson [EMAIL PROTECTED]:
 I am sorry, but I must ask. Are you saying that the term JavaScript is owned
 by Sun? Or just the Java part? And, yes, JavaScript is implemented in
 Internet Explorer.

Yes, it's a registred trademark of Sun, licenced to Netscape once upon
a time as part of a marketing deal including bundling the Java runtime
with Navigator. (Netscape had originally intended to use the name
LiveScript.)


And it would be more correct to say Microsoft implements ECMAScript
than to say they implement JavaScript. They do not implement most of
the Netscape/Mozilla JavaScript additions to ECMAScript.

The name JavaScript is very seldom used by Microsoft. If you read
Microsoft employee blogs and official statements, you almost never
encounter that term. They prefer to either use their own JScript name
or the ECMAScript name.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Breton Slivka
The term Javascript is indeed owned by Sun. The implementation of
Ecmascript in IE is called JScript, not Javascript, so it doesn't
infringe the trademark (technically, but it's similar enough that
people can still easily think that IE calls it Javascript)


On Tue, Oct 28, 2008 at 12:20 PM, Brett Patterson
[EMAIL PROTECTED] wrote:
 I am sorry, but I must ask. Are you saying that the term JavaScript is owned
 by Sun? Or just the Java part? And, yes, JavaScript is implemented in
 Internet Explorer.

 On Mon, Oct 27, 2008 at 6:18 PM, Anthony Ziebell
 [EMAIL PROTECTED] wrote:

 Ok, great.

 It was my intent to acknowledge some standards / submissions for OO which
 inferred classes / native inheritance were needed.

 Thanks for your help :)

 Cheers,
 Anthony.

 Keryx Web wrote:

 Anthony Ziebell skrev:

 Still confuses me though - if someone is object-orientated but is in
 essence prototype-based (with regards to object, inheritance, etc), why is
 it incorrect to say JavaScript is prototype-based?


 Your confusion comes from comparing apples to steam trains.

 Prototypes are an inheritance mechanism for objects.

 Classes are another inheritance mechanism.

 A language may implement either one or both (very rare).

 It does not matter which inheritance mechanism that is used. It is still
 an OO language.

 It is *not* incorrect to say JavaScript is prototype based. It is. No one
 is denying it.

 It is *not* incorrect to say JavaScript is OO. It is, since OO is a
 paradigm for programming which JS fits very neatly in. It is de facto called
 OO in the ECMAScript spec.

 It is *not* incorrect to say JavaScript is object based. It is - since it
 has object wrappers for all primitive values.

 You really did seem to say that classes are needed for a language to be
 called OO. Now you have stated that you did not intend to say that. Case
 closed.


 Lars Gunther


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***

 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Hassan Schroeder

Brett Patterson wrote:
I am sorry, but I must ask. Are you saying that the term JavaScript is 
owned by Sun? 


Yes, and googling javascript trademark gives a first hit of
  http://en.wikipedia.org/wiki/JavaScript


And, yes, JavaScript is implemented in Internet Explorer.


And, no, the same reference will explain why that's incorrect.

FWIW,
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-621-3445   === http://webtuitive.com

  dream.  code.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread liorean
2008/10/28 liorean [EMAIL PROTECTED]:
 Yes, it's a registred trademark of Sun,

Actually a Trademark, not a Registred Trademark, apparently.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-27 Thread Hassan Schroeder

liorean wrote:


(Netscape had originally intended to use the name LiveScript.)


Actually, it was initially released as LiveScript and renamed later.

So much backstory on that, but at this point I have no idea what's
covered by my then employment contract. Regardless, good times. :-)

--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-621-3445   === http://webtuitive.com

  dream.  code.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Replacing a paragraph with JS [was: Re: [WSG] JavaScript clarification please]

2008-10-26 Thread Benjamin Hawkes-Lewis

Brett Patterson wrote:
On a different 
note, I have a problem with the JavaScript code I am writing.


If you're going to begin a new topic, you should always begin a new 
thread to avoid confusing the old thread with irrelevant material and to 
attract potential readers who are disinterested in the old thread's topic.


The code is suppose to replace a 
paragraph for Microsoft Internet Explorer users, using the replace().


Note that selectively displaying user guidance based on browser
detection is problematic since:

1. Other browsers that you haven't tested might have the same behavior,
especially if they use the same web engine (Trident) as Internet
Explorer, as Maxthon and Avant do.

2. If all other popular browsers have a different behavior, a future
version of Internet Explorer might change to mimic them, or vice versa.

3. Browser detection is not robust, since browsers (either by default or
by users configuration) often spoof other browsers in order to
circumvent browser detection (for example, because it is used to track
them, block their access to a site, or provide them with a behaviors
designed for an earlier version of their browser that no longer work).

Where possible, feature detection should be preferred to browser
detection and providing the user with all available guidance should be
preferred to trying to second-guess what guidance is relevant to them.

Given users' natural propensity to click on things, when you have to
explain that you need click on something in order for something to
happen, that is often a sign of an interface that is too hard to use.
Requiring users to differentiate between single-, double-, and
triple-clicking sounds especially difficult, and especially hard to
translate when using alternative input devices - how do you triple-click
using a keyboard, or speech recognition, and a mobile phone touchscreen?

I'm also curious about why Internet Explorer might differ from other
browsers in this case, and why only it only sometimes differs.
Triple-clicking, in low-level Windows terms, appears to be either three
clicks in quick succession or a double click followed by a single click
or a single followed by a double click:

http://msdn.microsoft.com/en-us/magazine/cc163628.aspx

As 
I understand it, there is a maximum of 255 characters in a line, and 
here is the line I am using. 


Per line of what? Understand from where? There are no line length limits
in HTML or JavaScript as far as I know.


How do I get it to work?


Passing your JavaScript code through JSLint and running it with a
debugger would be a good start, since it has machine-detectable syntax
errors:

http://www.jslint.com/

Debugging with Gecko: http://www.getfirebug.com/

Debugging with Trident: 
http://www.my-debugbar.com/wiki/CompanionJS/HomePage (or IE 8 Beta 2)


Debugging with WebKit: http://webkit.org/blog/197/web-inspector-redesign/

Debugging with Opera:
http://www.opera.com/products/dragonfly/

See also:

http://siliconforks.com/doc/debugging-javascript/


This is the code I am using:


When asking about HTML and JS code, it is best to provide a full HTML
document and a full JS script not a snippet, since how the snippet works
can be drastically changed by HTML and JS elsewhere in the page.

See also this article about test case reduction when reporting bugs from
the WebKit project:

http://webkit.org/quality/reduction.html

Often the very process of test case reduction can reveal where your
problem lies.

p class=notessupNote:/sup If you want to view only a specific 
table, you will have to double-click on each drop-down Title, in order 
to view individual tables.br /


Note that the use of markup for presentational purposes (sup and br) 
is discouraged in favor of CSS applied to markup used for semantic and 
structural purposes. See also:


   * Opera Web Standards Curriculum
 http://www.opera.com/wsc/

   * Shirley E. Kaiser: Semantics, HTML, XHTML, and Structure:
 http://brainstormsandraves.com/articles/semantics/structure/

   * maxdesign CSS tutorials:
 http://css.maxdesign.com.au/


script type=text/javascript
!--
 var str=supNote:/supnbsp;If you want to view only a specific 
table, you will have to double-click on each drop-down Title, in order 
to view individual tables.;


Note that according to the HTML 4.01 specification (although
implementations tend to ignore this point), your inline script ends at
the first occurrence of the sequence / , and so strictly speaking your
script consists of the following error:

var str=supNote:

You can get around this by breaking up the string with a normal
JavaScript character escape:

var str=supNote:\/supnbsp;If you want to view only a specific
table, you will have to double-click on each drop-down Title, in order
to view individual tables.;


 var browser = navigator.appName;
if(browser==Microsoft Internet Explorer)


Note that some older versions of Opera, for example, claim to be
Microsoft Internet Explorer in 

Re: [WSG] JavaScript clarification please

2008-10-26 Thread Luke Hoggett

Indeed, as Alan Kay inventor of Smalltalk and OOP said

I invented the term Object-Oriented, and I can tell you I did not have 
C++ in mind.


cheers
L


liorean wrote:

2008/10/24 James Jeffery [EMAIL PROTECTED]:
  

The language itself is NOT object-orientated, its proto-type based. It can
be used in an OOP fashion, but this is not true Object Orientation as it is
in languages such as C++.



Two serious problems with this statement: First, the prototype system
is in fact one of several ways of implementing inheritance in OOP
languages. Second, you're assuming C++ is object oriented. It's one of
several languages that is known to be OOP by programmers while in
actuality it's core is not OOP. Sure, it's possible to use C++ for
object oriented programming, but C++ allows doing things that actually
break object orientation. You can't do that in more OOP languages, for
example JavaScript.

C++ and Java are known as object oriented languages, but they are not
the ultimate in object orientation. There are plenty of languages that
are more object oriented. But they use classical inheritance, and
because JavaScript does not some people have got into their heads that
Classical inheritance == OOP which means JavaScritp != OOP. But that's
a misconception.
  



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-26 Thread Anthony Ziebell




Luke,

Discrediting c++ has nothing to do with the question "Is _javascript_
object-orientated?". With that, and in closing, I would like to point
out that my comments were based on the actual question - asking if
_javascript_ were object-oriented, not if it has objects.
Prototype has objects, and it is of my opinion that _javascript_ is more
prototype than anything else.

Thanks,
Anthony.

Luke Hoggett wrote:

  
  Indeed, as Alan Kay inventor of
Smalltalk and OOP said
  
"I invented the term
Object-Oriented, and I can tell you I did not have C++ in mind."
  
cheers
L
  
  
  liorean wrote:
  
2008/10/24 James Jeffery [EMAIL PROTECTED]:
  

  The language itself is NOT object-orientated, its proto-type based. It can
be used in an OOP fashion, but this is not true Object Orientation as it is
in languages such as C++.



Two serious problems with this statement: First, the prototype system
is in fact one of several ways of implementing inheritance in OOP
languages. Second, you're assuming C++ is object oriented. It's one of
several languages that is known to be OOP by programmers while in
actuality it's core is not OOP. Sure, it's possible to use C++ for
object oriented programming, but C++ allows doing things that actually
break object orientation. You can't do that in more OOP languages, for
example _javascript_.

C++ and Java are known as object oriented languages, but they are not
the ultimate in object orientation. There are plenty of languages that
are more object oriented. But they use classical inheritance, and
because _javascript_ does not some people have got into their heads that
Classical inheritance == OOP which means JavaScritp != OOP. But that's
a misconception.
  
  
  
***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-26 Thread Breton Slivka
On Mon, Oct 27, 2008 at 12:02 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
 Luke,

 Discrediting c++ has nothing to do with the question Is JavaScript
 object-orientated?. With that, and in closing, I would like to point out
 that my comments were based on the actual question - asking if JavaScript
 were object-oriented, not if it has objects. Prototype has objects, and it
 is of my opinion that JavaScript is more prototype than anything else.

 Thanks,
 Anthony.


Yes that's fine anthony, but the problem is that statement doesn't
actually mean anything. it is logically invalid, and quite nonsensical
to say javascript is not object oriented, it's more prototype based,
because the two things are not mutually exclusive. Javascript having
prototypical inheritence has absolutely nothing to do with the
question of whether it is object oriented or not. It can be both
object oriented, AND based on prototypal inheritence, and in fact, it
is both. 100%. This is not my opinion. it is a fact.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-26 Thread Anthony Ziebell




Breton,

There is a difference between the use of object and object-oriented
programming. Coad / Yourdon suggests object-oriented being classes and
objects, inheritance and communication with messages. Does _javascript_
have classes? Can inheritance of _javascript_ occur without prototype?

May I provide the following resource, pointing out second paragraph
under 'Adding a Method':
http://www.kevlindev.com/tutorials/_javascript_/inheritance/index.htm

Object-oriented programming consists of native inheritance. Are you
suggesting that a prototypical approach to inheritance one in the same
as native inheritance?

Thanks,
Anthony.

Breton Slivka wrote:

  On Mon, Oct 27, 2008 at 12:02 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
  
  
Luke,

Discrediting c++ has nothing to do with the question "Is _javascript_
object-orientated?". With that, and in closing, I would like to point out
that my comments were based on the actual question - asking if _javascript_
were object-oriented, not if it has objects. Prototype has objects, and it
is of my opinion that _javascript_ is more prototype than anything else.

Thanks,
Anthony.

  
  

Yes that's fine anthony, but the problem is that statement doesn't
actually mean anything. it is logically invalid, and quite nonsensical
to say "_javascript_ is not object oriented, it's more prototype based",
because the two things are not mutually exclusive. _javascript_ having
prototypical inheritence has absolutely nothing to do with the
question of whether it is object oriented or not. It can be both
object oriented, AND based on prototypal inheritence, and in fact, it
is both. 100%. This is not my opinion. it is a fact.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***


  




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-26 Thread Breton Slivka
On Mon, Oct 27, 2008 at 1:17 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
 Breton,

 There is a difference between the use of object and object-oriented
 programming.

Yes you say that, but you never go into any detail about it.  In what
way in particular is the concept and use of objects independant from
object orient programming. Did the concept of objects *not* come
from smalltalk, the original OOP language? Can you cite any occurance
of the concept of an object in programming that predates smalltalk?
Do you then, think it's therefore possible to create a language with
Objects that is not in any way inspired by, or derivative of
smalltalk? Because honestly, I'm confused about where you think the
concept of OOP came from to begin with.

 Coad / Yourdon suggests object-oriented being classes and
 objects, inheritance and communication with messages. Does JavaScript have
 classes? Can inheritance of JavaScript occur without prototype?


Those are typical elements in OOP languages, yes, and they all existed
in the original smalltalk. Are you suggesting that any slight
deviation from small talk renders a language completely not OOP? If
that were the case, you would pretty much have to rule out any
language that was not smalltalk itself. But let's assume you have a
less extreme position. What is your methodology to determine how far a
language can deviate from smalltalk before it is no longer OOP? You
seem fixated on the concept of classical inheritence being essential
for a language to be OOP, but this is contradicted by the existance of
numerous OOP languages that do not have classes. How do you account
for this?

Javascript in fact, does have classes, but not as a mechanism of
inheritence. Javascript's inheritence is prototypal. You seem to be
suggesting that this makes it not OOP. I would like to suggest that if
this makes Javascript not OOP, then you would have to say that a dozen
other OOP langauges are also not OOP.  The choice of class as a
defining characteristic of OOP seems arbitrary. If you can suggest
that any arbitrary deviation, such as class, from smalltalk makes a
language not OOP, then C++ and JAVA are not OOP either, due to their
numerous deviations.


 May I provide the following resource, pointing out second paragraph under
 'Adding a Method':
 http://www.kevlindev.com/tutorials/javascript/inheritance/index.htm

 Object-oriented programming consists of native inheritance. Are you
 suggesting that a prototypical approach to inheritance one in the same as
 native inheritance?


This is a red herring. With this, you have attempted to change the
topic from whether javascript is OOP or not, to whether it has
classical inheritence or not. Or, if you have not changed the topic,
you appear to be assuming that everyone is in agreement that classes
are a required attribute of OOP. This is arbitrary and nonsensical.

 Thanks,
 Anthony.

 Breton Slivka wrote:

 On Mon, Oct 27, 2008 at 12:02 PM, Anthony Ziebell
 [EMAIL PROTECTED] wrote:


 Luke,

 Discrediting c++ has nothing to do with the question Is JavaScript
 object-orientated?. With that, and in closing, I would like to point out
 that my comments were based on the actual question - asking if JavaScript
 were object-oriented, not if it has objects. Prototype has objects, and it
 is of my opinion that JavaScript is more prototype than anything else.

 Thanks,
 Anthony.


 Yes that's fine anthony, but the problem is that statement doesn't
 actually mean anything. it is logically invalid, and quite nonsensical
 to say javascript is not object oriented, it's more prototype based,
 because the two things are not mutually exclusive. Javascript having
 prototypical inheritence has absolutely nothing to do with the
 question of whether it is object oriented or not. It can be both
 object oriented, AND based on prototypal inheritence, and in fact, it
 is both. 100%. This is not my opinion. it is a fact.


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-26 Thread Anthony Ziebell




Hello,

Lets all just agree then, that the first insulin is simply the best, so
no further development in this area is needed. I am going to link you
to two more resources. If you feel that the first ever implementation
of object should mandate all others (such as the first insulins), then
I welcome you to submit edits to this article.

"Prototype-based programming is a style of object-oriented programming
in which classes are not present, and behavior reuse (known as
inheritance in class-based languages) is performed via a process of
cloning existing objects that serve as prototypes. This model can also
be known as class-less, prototype-oriented or instance-based
programming."

Source: http://en.wikipedia.org/wiki/Prototype-based_programming

"The most common criticism made against prototype-based languages is
that the community of software developers is not familiar with them,
despite the popularity and market permeation of _javascript_. This
knowledge level of prototype based systems seems to be changing with
the proliferation of _javascript_ frameworks and increases in the complex
use of _javascript_ as "Web 2.0" matures."

Source:
http://en.wikipedia.org/wiki/Prototype-based_programming#Criticism

Thanks,
Anthony.

Breton Slivka wrote:

  On Mon, Oct 27, 2008 at 1:17 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
  
  
Breton,

There is a difference between the use of object and object-oriented
programming.

  
  
Yes you say that, but you never go into any detail about it.  In what
way in particular is the concept and use of "objects" independant from
"object orient programming". Did the concept of "objects" *not* come
from smalltalk, the original OOP language? Can you cite any occurance
of the concept of an "object" in programming that predates smalltalk?
Do you then, think it's therefore possible to create a language with
Objects that is not in any way inspired by, or derivative of
smalltalk? Because honestly, I'm confused about where you think the
concept of OOP came from to begin with.

  
  
Coad / Yourdon suggests object-oriented being classes and
objects, inheritance and communication with messages. Does _javascript_ have
classes? Can inheritance of _javascript_ occur without prototype?


  
  
Those are typical elements in OOP languages, yes, and they all existed
in the original smalltalk. Are you suggesting that any slight
deviation from small talk renders a language completely not OOP? If
that were the case, you would pretty much have to rule out any
language that was not smalltalk itself. But let's assume you have a
less extreme position. What is your methodology to determine how far a
language can deviate from smalltalk before it is no longer OOP? You
seem fixated on the concept of classical inheritence being essential
for a language to be OOP, but this is contradicted by the existance of
numerous OOP languages that do not have classes. How do you account
for this?

_javascript_ in fact, does have classes, but not as a mechanism of
inheritence. _javascript_'s inheritence is prototypal. You seem to be
suggesting that this makes it not OOP. I would like to suggest that if
this makes _javascript_ not OOP, then you would have to say that a dozen
other OOP langauges are also not OOP.  The choice of class as a
defining characteristic of OOP seems arbitrary. If you can suggest
that any arbitrary deviation, such as class, from smalltalk makes a
language not OOP, then C++ and JAVA are not OOP either, due to their
numerous deviations.


  
  
May I provide the following resource, pointing out second paragraph under
'Adding a Method':
http://www.kevlindev.com/tutorials/_javascript_/inheritance/index.htm

Object-oriented programming consists of native inheritance. Are you
suggesting that a prototypical approach to inheritance one in the same as
native inheritance?


  
  
This is a red herring. With this, you have attempted to change the
topic from whether _javascript_ is OOP or not, to whether it has
classical inheritence or not. Or, if you have not changed the topic,
you appear to be assuming that everyone is in agreement that classes
are a required attribute of OOP. This is arbitrary and nonsensical.

  
  
Thanks,
Anthony.

Breton Slivka wrote:

On Mon, Oct 27, 2008 at 12:02 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:


Luke,

Discrediting c++ has nothing to do with the question "Is _javascript_
object-orientated?". With that, and in closing, I would like to point out
that my comments were based on the actual question - asking if _javascript_
were object-oriented, not if it has objects. Prototype has objects, and it
is of my opinion that _javascript_ is more prototype than anything else.

Thanks,
Anthony.


Yes that's fine anthony, but the problem is that statement doesn't
actually mean anything. it is logically invalid, and quite nonsensical
to say "_javascript_ is not object oriented, it's more prototype based",
because the two things are not mutually exclusive. 

Re: [WSG] JavaScript clarification please

2008-10-26 Thread Breton Slivka
On Mon, Oct 27, 2008 at 2:27 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
 Hello,

 Lets all just agree then, that the first insulin is simply the best, so no
 further development in this area is needed. I am going to link you to two
 more resources. If you feel that the first ever implementation of object
 should mandate all others (such as the first insulins), then I welcome you
 to submit edits to this article.

You seem to have missed my point. My point was, if we are to count
arbitrary deviations from smalltalk as discounting a language from
being oop (such as a lack of classical inheritence), then the only OOP
language is smalltalk. This is clearly absurd. Therefore, javascript
must be OOP.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-26 Thread Anthony Ziebell




You seem to have missed my point and many references
too.

Try reading some of the references and come back with an informed
opinion, not just nit-picking at analogies I am providing to attempt to
help you understand (as I gather you would not be reading any
references I have provided, which conflict with your argument anyway).

Thanks,
Anthony.

Breton Slivka wrote:

  On Mon, Oct 27, 2008 at 2:27 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
  
  
Hello,

Lets all just agree then, that the first insulin is simply the best, so no
further development in this area is needed. I am going to link you to two
more resources. If you feel that the first ever implementation of object
should mandate all others (such as the first insulins), then I welcome you
to submit edits to this article.

  
  
You seem to have missed my point. My point was, if we are to count
arbitrary deviations from smalltalk as discounting a language from
being oop (such as a lack of classical inheritence), then the only OOP
language is smalltalk. This is clearly absurd. Therefore, _javascript_
must be OOP.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***


  




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-26 Thread Breton Slivka
I have in fact read your references, not only just now, but again and
again I have read the wikipedia articles on the  subject many moons
ago. Frankly I fail to see how any of it contradicts my position, but
they do contradict your position. I'm afraid I will have to throw up
my hands and give up on you. You are a lost cause. you cannot be
reached.


On Mon, Oct 27, 2008 at 3:08 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
 You seem to have missed my point and many references too.

 Try reading some of the references and come back with an informed opinion,
 not just nit-picking at analogies I am providing to attempt to help you
 understand (as I gather you would not be reading any references I have
 provided, which conflict with your argument anyway).

 Thanks,
 Anthony.

 Breton Slivka wrote:

 On Mon, Oct 27, 2008 at 2:27 PM, Anthony Ziebell
 [EMAIL PROTECTED] wrote:


 Hello,

 Lets all just agree then, that the first insulin is simply the best, so no
 further development in this area is needed. I am going to link you to two
 more resources. If you feel that the first ever implementation of object
 should mandate all others (such as the first insulins), then I welcome you
 to submit edits to this article.


 You seem to have missed my point. My point was, if we are to count
 arbitrary deviations from smalltalk as discounting a language from
 being oop (such as a lack of classical inheritence), then the only OOP
 language is smalltalk. This is clearly absurd. Therefore, javascript
 must be OOP.


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-26 Thread Anthony

My sentiments exactly.

Regards,
Anthony.

Sent from my iPhone!

On 27/10/2008, at 3:46 PM, Breton Slivka [EMAIL PROTECTED] wrote:


I have in fact read your references, not only just now, but again and
again I have read the wikipedia articles on the  subject many moons
ago. Frankly I fail to see how any of it contradicts my position, but
they do contradict your position. I'm afraid I will have to throw up
my hands and give up on you. You are a lost cause. you cannot be
reached.


On Mon, Oct 27, 2008 at 3:08 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:

You seem to have missed my point and many references too.

Try reading some of the references and come back with an informed  
opinion,
not just nit-picking at analogies I am providing to attempt to help  
you
understand (as I gather you would not be reading any references I  
have

provided, which conflict with your argument anyway).

Thanks,
Anthony.

Breton Slivka wrote:

On Mon, Oct 27, 2008 at 2:27 PM, Anthony Ziebell
[EMAIL PROTECTED] wrote:


Hello,

Lets all just agree then, that the first insulin is simply the  
best, so no
further development in this area is needed. I am going to link you  
to two
more resources. If you feel that the first ever implementation of  
object
should mandate all others (such as the first insulins), then I  
welcome you

to submit edits to this article.


You seem to have missed my point. My point was, if we are to count
arbitrary deviations from smalltalk as discounting a language from
being oop (such as a lack of classical inheritence), then the only  
OOP

language is smalltalk. This is clearly absurd. Therefore, javascript
must be OOP.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-25 Thread Benjamin Hawkes-Lewis

Christian Snodgrass wrote:
I second that. They actually have a LOT more bad information than they 
do good information, and what little good information they have is often 
quite out of date (so, it was good information, but not anymore).


And when they _do_ add new information, they get that wrong too:

http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-August/016157.html

--
Benjamin Hawkes-Lewis


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Simon Josephson

Breton

Thanks for your time in explaining the intricacies and intrigues of  
Object Oriented Programming.


Very enlightening. Thanks greatly



Simon

artatwork.com.au



On 24/10/2008, at 11:58 AM, Breton Slivka wrote:


On Fri, Oct 24, 2008 at 11:00 AM, Anthony Ziebell
[EMAIL PROTECTED] wrote:

A 'superset' of ECMA3 which is not fully compliant. Right...



I think you're confused. Maybe you you're thinking of the w3c dom-
Which is a seperate standard and topic from javascript/ecmascript.
All implementations of javascript in all the current browsers are
fully Ecmascript edition 3 compliant, so far as I'm aware. If you have
additional information about specific incompatibilities, I would be
extremely interested.


On Fri, Oct 24, 2008 at 9:01 AM, Anthony Ziebell
[EMAIL PROTECTED] wrote:

Hi Brett,

JavaScript is commonly referred to as 'object-orientated' but really,
JavaScript is 'prototype-based'. They do have different meanings,  
but have

some similarities...



A language's method of inheritence is orthogonal to (has nothing to do
with) whether the language is object oriented. Inheritance is an OO
idea, so the fact that javascript has inheritence of any kind pretty
well cements that it at least has object oriented capabilities. But it
goes further than that, because all values in javascript inherit from
Object, and can be treated as objects, making Javascript a fully
object oriented language. It is not an imperative language with OO
features tacked on, like php5. Javascript is OO from the ground up.

The tricky thing here, and the part that I think is confusing you, is
that most languages described as OOP languages include an entity
called Class that javascript doesn't appear to have. You might draw
from this the conclusion that if a language doesn't have class, then
it is not OOP. Truth: class is just a random concept that quite a
lot of language designers happened to fixate on. Class is not
central to OOP. Object Orientation is *not* a computer science concept
with solid foundations in mathematics and philosophy. There is *no*
formal definition for what OOP is. There is no universally agreed on
method for determining whether something is or is not OOP.  OOP was
just an idea from some guy named Alan Kay, that he used as the basis
for his language SmallTalk. He designed SmallTalk that way because it
felt right, and he thought that it saved time. The concept was useful
enough that it became popular. This makes OOP more of a meme than a
scientific theory, as such. read more here:
http://users.ipa.net/~dwighth/smalltalk/byte_aug81/design_principles_behind_smalltalk.html


A later object oriented programming language called SELF showed that
classes were not necessarily the most important concept about Object
orientation. The most useful aspect of object orientation
historically, has been the bundling of code with the data it operates
on. Inheritence has recently been shown to be somewhat less important
and useful than it's been seen to be in the past. (deep inheritence is
bad practice in JAVA, for instance, in favor of interfaces). Alan Kay
once expressed surprise at how fixated on classes many later
programming languages have become, as he saw his concept of message
passing to be the most important aspect of the design.

Javascript is a language which is well documented to be a mashup
between 3 languages. It's a combination between SELF (Object
orientation, and prototype based inheretence), with scheme (functions
as first class values), dressed up with JAVA like syntax. (curly
braces)

Javascript contains all the important and useful parts of the object
orientation meme.  Since javascript everything in javascript is an
object- including functions, you can bundle code along with data into
a single object, storing functions as values on the object. Objects
delegate missing properties and methods to their prototypes, providing
a scheme for direct instance-to-instance inheritence which mimmicks
message passing.

So there you have it. Whether javascript is OOP is kind of a matter of
taste, rather than definition (Because there is no definition). It's a
bit like pondering whether Piet Mondrian was an artist, because he
didn't paint pictures of real things. Of course he is, but it's
confusing because Mondrian was unlike any other artist anyone had ever
seen. In the same way, Javascript is an OO language unlike any other
OOP language most people have seen. (most people haven't seen SELF, or
newtonscript, or io, or REBOL)


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***





***
List Guidelines: 

RE: [WSG] JavaScript clarification please

2008-10-24 Thread michael.brockington
 
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Brett Patterson
 Sent: 24 October 2008 02:25
 To: wsg@webstandardsgroup.org
 Subject: Re: [WSG] JavaScript clarification please
 

 Oh, most definitely agreed. Sorry if I started an argument, I only
wanted to know 
 what it was. I don't know if it is just me, but this topic seems to be
too 
 controversial. Thank you all for answering.
 


Actually, I think you have stumbled upon one of the keys to this issue:
it is controversial amongst people who are not familiar with the
language. Most of the confusion comes from people who are experts in PHP
or C++, and who believe that makes them expert in OO, or indeed
University Lecturers that are proficient in neither.

If you ask people who are truly expert with JavaScript, they will all
tell you that it _is_  Object-Oriented, not least because it is entirely
object-based: the first rule of JavaScript is: Everything is an object.
A function is an object, a string is an object, and an array is an
object.

As others have said, most other OO languages implement class-based
inheritance, often as a result of their linear underpinnings. People who
are used to this approach, then go through some horrible kludges to
simulate this unnecessarily in JavaScript apps, and then complain that
the results are horrible. Prototype-based inheritance is a very
different beast, and one that is much better suited to the way that
JavaScript is supposed to be used.

Final point of confusion:  the library called 'Prototype'. Stupid name -
never used a languages reserved word for anything: it is reserved for a
good reason, but is now better known than object.prototype itself!


Regards,
Mike


Mike Brockington
Web Development Specialist

www.calcResult.com
www.stephanieBlakey.me.uk
www.edinburgh.gov.uk

This message does not reflect the opinions of any entity other than the
author alone.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Rimantas Liubertas
...
 As others have said, most other OO languages implement class-based
 inheritance, often as a result of their linear underpinnings. People who
 are used to this approach, then go through some horrible kludges to
 simulate this unnecessarily in JavaScript apps, and then complain that
 the results are horrible. Prototype-based inheritance is a very
 different beast, and one that is much better suited to the way that
 JavaScript is supposed to be used.
...

And thereby I suggest some related reading:
http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html
Enjoy!

Regards,
Rimantas
--
http://rimantas.com/


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Anthony

Word.

Regards,
Anthony.

Sent from my iPhone!

On 24/10/2008, at 11:32 PM, James Jeffery [EMAIL PROTECTED] 
 wrote:


The language itself is NOT object-orientated, its proto-type based.  
It can be used in an OOP fashion, but this is not true Object  
Orientation as it is in languages such as C++.


On Fri, Oct 24, 2008 at 1:16 PM, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
]

On Behalf Of Brett Patterson
 Sent: 24 October 2008 02:25
 To: wsg@webstandardsgroup.org
 Subject: Re: [WSG] JavaScript clarification please


 Oh, most definitely agreed. Sorry if I started an argument, I only
wanted to know
 what it was. I don't know if it is just me, but this topic seems  
to be

too
 controversial. Thank you all for answering.



Actually, I think you have stumbled upon one of the keys to this  
issue:

it is controversial amongst people who are not familiar with the
language. Most of the confusion comes from people who are experts in  
PHP

or C++, and who believe that makes them expert in OO, or indeed
University Lecturers that are proficient in neither.

If you ask people who are truly expert with JavaScript, they will all
tell you that it _is_  Object-Oriented, not least because it is  
entirely
object-based: the first rule of JavaScript is: Everything is an  
object.

A function is an object, a string is an object, and an array is an
object.

As others have said, most other OO languages implement class-based
inheritance, often as a result of their linear underpinnings. People  
who

are used to this approach, then go through some horrible kludges to
simulate this unnecessarily in JavaScript apps, and then complain that
the results are horrible. Prototype-based inheritance is a very
different beast, and one that is much better suited to the way that
JavaScript is supposed to be used.

Final point of confusion:  the library called 'Prototype'. Stupid  
name -
never used a languages reserved word for anything: it is reserved  
for a

good reason, but is now better known than object.prototype itself!


Regards,
Mike


Mike Brockington
Web Development Specialist

www.calcResult.com
www.stephanieBlakey.me.uk
www.edinburgh.gov.uk

This message does not reflect the opinions of any entity other than  
the

author alone.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-24 Thread Christian Montoya
On Fri, Oct 24, 2008 at 8:16 AM,  [EMAIL PROTECTED] wrote:

 If you ask people who are truly expert with JavaScript, they will all
 tell you that it _is_  Object-Oriented, not least because it is entirely
 object-based: the first rule of JavaScript is: Everything is an object.
 A function is an object, a string is an object, and an array is an
 object.


I hate to throw another buzzword into the mix, but in a language where
every data structure is an object, even the primitives, like Java, we
call that Object-Based, not Object-Oriented. That's because no
matter what you do, you are always forced to use objects. In Java,
even if you just want to print Hello World, you have to create an
object, define it's main method, and call a method of the System
object.

I don't think Javascript is Object-Based, because I can just write a
function that prints instead of using an object. And even though
Javascript has objects, I think the style of writing it is more
accurately described by the prototype model.

-- 
--
Christian Montoya
christianmontoya.net


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Rimantas Liubertas
 I don't think Javascript is Object-Based, because I can just write a
 function that prints instead of using an object. And even though
 Javascript has objects, I think the style of writing it is more
 accurately described by the prototype model.

You can print Hello, world in Ruby without explicitly creating
any objects, does that also make it not Object-Based?
And yes, even primitives and nil are object in Ruby (are primitives
truly objects
in Java, or can they be wrapped into objects?).

Prototype is just one of the possible inheritance models.

Regards,
Rimantas
--
http://rimantas.com/


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Nancy Johnson
A bit off topic, but not totally:  are there any free good online
tutorials (best practices and/or standards based)  to help me learn to
write javascript?

Thanks,

Nancy

On Fri, Oct 24, 2008 at 9:49 AM, Rimantas Liubertas [EMAIL PROTECTED] wrote:
 I don't think Javascript is Object-Based, because I can just write a
 function that prints instead of using an object. And even though
 Javascript has objects, I think the style of writing it is more
 accurately described by the prototype model.

 You can print Hello, world in Ruby without explicitly creating
 any objects, does that also make it not Object-Based?
 And yes, even primitives and nil are object in Ruby (are primitives
 truly objects
 in Java, or can they be wrapped into objects?).

 Prototype is just one of the possible inheritance models.

 Regards,
 Rimantas
 --
 http://rimantas.com/


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Brett Patterson
Hey Nancy,

You might can try using w3schools.com. On my delicious bookmarks page,
delicious.com/irontombraider, I do have some JavaScript pages bookmarked.

Later,

Brett

On Fri, Oct 24, 2008 at 11:57 AM, Nancy Johnson [EMAIL PROTECTED]wrote:

 A bit off topic, but not totally:  are there any free good online
 tutorials (best practices and/or standards based)  to help me learn to
 write javascript?

 Thanks,

 Nancy

 On Fri, Oct 24, 2008 at 9:49 AM, Rimantas Liubertas [EMAIL PROTECTED]
 wrote:
  I don't think Javascript is Object-Based, because I can just write a
  function that prints instead of using an object. And even though
  Javascript has objects, I think the style of writing it is more
  accurately described by the prototype model.
 
  You can print Hello, world in Ruby without explicitly creating
  any objects, does that also make it not Object-Based?
  And yes, even primitives and nil are object in Ruby (are primitives
  truly objects
  in Java, or can they be wrapped into objects?).
 
  Prototype is just one of the possible inheritance models.
 
  Regards,
  Rimantas
  --
  http://rimantas.com/
 
 
  ***
  List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
  Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
  Help: [EMAIL PROTECTED]
  ***
 
 


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-24 Thread liorean
2008/10/24 James Jeffery [EMAIL PROTECTED]:
 The language itself is NOT object-orientated, its proto-type based. It can
 be used in an OOP fashion, but this is not true Object Orientation as it is
 in languages such as C++.

Two serious problems with this statement: First, the prototype system
is in fact one of several ways of implementing inheritance in OOP
languages. Second, you're assuming C++ is object oriented. It's one of
several languages that is known to be OOP by programmers while in
actuality it's core is not OOP. Sure, it's possible to use C++ for
object oriented programming, but C++ allows doing things that actually
break object orientation. You can't do that in more OOP languages, for
example JavaScript.

C++ and Java are known as object oriented languages, but they are not
the ultimate in object orientation. There are plenty of languages that
are more object oriented. But they use classical inheritance, and
because JavaScript does not some people have got into their heads that
Classical inheritance == OOP which means JavaScritp != OOP. But that's
a misconception.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread liorean
2008/10/24 Nancy Johnson [EMAIL PROTECTED]:
 A bit off topic, but not totally:  are there any free good online
 tutorials (best practices and/or standards based)  to help me learn to
 write javascript?

Well, not a comprehensive learn-javascript-from-scratch course, but
this is a really good place to find tutorials or articles about
separate areas of JavaScript:

uri:http://www.d.umn.edu/itss/support/Training/Online/webdesign/javascript.html
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Andrew Brown
If you want to really rock the javascript, I'd go pick up pragmatics  
book


http://www.pragprog.com/titles/cppsu/prototype-and-script-aculo-us

I became a rockstar at javascript after this book

On 24-Oct-08, at 3:35 PM, liorean wrote:


2008/10/24 Nancy Johnson [EMAIL PROTECTED]:

A bit off topic, but not totally:  are there any free good online
tutorials (best practices and/or standards based)  to help me learn  
to

write javascript?


Well, not a comprehensive learn-javascript-from-scratch course, but
this is a really good place to find tutorials or articles about
separate areas of JavaScript:

uri:http://www.d.umn.edu/itss/support/Training/Online/webdesign/javascript.html 


--
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***





***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Breton Slivka
On Sat, Oct 25, 2008 at 2:57 AM, Nancy Johnson [EMAIL PROTECTED] wrote:
 A bit off topic, but not totally:  are there any free good online
 tutorials (best practices and/or standards based)  to help me learn to
 write javascript?

 Thanks,

 Nancy

This is the best javascript lesson book online that i've found. Avoid
w3cSchools at all costs.
http://eloquentjavascript.net/





On Fri, Oct 24, 2008 at 11:32 PM, James Jeffery
[EMAIL PROTECTED] wrote:
 The language itself is NOT object-orientated, its proto-type based. It can
 be used in an OOP fashion, but this is not true Object Orientation as it is
 in languages such as C++.



I've already covered this earlier, but in short, prototype-based,
and object oriented are not mutually exclusive.  they are orthogonal
concepts. Javascript is prototype based AND object oriented.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Brett Patterson
Why would you avoid w3schools? They do have some good information. So why?

On Fri, Oct 24, 2008 at 5:12 PM, Breton Slivka [EMAIL PROTECTED] wrote:

 On Sat, Oct 25, 2008 at 2:57 AM, Nancy Johnson [EMAIL PROTECTED]
 wrote:
  A bit off topic, but not totally:  are there any free good online
  tutorials (best practices and/or standards based)  to help me learn to
  write javascript?
 
  Thanks,
 
  Nancy

 This is the best javascript lesson book online that i've found. Avoid
 w3cSchools at all costs.
 http://eloquentjavascript.net/





 On Fri, Oct 24, 2008 at 11:32 PM, James Jeffery
 [EMAIL PROTECTED] wrote:
  The language itself is NOT object-orientated, its proto-type based. It
 can
  be used in an OOP fashion, but this is not true Object Orientation as it
 is
  in languages such as C++.
 


 I've already covered this earlier, but in short, prototype-based,
 and object oriented are not mutually exclusive.  they are orthogonal
 concepts. Javascript is prototype based AND object oriented.


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-24 Thread Andrew Brown

W3Schools is S 1995
On 24-Oct-08, at 6:59 PM, Brett Patterson wrote:

Why would you avoid w3schools? They do have some good information.  
So why?


On Fri, Oct 24, 2008 at 5:12 PM, Breton Slivka [EMAIL PROTECTED]  
wrote:
On Sat, Oct 25, 2008 at 2:57 AM, Nancy Johnson  
[EMAIL PROTECTED] wrote:

 A bit off topic, but not totally:  are there any free good online
 tutorials (best practices and/or standards based)  to help me  
learn to

 write javascript?

 Thanks,

 Nancy

This is the best javascript lesson book online that i've found. Avoid
w3cSchools at all costs.
http://eloquentjavascript.net/





On Fri, Oct 24, 2008 at 11:32 PM, James Jeffery
[EMAIL PROTECTED] wrote:
 The language itself is NOT object-orientated, its proto-type  
based. It can
 be used in an OOP fashion, but this is not true Object Orientation  
as it is

 in languages such as C++.



I've already covered this earlier, but in short, prototype-based,
and object oriented are not mutually exclusive.  they are orthogonal
concepts. Javascript is prototype based AND object oriented.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-24 Thread David Dorward
Brett Patterson wrote:
 Why would you avoid w3schools? They do have some good information. So why?

They have a lot of bad information - and spotting the difference is hard
if you are trying to learn from them.


-- 
David Dorward   http://dorward.me.uk/


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-24 Thread Christian Snodgrass

David Dorward wrote:

Brett Patterson wrote:
  

Why would you avoid w3schools? They do have some good information. So why?



They have a lot of bad information - and spotting the difference is hard
if you are trying to learn from them.


  
I second that. They actually have a LOT more bad information than they 
do good information, and what little good information they have is often 
quite out of date (so, it was good information, but not anymore).



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



[WSG] JavaScript clarification please

2008-10-23 Thread Brett Patterson
I am in the middle of a conversation with this guy who says that JavaScript
is an object-oriented language. Is he correct? Could you please site some
references?


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread Anthony Ziebell




Hi Brett,

_javascript_ is commonly referred to as 'object-orientated' but really,
_javascript_ is 'prototype-based'. They do have different meanings, but
have some similarities...

http://en.wikipedia.org/wiki/Prototype
http://en.wikipedia.org/wiki/Object-oriented_programming

Cheers,
Anthony.

Brett Patterson wrote:
I
am in the middle of a conversation with this guy who says that
_javascript_ is an object-oriented language. Is he correct? Could you
please site some references?
  
***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



RE: [WSG] JavaScript clarification please

2008-10-23 Thread Kekay Olvera
 
JavaScript is an interpreted programming language with object-oriented 
capabilities
REF: 
JavaScript the Definitive Guide  5th Edition
David Flanagan
O'REILLY



Date: Thu, 23 Oct 2008 17:52:39 -0400From: [EMAIL PROTECTED]: [EMAIL 
PROTECTED]: [WSG] JavaScript clarification pleaseI am in the middle of a 
conversation with this guy who says that JavaScript is an object-oriented 
language. Is he correct? Could you please site some 
references?***List
 Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: 
http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***


Re: [WSG] JavaScript clarification please

2008-10-23 Thread Nick Tomczek
Brett,

I'd start with the Wikipedia entry on OOP (
http://en.wikipedia.org/wiki/Object_Orientated). It gives you a good
overview of what OOP is, and even has a paragraph on JavaScript and the
Document Object Model it uses. Wikipedia may not be the best source for
information if you are trying to form and argument, but it's a great place
to start looking for additinal resources since the articles are linked to
other sources, internal and external).

Nick

On Thu, Oct 23, 2008 at 2:52 PM, Brett Patterson 
[EMAIL PROTECTED] wrote:

 I am in the middle of a conversation with this guy who says that JavaScript
 is an object-oriented language. Is he correct? Could you please site some
 references?

 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

RE: [WSG] JavaScript clarification please

2008-10-23 Thread Essential eBiz Solutions Ltd
Hi Brett, 

  Javascript can be object orientated, it all depends on how your
using it. If you are using DOM etc then it's object. It's just like PHP 5
which is now object orientated with classes like GD+ and some of the classes
that rely on classes to work. I'm not a JS expert so I can't really explain
more than that, but I'm sure someone on here knows a bit more. 

 

  _  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Brett Patterson
Sent: 23 October 2008 22:53
To: wsg@webstandardsgroup.org
Subject: [WSG] JavaScript clarification please

 

I am in the middle of a conversation with this guy who says that JavaScript
is an object-oriented language. Is he correct? Could you please site some
references?

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread Brett Patterson
Hi Anthony,

What about this link? http://en.wikipedia.org/wiki/Javascript Under Features
-- Dynamic Programming?

On Thu, Oct 23, 2008 at 6:01 PM, Anthony Ziebell 
[EMAIL PROTECTED] wrote:

  Hi Brett,

 JavaScript is commonly referred to as 'object-orientated' but really,
 JavaScript is 'prototype-based'. They do have different meanings, but have
 some similarities...

 http://en.wikipedia.org/wiki/Prototype
 http://en.wikipedia.org/wiki/Object-oriented_programming

 Cheers,
 Anthony.

 Brett Patterson wrote:

 I am in the middle of a conversation with this guy who says that JavaScript
 is an object-oriented language. Is he correct? Could you please site some
 references?

 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread Brett Patterson
I am not trying to form an argument. But just trying to get my facts
straight. I don't want to sound dumb when talking to someone about
JavaScript.

On Thu, Oct 23, 2008 at 6:08 PM, Nick Tomczek [EMAIL PROTECTED] wrote:

 Brett,

 I'd start with the Wikipedia entry on OOP (
 http://en.wikipedia.org/wiki/Object_Orientated). It gives you a good
 overview of what OOP is, and even has a paragraph on JavaScript and the
 Document Object Model it uses. Wikipedia may not be the best source for
 information if you are trying to form and argument, but it's a great place
 to start looking for additinal resources since the articles are linked to
 other sources, internal and external).

 Nick


 On Thu, Oct 23, 2008 at 2:52 PM, Brett Patterson 
 [EMAIL PROTECTED] wrote:

 I am in the middle of a conversation with this guy who says that
 JavaScript is an object-oriented language. Is he correct? Could you please
 site some references?

 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread Hassan Schroeder

Brett Patterson wrote:
I am in the middle of a conversation with this guy who says that 
JavaScript is an object-oriented language. Is he correct? Could you 
please site some references?


How about the standard itself? :-)

http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

 Overview
   ...

   ECMAScript is an object-oriented programming language for
   performing computations and manipulating computational objects
   within a host environment.

HTH,
--
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-621-3445   === http://webtuitive.com

  dream.  code.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Anthony Ziebell




Hi Brett,

_javascript_ objects are augmented with prototype. It should be noted
that the example you provided also notes that the dot notation is
merely syntactic sugar - meaning it is just a little bit of eye-candy
which provides no extra functionality.

_javascript_ objects are merely arrays. This is why they are not real
objects. Objects and arrays are totally different.

Cheers,
Anthony.

Brett Patterson wrote:
Hi
Anthony,
  
What about this link? http://en.wikipedia.org/wiki/_javascript_
Under Features -- Dynamic Programming?
  
  On Thu, Oct 23, 2008 at 6:01 PM, Anthony
Ziebell [EMAIL PROTECTED]
wrote:
  

Hi Brett,

_javascript_ is commonly referred to as 'object-orientated' but really,
_javascript_ is 'prototype-based'. They do have different meanings, but
have some similarities...

http://en.wikipedia.org/wiki/Prototype
http://en.wikipedia.org/wiki/Object-oriented_programming

Cheers,
Anthony.



Brett Patterson wrote:
I
am in the middle of a conversation with this guy who says that
_javascript_ is an object-oriented language. Is he correct? Could you
please site some references?
  
***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***






***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***


  
  
  
  
***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread liorean
 Brett Patterson wrote:
 I am in the middle of a conversation with this guy who says that JavaScript
 is an object-oriented language. Is he correct? Could you please site some
 references?

There's many different things people mean when they talk about object
orientation. If they talk about the Java mode of object orientation,
then JavaScript isn't object oriented but is pretty close. On the
other hand, if they talk about the Self mode of object orientation,
then JavaScript is definitely object oriented, while Java has it's
flaws. There is no single definition that people agree on, only an
arbitrary number of points on a list where no single language uses a
metaphor that covers them all.

Everything in JavaScript is an object. Objects inherit in a run time
delegation fashion from other objects in the prototype chain, a model
inspired by Self. Types are placed on values, not variables, but
everything has a type. Encapsulation comes from closures.

2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:

 JavaScript is commonly referred to as 'object-orientated' but really,
 JavaScript is 'prototype-based'. They do have different meanings, but have
 some similarities...

Class based inheritance is not necessary for a language to be object
oriented. Prototype delegation as mode of inheritance is less common
as language designs go, but it's just as powerful if not more so.

Above all, JavaScript is an object based language.

It has imperative and functional properties, it has a
statement-expression curlies-and-semicolons, it has object orientation
and higher order programming features, it has reified closures and
lexical scope with a few dynamic scope features etc. It's a hybrid
language. But it does have object orientation.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Brett Patterson
I didn't see that. :) But as I have read in other areas, JavaScript is based
on ECMAScript. And *Object-oriented programming (OOP)* is a programming
paradigm http://en.wikipedia.org/wiki/Programming_paradigm that uses 
objects http://en.wikipedia.org/wiki/Object_%28computer_science%29 and
their interactions to design applications and computer programs. Is this
correct?

On Thu, Oct 23, 2008 at 6:18 PM, Hassan Schroeder [EMAIL PROTECTED]wrote:

 Brett Patterson wrote:

 I am in the middle of a conversation with this guy who says that
 JavaScript is an object-oriented language. Is he correct? Could you please
 site some references?


 How about the standard itself? :-)

 http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
 

  Overview
   ...

   ECMAScript is an object-oriented programming language for
   performing computations and manipulating computational objects
   within a host environment.

 HTH,
 --
 Hassan Schroeder - [EMAIL PROTECTED]
 Webtuitive Design ===  (+1) 408-621-3445   === http://webtuitive.com

  dream.  code.



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread Anthony Ziebell




Your point's are valid - my only real point here is
that it is more of a prototype-based language, than object.

Thanks,
Anthony.

liorean wrote:

  
Brett Patterson wrote:
I am in the middle of a conversation with this guy who says that _javascript_
is an object-oriented language. Is he correct? Could you please site some
references?

  
  
There's many different things people mean when they talk about object
orientation. If they talk about the Java mode of object orientation,
then _javascript_ isn't object oriented but is pretty close. On the
other hand, if they talk about the Self mode of object orientation,
then _javascript_ is definitely object oriented, while Java has it's
flaws. There is no single definition that people agree on, only an
arbitrary number of points on a list where no single language uses a
metaphor that covers them all.

Everything in _javascript_ is an object. Objects inherit in a run time
delegation fashion from other objects in the prototype chain, a model
inspired by Self. Types are placed on values, not variables, but
everything has a type. Encapsulation comes from closures.

2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:

  
  
_javascript_ is commonly referred to as 'object-orientated' but really,
_javascript_ is 'prototype-based'. They do have different meanings, but have
some similarities...

  
  
Class based inheritance is not necessary for a language to be object
oriented. Prototype delegation as mode of inheritance is less common
as language designs go, but it's just as powerful if not more so.

Above all, _javascript_ is an object based language.

It has imperative and functional properties, it has a
statement-_expression_ curlies-and-semicolons, it has object orientation
and higher order programming features, it has reified closures and
lexical scope with a few dynamic scope features etc. It's a hybrid
language. But it does have object orientation.
  




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Anthony Ziebell




Sure, that's what an "object" is. But OOP is not
just about an "object". There is a lot more involved.

Don't get me wrong, I am a fan of _javascript_ - but it has faux classes
and objects, and this is why my opinion of _javascript_ is that it is
prototype, not object.

Cheers,
Anthony.

Brett Patterson wrote:
I
didn't see that. :) But as I have read in other areas, _javascript_ is
based on ECMAScript. And Object-oriented programming (OOP) is a
  programming paradigm that uses "objects" and their interactions
to design applications and computer programs. Is this correct?
  
  On Thu, Oct 23, 2008 at 6:18 PM, Hassan
Schroeder [EMAIL PROTECTED]
wrote:
  
Brett Patterson wrote:

I am in the middle of a conversation with this guy who says that
_javascript_ is an object-oriented language. Is he correct? Could you
please site some references?



How about the standard itself? :-)

http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

Overview
 ...

 ECMAScript is an object-oriented programming language for
 performing computations and manipulating computational objects
 within a host environment.

HTH,
-- 
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design === (+1) 408-621-3445  === http://webtuitive.com

dream. code.




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



  
  
  
  
***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Anthony Ziebell




Forgot to clarify one thing: ECMAScript is fully OO
in my opinion, however _javascript_ is not a full implementation of
ECMAScript, unfortunately.

Thanks,
Anthony.

Brett Patterson wrote:
I
didn't see that. :) But as I have read in other areas, _javascript_ is
based on ECMAScript. And Object-oriented programming (OOP) is a
  programming paradigm that uses "objects" and their interactions
to design applications and computer programs. Is this correct?
  
  On Thu, Oct 23, 2008 at 6:18 PM, Hassan
Schroeder [EMAIL PROTECTED]
wrote:
  
Brett Patterson wrote:

I am in the middle of a conversation with this guy who says that
_javascript_ is an object-oriented language. Is he correct? Could you
please site some references?



How about the standard itself? :-)

http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf

Overview
 ...

 ECMAScript is an object-oriented programming language for
 performing computations and manipulating computational objects
 within a host environment.

HTH,
-- 
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design === (+1) 408-621-3445  === http://webtuitive.com

dream. code.




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



  
  
  
  
***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread liorean
2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
 JavaScript objects are augmented with prototype. It should be noted that the
 example you provided also notes that the dot notation is merely syntactic
 sugar - meaning it is just a little bit of eye-candy which provides no extra
 functionality.

 JavaScript objects are merely arrays. This is why they are not real objects.
 Objects and arrays are totally different.

Actually, they are hash tables/dictionaries/maps or whatever word you
prefer to call them by. Anyway, they are sparse string keyed objects
of variable size and not dense integer keyed arrays of fixed size. In
fact, true arrays are only available in JavaScript in the form of
strings, and those are read only.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Brett Patterson
Well, I read http://en.wikipedia.org/wiki/Prototype-based_programming and
http://en.wikipedia.org/wiki/Object-based_languages , and I see your points.
But, for arguments sake, let's say it is not prototype-based. Would it be
object-oriented, like Java or C++, or object-based?

I read these as well:

   - http://en.wikipedia.org/wiki/Object-based

   and

   -
   http://en.wikipedia.org/wiki/Category:Object-based_programming_languages

What's worst is is that now I am confused. This seems too contradictory,
based on the articles linked.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread Luke Hoggett

I once heard javascript described:

javascript is a flower in a garden full of weeds

or was it

javascript is a weed in a garden full of flowers

tel your co-arguer one of those and you'll win hands down.

Regards.
Luke

Brett Patterson wrote:
Well, I read http://en.wikipedia.org/wiki/Prototype-based_programming 
and http://en.wikipedia.org/wiki/Object-based_languages , and I see 
your points. But, for arguments sake, let's say it is not 
prototype-based. Would it be object-oriented, like Java or C++, or 
object-based?


I read these as well:

* http://en.wikipedia.org/wiki/Object-based

  and

* http://en.wikipedia.org/wiki/Category:Object-based_programming_languages

What's worst is is that now I am confused. This seems too 
contradictory, based on the articles linked.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*** 



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread Brett Patterson
No, I get it now. It is an argument waiting to happen. :) On a different
note, I have a problem with the JavaScript code I am writing. I am new to
JavaScript, and this is another reason as to why I was asking, and to know
for sure what it is/was/whatever. The code is suppose to replace a paragraph
for Microsoft Internet Explorer users, using the replace(). As I understand
it, there is a maximum of 255 characters in a line, and here is the line I
am using. How do I get it to work? This is the code I am using:

p class=notessupNote:/sup If you want to view only a specific table,
you will have to double-click on each drop-down Title, in order to view
individual tables.br /
script type=text/javascript
!--
 var str=supNote:/supnbsp;If you want to view only a specific table,
you will have to double-click on each drop-down Title, in order to view
individual tables.;
 var browser = navigator.appName;
if(browser==Microsoft Internet Explorer)
 {
 document.write(str.replace(/supNote:/supnbsp;If you want to view
only a specific table, you will have to double-click on each drop-down
Title, in order to view individual tables./, supInternet Explorer User's
Note:/sup You may have to triple click the drop-down title, in order to
view individual tables.));
 }
//--
/script


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

Re: [WSG] JavaScript clarification please

2008-10-23 Thread liorean
2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
 Forgot to clarify one thing: ECMAScript is fully OO in my opinion, however
 JavaScript is not a full implementation of ECMAScript, unfortunately.

JavaScript is a superset of ECMAScript. If ECMAScript is opbject
oriented, so is JavaScript.

As I mentioned, classes are not necessary or even important for a
language to be object oriented. Prototypal delegation is just one of
several methods of implementing inheritance in an object oriented
language. It doesn't make the language any less object oriented.

Please go have a read through this:uri:http://www.paulgraham.com/reesoo.html

JavaScript fulfills plenty of them.




2008/10/24 Brett Patterson [EMAIL PROTECTED]:
 Well, I read http://en.wikipedia.org/wiki/Prototype-based_programming and
 http://en.wikipedia.org/wiki/Object-based_languages , and I see your points.
 But, for arguments sake, let's say it is not prototype-based. Would it be
 object-oriented, like Java or C++, or object-based?

Depends on what definition you use for either of those terms. Object
orientation? Java and C++ fail to live up to some of the possible
criteria for a language being object oriented. Object based? Do you
mean that every value is an object? If so, JavaScript is that. Do you
mean that it uses prototypal inheritance? Then it is that. Do you mean
it has a limited form of object orientation without inheritance or
polymorphism? If so it is not, because it has those features.

 I read these as well:

 http://en.wikipedia.org/wiki/Object-based

 and

 http://en.wikipedia.org/wiki/Category:Object-based_programming_languages

 What's worst is is that now I am confused. This seems too contradictory,
 based on the articles linked.

That's because the definitions are fuzzy and broad. A language is
better described by what type of programming it facilitates than by
what it can be considered to be, anyway. JavaScript uses prototype
delegation. That means that properties are looked up in the object
itself, and then in the prototype of the object, and so on untill the
top of the prototype chain has been reached. It's a mode of direct
implementation-to-implementation inheritance. Classical inheritance on
the other hand sets up a chain or tree of classes, and objects are
instances of those classes. In other words objects do not inherit
directly from other objects but rather from this chain or tree of
classes - a template chain if you want, though in some of these
langauges the word template means something different. These languages
typically also have a type-to-class correspondence and a deep type
hierarchy system. Some have a separate interface scheme that is about
object and function signatures connected with the type system but that
does not allow code inheritance.
Some have only this and no implementation inheritance mechanism.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Anthony Ziebell




A 'superset' of ECMA3 which is not fully compliant.
Right...

liorean wrote:

  2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
  
  
Forgot to clarify one thing: ECMAScript is fully OO in my opinion, however
_javascript_ is not a full implementation of ECMAScript, unfortunately.

  
  
_javascript_ is a superset of ECMAScript. If ECMAScript is opbject
oriented, so is _javascript_.

As I mentioned, classes are not necessary or even important for a
language to be object oriented. Prototypal delegation is just one of
several methods of implementing inheritance in an object oriented
language. It doesn't make the language any less object oriented.

Please go have a read through this:uri:http://www.paulgraham.com/reesoo.html

_javascript_ fulfills plenty of them.




2008/10/24 Brett Patterson [EMAIL PROTECTED]:
  
  
Well, I read http://en.wikipedia.org/wiki/Prototype-based_programming and
http://en.wikipedia.org/wiki/Object-based_languages , and I see your points.
But, for arguments sake, let's say it is not prototype-based. Would it be
object-oriented, like Java or C++, or object-based?

  
  
Depends on what definition you use for either of those terms. Object
orientation? Java and C++ fail to live up to some of the possible
criteria for a language being object oriented. Object based? Do you
mean that every value is an object? If so, _javascript_ is that. Do you
mean that it uses prototypal inheritance? Then it is that. Do you mean
it has a limited form of object orientation without inheritance or
polymorphism? If so it is not, because it has those features.

  
  
I read these as well:

http://en.wikipedia.org/wiki/Object-based

and

http://en.wikipedia.org/wiki/Category:Object-based_programming_languages

What's worst is is that now I am confused. This seems too contradictory,
based on the articles linked.

  
  
That's because the definitions are fuzzy and broad. A language is
better described by what type of programming it facilitates than by
what it can be considered to be, anyway. _javascript_ uses prototype
delegation. That means that properties are looked up in the object
itself, and then in the prototype of the object, and so on untill the
top of the prototype chain has been reached. It's a mode of direct
implementation-to-implementation inheritance. Classical inheritance on
the other hand sets up a chain or tree of classes, and objects are
instances of those classes. In other words objects do not inherit
directly from other objects but rather from this chain or tree of
classes - a template chain if you want, though in some of these
langauges the word template means something different. These languages
typically also have a type-to-class correspondence and a deep type
hierarchy system. Some have a separate interface scheme that is about
object and function signatures connected with the type system but that
does not allow code inheritance.
Some have only this and no implementation inheritance mechanism.
  




***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: [EMAIL PROTECTED]***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Breton Slivka
On Fri, Oct 24, 2008 at 11:00 AM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
 A 'superset' of ECMA3 which is not fully compliant. Right...




I think you're confused. Maybe you you're thinking of the w3c dom-
Which is a seperate standard and topic from javascript/ecmascript.
All implementations of javascript in all the current browsers are
fully Ecmascript edition 3 compliant, so far as I'm aware. If you have
additional information about specific incompatibilities, I would be
extremely interested.


On Fri, Oct 24, 2008 at 9:01 AM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
 Hi Brett,

 JavaScript is commonly referred to as 'object-orientated' but really,
 JavaScript is 'prototype-based'. They do have different meanings, but have
 some similarities...


A language's method of inheritence is orthogonal to (has nothing to do
with) whether the language is object oriented. Inheritance is an OO
idea, so the fact that javascript has inheritence of any kind pretty
well cements that it at least has object oriented capabilities. But it
goes further than that, because all values in javascript inherit from
Object, and can be treated as objects, making Javascript a fully
object oriented language. It is not an imperative language with OO
features tacked on, like php5. Javascript is OO from the ground up.

The tricky thing here, and the part that I think is confusing you, is
that most languages described as OOP languages include an entity
called Class that javascript doesn't appear to have. You might draw
from this the conclusion that if a language doesn't have class, then
it is not OOP. Truth: class is just a random concept that quite a
lot of language designers happened to fixate on. Class is not
central to OOP. Object Orientation is *not* a computer science concept
with solid foundations in mathematics and philosophy. There is *no*
formal definition for what OOP is. There is no universally agreed on
method for determining whether something is or is not OOP.  OOP was
just an idea from some guy named Alan Kay, that he used as the basis
for his language SmallTalk. He designed SmallTalk that way because it
felt right, and he thought that it saved time. The concept was useful
enough that it became popular. This makes OOP more of a meme than a
scientific theory, as such. read more here:
http://users.ipa.net/~dwighth/smalltalk/byte_aug81/design_principles_behind_smalltalk.html


A later object oriented programming language called SELF showed that
classes were not necessarily the most important concept about Object
orientation. The most useful aspect of object orientation
historically, has been the bundling of code with the data it operates
on. Inheritence has recently been shown to be somewhat less important
and useful than it's been seen to be in the past. (deep inheritence is
bad practice in JAVA, for instance, in favor of interfaces). Alan Kay
once expressed surprise at how fixated on classes many later
programming languages have become, as he saw his concept of message
passing to be the most important aspect of the design.

Javascript is a language which is well documented to be a mashup
between 3 languages. It's a combination between SELF (Object
orientation, and prototype based inheretence), with scheme (functions
as first class values), dressed up with JAVA like syntax. (curly
braces)

Javascript contains all the important and useful parts of the object
orientation meme.  Since javascript everything in javascript is an
object- including functions, you can bundle code along with data into
a single object, storing functions as values on the object. Objects
delegate missing properties and methods to their prototypes, providing
a scheme for direct instance-to-instance inheritence which mimmicks
message passing.

So there you have it. Whether javascript is OOP is kind of a matter of
taste, rather than definition (Because there is no definition). It's a
bit like pondering whether Piet Mondrian was an artist, because he
didn't paint pictures of real things. Of course he is, but it's
confusing because Mondrian was unlike any other artist anyone had ever
seen. In the same way, Javascript is an OO language unlike any other
OOP language most people have seen. (most people haven't seen SELF, or
newtonscript, or io, or REBOL)


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread liorean
 2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
 Forgot to clarify one thing: ECMAScript is fully OO in my opinion, however
 JavaScript is not a full implementation of ECMAScript, unfortunately.

 liorean wrote:
 JavaScript is a superset of ECMAScript. If ECMAScript is opbject
 oriented, so is JavaScript.


2008/10/24 Anthony Ziebell [EMAIL PROTECTED]:
 A 'superset' of ECMA3 which is not fully compliant. Right...

Every language has it's implementation holes where the spec and
implementations disagree. However, JavaScript as implemented in the
SpiderMonkey engine is in fact a full implementation of ECMAScript
except for a few mostly minor fringe issues (most of them bugs, a few
of them spec bugs, some reality-trumps-specification issues). So are
Futhark, JavaScriptCore and V8 also. JScript is a bit further off, but
it's not extremely far off.

Go on, try to find a pure ECMAScript feature that is not implemented
in mentioned engines. There are a few, but I bet you'll have to try
pretty many things before you find one. And none of them are about a
whole major feature being broken.
-- 
David liorean Andersson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] JavaScript clarification please

2008-10-23 Thread Anthony Ziebell




Whether _javascript_ is OOP is kind of a matter of
taste, rather than definition (Because there is no definition)
Agreed, hence the diverse arguments for / against,
and no way everyone would be able to agree on it. Perhaps we need to
write a standard on OO.

Thanks,
Anthony.

Breton Slivka wrote:

  On Fri, Oct 24, 2008 at 11:00 AM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
  
  
A 'superset' of ECMA3 which is not fully compliant. Right...


  
  


I think you're confused. Maybe you you're thinking of the w3c dom-
Which is a seperate standard and topic from _javascript_/ecmascript.
All implementations of _javascript_ in all the current browsers are
fully Ecmascript edition 3 compliant, so far as I'm aware. If you have
additional information about specific incompatibilities, I would be
extremely interested.


On Fri, Oct 24, 2008 at 9:01 AM, Anthony Ziebell
[EMAIL PROTECTED] wrote:
  
  
Hi Brett,

_javascript_ is commonly referred to as 'object-orientated' but really,
_javascript_ is 'prototype-based'. They do have different meanings, but have
some similarities...


  
  
A language's method of inheritence is orthogonal to (has nothing to do
with) whether the language is object oriented. Inheritance is an OO
idea, so the fact that _javascript_ has inheritence of any kind pretty
well cements that it at least has object oriented capabilities. But it
goes further than that, because all values in _javascript_ inherit from
Object, and can be treated as objects, making _javascript_ a fully
object oriented language. It is not an imperative language with OO
features tacked on, like php5. _javascript_ is OO from the ground up.

The tricky thing here, and the part that I think is confusing you, is
that most languages described as OOP languages include an entity
called "Class" that _javascript_ doesn't appear to have. You might draw
from this the conclusion that if a language doesn't have "class", then
it is not OOP. Truth: "class" is just a random concept that quite a
lot of language designers happened to fixate on. "Class" is not
central to OOP. Object Orientation is *not* a computer science concept
with solid foundations in mathematics and philosophy. There is *no*
formal definition for what OOP is. There is no universally agreed on
method for determining whether something is or is not OOP.  OOP was
just an idea from some guy named Alan Kay, that he used as the basis
for his language SmallTalk. He designed SmallTalk that way because it
felt right, and he thought that it saved time. The concept was useful
enough that it became popular. This makes OOP more of a meme than a
scientific theory, as such. read more here:
http://users.ipa.net/~dwighth/smalltalk/byte_aug81/design_principles_behind_smalltalk.html


A later object oriented programming language called SELF showed that
classes were not necessarily the most important concept about Object
orientation. The most useful aspect of object orientation
historically, has been the bundling of code with the data it operates
on. Inheritence has recently been shown to be somewhat less important
and useful than it's been seen to be in the past. (deep inheritence is
bad practice in JAVA, for instance, in favor of interfaces). Alan Kay
once expressed surprise at how fixated on classes many later
programming languages have become, as he saw his concept of "message
passing" to be the most important aspect of the design.

_javascript_ is a language which is well documented to be a mashup
between 3 languages. It's a combination between SELF (Object
orientation, and prototype based inheretence), with scheme (functions
as first class values), dressed up with JAVA like syntax. (curly
braces)

_javascript_ contains all the important and useful parts of the object
orientation meme.  Since _javascript_ everything in _javascript_ is an
object- including functions, you can bundle code along with data into
a single object, storing functions as values on the object. Objects
delegate missing properties and methods to their prototypes, providing
a scheme for direct instance-to-instance inheritence which mimmicks
message passing.

So there you have it. Whether _javascript_ is OOP is kind of a matter of
taste, rather than definition (Because there is no definition). It's a
bit like pondering whether Piet Mondrian was an artist, because he
didn't paint pictures of "real" things. Of course he is, but it's
confusing because Mondrian was unlike any other artist anyone had ever
seen. In the same way, _javascript_ is an OO language unlike any other
OOP language most people have seen. (most people haven't seen SELF, or
newtonscript, or io, or REBOL)


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***


  





Re: [WSG] JavaScript clarification please

2008-10-23 Thread Brett Patterson
Oh, most definitely agreed. Sorry if I started an argument, I only wanted to
know what it was. I don't know if it is just me, but this topic seems to be
too controversial. Thank you all for answering.

On Thu, Oct 23, 2008 at 9:16 PM, Anthony Ziebell 
[EMAIL PROTECTED] wrote:

  *Whether javascript is OOP is kind of a matter of
 taste, rather than definition (Because there is no definition)*

 Agreed, hence the diverse arguments for / against, and no way everyone
 would be able to agree on it. Perhaps we need to write a standard on OO.

 Thanks,
 Anthony.

 Breton Slivka wrote:

 On Fri, Oct 24, 2008 at 11:00 AM, Anthony Ziebell[EMAIL PROTECTED] [EMAIL 
 PROTECTED] wrote:


  A 'superset' of ECMA3 which is not fully compliant. Right...



  I think you're confused. Maybe you you're thinking of the w3c dom-
 Which is a seperate standard and topic from javascript/ecmascript.
 All implementations of javascript in all the current browsers are
 fully Ecmascript edition 3 compliant, so far as I'm aware. If you have
 additional information about specific incompatibilities, I would be
 extremely interested.


 On Fri, Oct 24, 2008 at 9:01 AM, Anthony Ziebell[EMAIL PROTECTED] [EMAIL 
 PROTECTED] wrote:


  Hi Brett,

 JavaScript is commonly referred to as 'object-orientated' but really,
 JavaScript is 'prototype-based'. They do have different meanings, but have
 some similarities...




 A language's method of inheritence is orthogonal to (has nothing to do
 with) whether the language is object oriented. Inheritance is an OO
 idea, so the fact that javascript has inheritence of any kind pretty
 well cements that it at least has object oriented capabilities. But it
 goes further than that, because all values in javascript inherit from
 Object, and can be treated as objects, making Javascript a fully
 object oriented language. It is not an imperative language with OO
 features tacked on, like php5. Javascript is OO from the ground up.

 The tricky thing here, and the part that I think is confusing you, is
 that most languages described as OOP languages include an entity
 called Class that javascript doesn't appear to have. You might draw
 from this the conclusion that if a language doesn't have class, then
 it is not OOP. Truth: class is just a random concept that quite a
 lot of language designers happened to fixate on. Class is not
 central to OOP. Object Orientation is *not* a computer science concept
 with solid foundations in mathematics and philosophy. There is *no*
 formal definition for what OOP is. There is no universally agreed on
 method for determining whether something is or is not OOP.  OOP was
 just an idea from some guy named Alan Kay, that he used as the basis
 for his language SmallTalk. He designed SmallTalk that way because it
 felt right, and he thought that it saved time. The concept was useful
 enough that it became popular. This makes OOP more of a meme than a
 scientific theory, as such. read more 
 here:http://users.ipa.net/~dwighth/smalltalk/byte_aug81/design_principles_behind_smalltalk.html
  
 http://users.ipa.net/%7Edwighth/smalltalk/byte_aug81/design_principles_behind_smalltalk.html


 A later object oriented programming language called SELF showed that
 classes were not necessarily the most important concept about Object
 orientation. The most useful aspect of object orientation
 historically, has been the bundling of code with the data it operates
 on. Inheritence has recently been shown to be somewhat less important
 and useful than it's been seen to be in the past. (deep inheritence is
 bad practice in JAVA, for instance, in favor of interfaces). Alan Kay
 once expressed surprise at how fixated on classes many later
 programming languages have become, as he saw his concept of message
 passing to be the most important aspect of the design.

 Javascript is a language which is well documented to be a mashup
 between 3 languages. It's a combination between SELF (Object
 orientation, and prototype based inheretence), with scheme (functions
 as first class values), dressed up with JAVA like syntax. (curly
 braces)

 Javascript contains all the important and useful parts of the object
 orientation meme.  Since javascript everything in javascript is an
 object- including functions, you can bundle code along with data into
 a single object, storing functions as values on the object. Objects
 delegate missing properties and methods to their prototypes, providing
 a scheme for direct instance-to-instance inheritence which mimmicks
 message passing.

 So there you have it. Whether javascript is OOP is kind of a matter of
 taste, rather than definition (Because there is no definition). It's a
 bit like pondering whether Piet Mondrian was an artist, because he
 didn't paint pictures of real things. Of course he is, but it's
 confusing because Mondrian was unlike any other artist anyone had ever
 seen. In the same way, Javascript is an OO language unlike any other
 OOP language most people have