Andrew Clinick
Program Manager
Microsoft Corporation
May 4, 1998
The following article, the first in an occasional series of feature articles on scripting issues, was originally published in the Site Builder Network Magazine, which is now MSDN Online Voices.
The two questions a program manager for the Microsoft Script Group hears most frequently:
For the first in an occasional series of feature articles in MSDN Online on scripting, I thought I'd tackle this thorny problem and explain our philosophy behind each language and how that affects your choice, since it's up to you which language you're going to use.
For many, the choice of programming language takes on an almost religious zeal. If you program in C, there's no way I'm going to convince you that Basic is the language for you. Likewise, if you're a Basic programmer, you're certainly not going to want to learn an unfamiliar syntax and a different way of thinking. The Microsoft Script Group is committed to providing you with a choice of languages. This level of choice begins with VBScript and JScript from Microsoft -- but it doesn't stop there, as other languages (Perl, Python, and so on) are all equally useful in the Microsoft scripting solutions (Internet Explorer, Internet Information Server, Windows Scripting Host).
Factors that will affect your decision about which language to use:
The platform you are developing for is going to have a big impact on what language you are going to choose. The decision is split between the client and the server.
Server
On the server, the decision is not influenced by target platform, since you control the server. This assumes that you are using a Microsoft server product. If you are developing for the server, the ability to script external COM objects is probably going to be more important than language features, because that's where most of the server functionality will be implemented. For example, the ability to cope with errors raised by COM objects quite probably will outweigh the ability to use extended language features.
Client
If you are planning to script HTML on the Internet and would like the "broad reach" of supporting both Netscape and Microsoft browsers, then your choice of languages is limited to JScript. Netscape does not support VBScript, so if you want to ensure that your page is viewable with modern browsers, you need to use JScript. Using JScript, however, does not guarantee that your script will work on all browsers, since there are many differences in HTML object-model conformance among the leading browsers. If you stick to features in HTML 3.2 (see the World Wide Web Consortium, or W3C, specification ) and ECMAScript (see the ECMA Standard ), you should be okay.
If you are planning to develop to the Dynamic HTML (DHTML) platform, the decision becomes a little more complex. The W3C Document Object Model and HTML 4.0 define the state of the art for Web development, but the available version 4.0 browsers comply to these standards at different levels. If you plan to use every feature in the DHTML book, you're probably going to use Internet Explorer 4.0. This makes the decision a little easier, since Internet Explorer 4.0 supports both VBScript and JScript -- except on the Macintosh, where only JScript is supported at the moment. So if you are planning to develop for Internet Explorer, and don't anticipate Macintosh users coming to your site -- on an intranet, for example -- then you can use either language.
VBScript is designed as a subset of the full Visual Basic® programming system (see Visual Basic for Applications Features Not in VBScript ). The guiding principles of VBScript are:
Most readers will think of using VBScript in three primary kinds of applications: Internet Explorer, Internet Information Server, and Windows Scripting Host. I will cover those three specifically, but all the pros and cons are applicable to other applications as well.
JScript was designed as a general-purpose scripting language that would appeal to the many programmers who use C, C++, and Java. This means that it "borrows" features from these languages where appropriate, but is a language in its own right and includes many features not found in C or Java. It's important to note that JScript is not just confined to use in the browser; you can use JScript in most applications in which you can use VBScript.
In the Microsoft Script Group, we are working hard to ensure that each language is functionally equivalent. This doesn't mean that VBScript will suddenly become less Basic-like, or that JScript will become more like Basic; only that we strive to add features that fit into the spirit of the language. If we succeed in this, your language choice should be merely a matter of personal choice and the platform you target. Most importantly, Microsoft is fully committed to supporting any script language through the ActiveX Scripting architecture. In addition to providing this scripting platform, Microsoft is fully committed to evolving implementations of both JScript and VBScript to a level where each language is functionally equivalent. So don't feel that you need to commit to one just to ensure that you are investing in a language that has a future.
Andrew Clinick is a program manager for the Microsoft Script Group.
Scriptlets: Components for Real People (June 11, 1998)
Microsoft Script Engines and the Year 2000 (August 14, 1998)
Take Five -- What's New in the Version 5.0 Script Engines (November 4, 1998)
Links to Microsoft Scripting Web sites:
VBScript = Microsoft Visual Basic® Scripting Edition
Jscript = JavaScript or ECMAScript JScript