ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
JScript .NET - Wikipedia, the free encyclopedia

JScript .NET

From Wikipedia, the free encyclopedia

JScript .NET
Paradigm multi-paradigm
Developer Microsoft Corporation
Typing discipline duck, weak, dynamic
Influenced by JScript / ECMAScript
JScript .NET
File name extension .js

JScript .NET is a .NET programming language developed by Microsoft as a natural successor to Microsoft's Active Scripting language JScript.

Both JScript and JScript .NET are languages whose syntax is based on that of C language. JScript has no relation to Sun Microsystems' Java language.[1] The primary differences between JScript and JScript .NET can be summarized as follows:

The original JScript is a scripting language, and as such programs (or more suggestively, scripts) can be executed without the need to compile the code first. This is not the case with the JScript .NET command-line compiler, since this next-generation version relies on the .NET Common Language Runtime (CLR) for execution, which requires that the code be compiled to Common Intermediate Language (CIL), formerly called Microsoft Intermediate Language (MSIL), code before it can be run. Nevertheless, JScript .NET still provides full support for interpreting code at runtime (eg, via the Function constructor or the eval function) and indeed the interpreter can be exposed by custom applications hosting the JScript .NET engine via the VSA interfaces.

Secondly, the original JScript had a strong foundation in Microsoft's ActiveX/COM technologies, and relied primarily on ActiveX components to provide much of its functionality (including database access via ADO, file handling etc.), whereas JScript .NET uses the .NET Framework to provide equivalent functionality. For backwards-compatibility (or for where no .NET equivalent library exists), JScript .NET still provides full access to ActiveX objects via .NET / COM interop using both the ActiveXObject constructor and the standard methods of the .NET Type class.

Although the .NET Framework and .NET languages such as C# and Visual Basic .NET have seen widespread adoption, JScript .NET has never received much attention, by the media or by developers. It is not supported in Microsoft's premier development tool, Visual Studio .NET, and it's unlikely that future versions of .NET will feature JScript .NET prominently.

However, ASP.NET supports JScript .NET.

Contents

[edit] Language differences

The following are prime examples of languages differences between other .NET languages, including comparisons.

[edit] Differences with C#

  • JScript .NET variables do not need to be declared as a certain type.
  • JScript .NET does not have a main() function that the operating system must call directly when executing a JScript .NET application, as such, JScript .NET program flow is based entirely on global code.
  • JScript .NET, because of its very loose type checking system can be very easy to learn, since the convention of explicit type declaration is not required at all.
  • JScript .NET does not require explicit references to the .NET Framework Base Class Library, as certain functions found in earlier versions of JScript, are present in JScript .NET (e.g. functions for finding the tangent of an angle for a right triangle).
  • JScript .NET is closely linked to C syntax, and is thus very easy to learn for C#, Java or C++ developers.
  • While JScript .NET can be used to create Windows Forms applications, JScript .NET will have some trouble, as delegates can only be consumed in JScript .NET and not created. Thus, custom events are hard to emulate in JScript .NET.

[edit] Differences with C++

  • JScript .NET does not require explicit type declaration on variables. (In C++, the use of templates and generics can be compared to this, loosely emulated with template specialization etc)
  • JScript .NET also does not require explicit type casts on variable use in the program. Code used to retrieve a string of characters, but only used for integer numbers can be casted implicitly; the vice-versa can be done without error at compile time, but there is a chance of loss of precision or data.

e.g.:

import System;
 
var _name;
 
Console.WriteLine("Hello, what's your name?");
Console.WriteLine("Type your name: ");
 
var _name = Console.ReadLine();
 
Console.WriteLine("Hello, " + _name);

[edit] Differences with Java

  • JScript .NET syntax and lexical conventions are similar to Java in that both are derived from C. JScript was originally Microsoft's implementation of ECMAScript, which is more commonly known as JavaScript, though it is unrelated to Java. Thus, users of Java and other C-derived languages will find JScript easier to learn.
  • JScript .NET allows developers to use untyped variables, and can sometimes infer their type from their usage to optimize the compiled code. On the other hand, Java requires all variables to be typed.
  • JScript .NET can add properties and methods to objects in run-time, while Java objects always conform to their declared interface.

[edit] Differences with older versions of JScript

  • JScript .NET allows developers to declare variables and functions with type information (e.g., var x : String;), while type information for JScript's variables and functions cannot be declared (e.g., var x;).
  • JScript .NET scripts are not interpreted, but executed independently. When executed, a JScript .NET application will invoke the CLR. The CLR will execute the CIL instructions without using an interpreter.
  • JScript .NET can be run without the presence of a browser or another scripting engine as the compiler can generate standalone executables and assemblies. However these still require the JScript .NET runtime and .NET Framework to be installed in order to run.
  • JScript .NET provides access to the .NET Framework BCL (Base Class Library), providing much more functionality.
  • JScript .NET, like older versions of JScript, provide in built functions to keep common functions simple.
  • JScript .NET is only available as a scripting language for ASP.NET, the technology used to generate web pages; thus, JScript .NET takes a similar role to PHP and other server-side scripting languages. Internet Explorer, however, is still using only the older JScript engine, so JScript.NET cannot be used to script web pages (or HTAs or HTCs). In this regard, JScript is much more versatile than JScript .NET.

[edit] See also

[edit] Notes

  1. ^ (see JavaScript#Related languages for discussion on the confusing naming)

[edit] References


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -