Chapter 2. Choosing a Server-Side Scripting Language

When creating ASP pages, developers have a number of scripting languages to choose from. The most frequently used server-side scripting language is VBScript, but ASP is not limited to VBScript alone. In fact, any ActiveX scripting engine can be used as the scripting language for ASP. Microsoft provides two ActiveX scripting engines: VBScript and JScript. PerlScript and Python are two additional server-side scripting languages that can be used in an ASP page.

This chapter introduces these rarely used scripting languages, demonstrating how to accomplish some common ASP tasks. This chapter is not a language reference or tutorial. Extensive online resources and reference books covering the details of these scripting languages already exist.

The Popularity of VBScript

If you’ve read many other Active Server Pages books or are a regular at any of the large ASP resource sites on the Internet, you’ve no doubt noticed that the vast majority of code examples use VBScript as the server-side scripting language. In fact, this book uses VBScript for its code examples. I believe the reason that VBScript is used so frequently in code examples is that a large number of ASP developers were previous Visual Basic developers. Also, a good number of beginning ASP developers are web developers with extensive HTML skills but few programming skills. VBScript is relatively easy to learn and understand, especially for those who are new to programming.

VBScript did not achieve such popularity among ASP developers solely because it is a simple language. When ASP started to grow into a widely used tool for creating dynamic web sites, there were only two scripting engines: VBScript and JScript. At the time, VBScript had several advantages over JScript. For one thing, VBScript allowed for error handling, while earlier versions of JScript did not.

Current versions of VBScript and JScript, though, both contain error handling, as well as a number of other enhancements. Several notable improvements were added to the Version 5.0 scripting engines; in fact, Chapter 4, discusses these improvements in detail.

Just because VBScript is the most popular server-side scripting language does not mean VBScript is the right scripting language for you. Each scripting language offers its own strengths and weaknesses. Also, by supporting a plethora of languages, ASP does not favor only those developers who have experience in a particular language. If your strengths lie in Perl, use PerlScript as the server-side scripting language. If you are a JavaScript guru, use JScript instead.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset