Introduction

Written March 14, 2007 by Andrew Paul Simmons

JScript.NET has been a member of the .NET framework languages since.NET 1.0. JScript.NET is to JScript (JavaScript) as C++ is to C.  This language offers true object oriented facilities while still offering the prototype based inheritance of JavaScript.  As a language in the .NET framework, it has much of the development power of C# and can be an effective tool in developing Windows Forms Applications.  JScript.NET offers weak typing with compile time type-checking and runtime type-checking.  The latter of which cannot even be found in ActionScript 2.0 (a language inspired by the ECMA-262 4th edition standard that was still being formed at the completion of JScript.NET) Jscript.NET includes formal classes, interfaces, weak-typing and much more.  It is compiled and CLR compliant which makes it much faster than JScript.

So often authors go on for pages about a language without ever offering a taste of what the syntax of the language is like.  To satisfy your curiosity, here is a simple hello world windows forms applications in JScript.NET.


GUI Hello World Applicaiton

import System;
import System.Windows.Forms;
import System.Drawing;var Title:String = "Hello World";
var HelloWorldWindow:Form = new System.Windows.Forms.Form();
HelloWorldWindow.Text = Title;
Application.Run(HelloWorldWindow);

Hello World Window

Notice that JScript.NET does not require a main function as other C style languages.   (In fact, the .NET framework raps all of the code in a special Main function that is executed as soon as the application loads.)