Which to Learn: Javascript, Jscript, JScript.NET, ECMA 262 (3rd ed)?

J

John Bentley

Note this is crossposted to comp.lang.javacript and
microsoft.public.dotnet.scripting.

After some Googling and FAQing my understanding of these terms is, crudely:

Javascript (3 different definitions):
1. The scripting language originally developed by Netscape. (I offer a Brief
handle: "Original Netscape Script")
2. The current implementation of the ECMAscript 262 (3rd ed.) standard by
Netscape. (I offer a brief handle: "Current Netscape implementation")
3. A generic term used to designate the continuly evolving standard and
implementations.

Jscript
1. The current microsoft implementation of the ECMAscript 262 (3rd ed.)
standard.

ECMAscript Standard
1. The scripting standard that is the current recommendation 262, 3rd edition I
believe.

JScript.NET
1. Microsoft's implementation of ECMAscript (4th Ed).

The definitions could be, and have been, debated endlessly. Do I have them
essentially right? How is "javascript" mostly understood?

Which do I learn? That is, and these are all newbie questions, when scripting
your web site what implementation/standard should you use for reasonably wide
browser compatiblity?

Do you pick either of javascript - current netscape implementation OR Jscript
Then be careful not to use implementation extensions that are not part of
ECMAscript 262? Do you, when learning, start with the ECMAscript 262 standard
and ignore the particular implementations? Is one implementation to be favoured
over the other (netscape over microsoft)?

Is one implementation regarded as having greater compatibility? javascript -
current netscape implementation?

Should JScript.NET be avoided like the plague as it based on a standard yet to
be released and not even supported in IE 6.0?

I am coming from the Dotnet/microsoft world. If I learn Jscript have I become a
microsoft slave or is Jscript sufficiently cross browser compatible?

I suppose too I have to know which version of an implementation I should code.
This in turn is dictated by which are the current browsers you code for:

Looking at http://www.doctor-html.com/agent_stats/

It would seen that Netscape 7.0 and IE 5.0 would be sufficiently lowest common
denominator. Are these the browsers you target?

If one where to learn Jscript then
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/j
sconIntroductionToJScriptNETForJScriptProgrammers.asp

would dictate no higher than Jscript 5.0 should be learnt? What current netscape
implentation version should be learnt ( if you were to go down the netscape
path) 1.2, 1.5, 2.0?

You might be able to answer all these questions in one swoop??

Thanks in Advance,
John
 
B

bruce barker

you are correct.

javascript 1.5 (ECMAscript 262 ed 3) is the current gold standard, that is
implemented in most current enviroments (netscape, ie, flash., xslt, etc).

version 1.0 - 1.2 varied mostly in dom (browser object) changes rather than
the language itself.

from 1.2 - 1.5 the main languages changes are in new date handling methods
(for y2k compliance), encode replacing escape, and try ..catch blocks.

version 2.0 addes the class extension that javascript.net implemented.

I'd learn javascript 1.5, as javascript.net (2.0) is only supported by
asp.net (or a standalone .net exe). Also 2.0 changes javascript from a
typeless scripting language to a rigid typed language, requiring coding
style changes.

also if you try to write a javascript.net application, you will find there
is no ide support, only a command line compiler. so for the .net world I'd
learn C# (as javascript 2.0 looks like javascript with C# extensions), for
scripting world I'd pick javascript 1.5.

-- bruce (sqlwork.com)
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
news:comp.lang.javascript said:
Which do I learn? That is, and these are all newbie questions, when scripting
your web site what implementation/standard should you use for reasonably wide
browser compatiblity?

Do you pick either of javascript - current netscape implementation OR Jscript
Then be careful not to use implementation extensions that are not part of
ECMAscript 262? Do you, when learning, start with the ECMAscript 262 standard
and ignore the particular implementations? Is one implementation to be favoured
over the other (netscape over microsoft)?

For the WWW, use ECMA-262 Edn 3, but minus anything that you know to be
incorrect or unavailable on not-too-old browsers, or different in Edn 4.

An example is toFixed; recently introduced, and also buggy.

Don't use a newer method if an older one is as good; for example, to get
a 2-digit year, consider getYear()%100 rather than getFullYear()%100 -
most users do have getFullYear, but there may be some who do not;
getYear is deprecated, but should remain available for a good while;
example is IMHO & subject to correction.

Remember that, while all the kiddies have WinXP with MSIE6, there are
others - charities, small business, big business, third world, redneck
backwoods areas of the first - who are obliged to use older systems.

I find the Netscape documentation, especially the older stuff, on the
Web to be much nicer than Microsoft's; ISTM that using that NS stuff &
ECMA-262, while testing on MSIE, is reasonably effective.

You mentioned ECMA 4th Edn; what is its present status?


Watch out for "localisation" problems - for example, it is by no means
Summer here at present.
 
D

douglas

After some Googling and FAQing my understanding of these terms is, crudely:
Javascript (3 different definitions):
1. The scripting language originally developed by Netscape. (I offer a Brief
handle: "Original Netscape Script")
2. The current implementation of the ECMAscript 262 (3rd ed.) standard by
Netscape. (I offer a brief handle: "Current Netscape implementation")
3. A generic term used to designate the continuly evolving standard and
implementations.

Jscript
1. The current microsoft implementation of the ECMAscript 262 (3rd ed.)
standard.

ECMAscript Standard
1. The scripting standard that is the current recommendation 262, 3rd edition I
believe.

JScript.NET
1. Microsoft's implementation of ECMAscript (4th Ed).

The definitions could be, and have been, debated endlessly. Do I have them
essentially right? How is "javascript" mostly understood?

The standard name for the language is ECMAScript. Nobody calls it that
because it is such an awful name. Everyone calls it JavaScript, even
though formally JavaScript is the name of Netscape's implementation of
ECMAScript.
Which do I learn? That is, and these are all newbie questions, when scripting
your web site what implementation/standard should you use for reasonably wide
browser compatiblity?

Learn the language. Stick to the standard. Make your stuff portable.
Avoid proprietary features and traps. Keep it clean. Look at jslint for
automated advice on a reliable common subset.
http://www.crockford.com/javascript/lint.html
Do you pick either of javascript - current netscape implementation OR Jscript
Then be careful not to use implementation extensions that are not part of
ECMAscript 262? Do you, when learning, start with the ECMAscript 262 standard
and ignore the particular implementations? Is one implementation to be favoured
over the other (netscape over microsoft)?

You want your stuff to run reliably as widely as possible.
Is one implementation regarded as having greater compatibility? javascript -
current netscape implementation?

Again, keep to what is stable and common.
Should JScript.NET be avoided like the plague as it based on a standard yet to
be released and not even supported in IE 6.0?

JScript.NET is irrelevant for browser applications. It isn't available,
and if it ever does become available its share will be so small that it
will still be preferrable to stay with the current stuff.

On the other hand, if you are doing server applications, that is not an
issue. I feel though that JScript.NET is a mess. JavaScript is a dynamic
language. .NET is optimized for static languages. I don't like the
changes they have made to the language to make it fit. If you are stuck
doing .NET, you might as well be using C#.
I am coming from the Dotnet/microsoft world. If I learn Jscript have I become a
microsoft slave or is Jscript sufficiently cross browser compatible?

Microsoft tried to supplant JavaScript with VBScript, and failed.
JScript comes closer to correctly implementing its standard than any of
Microsoft's other languages.
I suppose too I have to know which version of an implementation I should code.
This in turn is dictated by which are the current browsers you code for:

Looking at http://www.doctor-html.com/agent_stats/

It would seen that Netscape 7.0 and IE 5.0 would be sufficiently lowest common
denominator. Are these the browsers you target?

It is no longer reasonable to support IE 4 and Netscape 4. It is good
that Netscape 4 is going into extinction. It was a crime against humanity.
 
L

Lasse Reichstein Nielsen

It is no longer reasonable to support IE 4 and Netscape 4. It is good
that Netscape 4 is going into extinction. It was a crime against
humanity.

To be fair to Netscape 4, it was probably the best browser when it
came out. Most of the standards it fails to follow wasn't even
formulated then, and it contained Netscape's ideas about how a DOM
could be made. Not the best suggestion I have seen, but a suggestion.

The crime was to let it live for more than a few years. It's continued
existence has been a crime against humanity at least since 1999 (DOM 1
was released in October 1998).

/L
 
J

John Bentley

Note this is crossposted to comp.lang.javascript &
microsoft.public.dotnet.scripting. Responsing to both groups will be a help to
all.

Thanks Bruce, John Stockton, and Douglas for your educational replies. From your
replies my understanding of the collective wisdom is:

Q1. Given a concern for wide compatibility which do you code for?

A1. The Standard (not an implementation): ECMA 262 (3rd Edition).

Evidence:
John Stockton:
For the WWW, use ECMA-262 Edn 3, but minus anything that you know to be
incorrect or unavailable on not-too-old browsers, or different in Edn 4.
Douglas Crockford:
Stick to the standard. Make your stuff portable.
Avoid proprietary features and traps.

Thanks Douglas for the link to jlink. Your site was one of the "FAQs" that I
glanced over before this post. Great site. Thanks for publishing your hard won
wisdom.

Q2. Why not ECMA 262 (4th Edition)?

A1. It's not ready yet.

I'm just rolling on with your question John S:
You mentioned ECMA 4th Edn; what is its present status?

I don't know anything other than it's not yet released as a recommendation. I
get this information from that ...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnscrpt/html/al
labout.asp?frame=true

.... talks of ECMAScript Edition 4 as "Proposed" and that at ...
http://www.ecma-international.org/publications/standards/Ecma-262.htm

.... we have a mere "3rd Edition".

Q3. With the standard firmly in mind which implementation should I code in?

A3> ?

I will need some help here.

Douglas you write:
Learn the language. Stick to the standard.

Perhaps it would be saying the same thing if I take you to mean: "Learn the
(language) implementation. Stick to the (language) standard"?

Is there a "the" implementation?

Bruce you do write:
javascript 1.5 (ECMAscript 262 ed 3) is the current gold standard, that is
implemented in most current enviroments.

But I'm not sure if you are thinking more of which *version* of netscapes
implementation you would choose. That is, it not clear that you are recommending
a netscape implementation over a microsoft one?

John Stockon suggests why one might prefer Netscape over Microsoft:
I find the Netscape documentation, especially the older stuff, on the
Web to be much nicer than Microsoft's; ISTM that using that NS stuff &
ECMA-262, while testing on MSIE, is reasonably effective.

Is it Microsoft's or Netscape's implementation we ought code in? Is there a
clear winner or is it more of a personal whimsy? Or is the choice unimportant as
long as you stick to the standard?

Q4. Which language implementation version should you code in?

A4.i If it Netscape's implementation then Javascript version 1.5.

Evidence:
Bruce
javascript 1.5 (ECMAscript 262 ed 3) is the current gold standard

If it is Microsoft's implementation then clearly *not* Jscript .NET:
Douglas Croker:
JScript.NET is irrelevant for browser applications. It isn't available, ...

If we take the following to be true (which is consistent with my investigations,
thanks!)
Douglas Croker:
It is no longer reasonable to support IE 4 and Netscape 4.

Then we might suppose Netscape 6.0 and IE 5.0 are the lowest common
denominator's we ought support. This might be especially true in light of:
John Stockton:
Remember that, while all the kiddies have WinXP with MSIE6, there are
others - charities, small business, big business, third world, redneck
backwoods areas of the first - who are obliged to use older systems.

Therefore:
A4.ii If it is Microsoft's then Jscript version 5.0.

Evidence:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnscrpt/html/al
labout.asp?frame=true

IE 5.0 supports Jscript version 5.0

Is there a link to show which version of Microsoft Jscript Netscape 6.0
supports? If there is, and it can demonstrate that Netscape 6.0 supports Jscript
5.0 then only Question 3 is essentially open (for me).

Please do correct any thing I got wrong or important points I've missed. Thanks
again.
 
J

John Bentley

Watch out for "localisation" problems - for example, it is by no means
Summer here at present.

And while that might not be a problem in Switzerland in Surry I imagine it would
be :)
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
news:comp.lang.javascript said:
John Stockon suggests why one might prefer Netscape over Microsoft:

John who?

You mis-appreciate. I recommend NS's documentation, and use an MS
browser. If something is described in NS, and works in MS, then there
is a somewhat greater chance of it working elsewhere than if one relied
only on a single source.
Is it Microsoft's or Netscape's implementation we ought code in? Is there a
clear winner or is it more of a personal whimsy? Or is the choice unimportant as
long as you stick to the standard?

One should hope to code in the common subset of completed-and-released
code standards (ECMA 3) and current, recent, and future browsers.

Sometimes, because of things having been implemented differently, there
may be a commonly-implemented set of capabilities, but implemented using
different code. Then, if one of those capabilities is needed, some form
of how-to-do-it detection is needed, branching to different code for
different ways.

Wherever possible, the differences should be encapsulated in
subroutines, so that the rest of the code can use a single superset of
the common subset; cf. FAQ 4.15 and RC's new stuff probably at
http://www.litotes.demon.co.uk/js_info/cljFAQ_Notes.html#AltDynWr
 
D

Douglas Crockford

Learn the language. Stick to the standard.
Perhaps it would be saying the same thing if I take you to mean: "Learn the
(language) implementation. Stick to the (language) standard"?

No, that would be saying something wrong. You are too concerned with
picking the right implementation. If you are programming correctly, the
implementation is irrelevant. (This is of course the ideal. The
weaknesses of DOM standards and the poorness of their implementations
fall far too short.)

In any language, you should be working in the intersection of the
language's documented behavior and the abilities of the most common
implementations.

http://www.crockford.com/#javascript.html
 
J

Jim Ley

You mentioned ECMA 4th Edn; what is its present status?

I heard a rumour for january about 4 months ago... obviously it wasn't
true.

I've not heard anything else since...

Jim.
 
B

bruce barker

1) IE supports the com based JavaScript which is basically 1.5, the same as
Netscape/Mozilla.

2) when coding javascript for the browser, the dom differences are the main
difficulty/incompatability.

3) Javascript.net is a .net only implementation, and while the mozilla group
was working on edition 4 (version 2), it unclear where this effort is now.
Adding more XML support seems to have replaced this effort.


Dr John Stockton said:
JRS: In article <[email protected]>, seen in


John who?


You mis-appreciate. I recommend NS's documentation, and use an MS
browser. If something is described in NS, and works in MS, then there
is a somewhat greater chance of it working elsewhere than if one relied
only on a single source.


One should hope to code in the common subset of completed-and-released
code standards (ECMA 3) and current, recent, and future browsers.

Sometimes, because of things having been implemented differently, there
may be a commonly-implemented set of capabilities, but implemented using
different code. Then, if one of those capabilities is needed, some form
of how-to-do-it detection is needed, branching to different code for
different ways.

Wherever possible, the differences should be encapsulated in
subroutines, so that the rest of the code can use a single superset of
the common subset; cf. FAQ 4.15 and RC's new stuff probably at
http://www.litotes.demon.co.uk/js_info/cljFAQ_Notes.html#AltDynWr
links.
 
J

Jim Ley

The standard name for the language is ECMAScript. Nobody calls it that
because it is such an awful name. Everyone calls it JavaScript, even
though formally JavaScript is the name of Netscape's implementation of
ECMAScript.

I think the name javascript is now sufficiently generic that we should
stop the ludricous capitalisation used above - this will also of
course help it further along.
Microsoft tried to supplant JavaScript with VBScript, and failed.

I don't really agree with this, they produced a scripting language
which their VB Monkeys would like, I still see it used a lot, also
ActiveScripting was a great idea seperating the language from the host
so anyone can write a scripting language for the browser isa good
idea.
JScript comes closer to correctly implementing its standard than any of
Microsoft's other languages.

I'd bet on C# for that one, but there's not much wrong.

Jim.
 
J

Jim Ley

you are correct.

javascript 1.5 (ECMAscript 262 ed 3) is the current gold standard, that is
implemented in most current enviroments (netscape, ie, flash., xslt, etc).

JavaScript 1.5 was shipped without encode replacing escape... best
not to use the JavaScript version numbers to describe other
implementations.
I'd learn javascript 1.5, as javascript.net (2.0) is only supported by
asp.net (or a standalone .net exe). Also 2.0 changes javascript from a
typeless scripting language to a rigid typed language, requiring coding
style changes.

JScript.NET can still be used typeless, it's just a lot slower. There
is also nothing I've heard called javascript.net

Jim.
 
D

Douglas Crockford

The standard name for the language is ECMAScript. Nobody calls it that
I think the name javascript is now sufficiently generic that we should
stop the ludricous capitalisation used above - this will also of
course help it further along.

The name of a language is a proper noun. JavaScript should properly be
capitalized. I think a case could be made for relaxing the 'S', however.
'Javascript' weakens the visual association with 'Java', which might be
a good thing.

http://www.crockford.com/javascript/javascript.html
 
J

Jim Ley

The name of a language is a proper noun. JavaScript should properly be
capitalized.

I would call it (when used to denote all ECMAScript implementations) a
common noun, not a proper one, and therefore should not be
capitalised.
I think a case could be made for relaxing the 'S', however.
'Javascript' weakens the visual association with 'Java', which might be
a good thing.

That would be purely down to your style whether to pander to the
trademark holders. I dislike it intensely, but generally follow the
convention.

Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top