Develop Scriptless Web Apps Using Visual Basic
- Develop Scriptless Web Apps Using Visual Basic
- Developing a Web UI DLL Using VB
- Step by Step
- The Embedded HTML Problem
- Multiple Actions
- Pages with Dynamic Content
This article describes one technique on how to use Visual Basic to develop Web applications, without any of the problems that are associated with using ASP and VBScript.
Any application developer who has had to distribute a multitier application to hundreds of client PCs knows the benefits of Web applications. I, personally, have had to fight more DLL Hell problems than I care to discuss. Web applications help solve these distribution problems by keeping all application code off the client PCs. I'll build a Web app over a Windows client/server app if I'll be responsible for distributing it and if I'm given a choice.
Distribution of Web apps is much easier than distribution of Windows apps, but the development time is much greater. This is mostly due to the maturity of the development tools. I've been using Visual Basic (VB) since 1991 for Windows development. When I first started doing Web app development, however, everything seemed to point to Active Server Pages (ASP). At first glance, ASP seemed great. I could leverage my experience with VB by using VBScript, and I could quickly get simple applications up and running. However, after a few modest-sized applications, I realized that developing using ASP and scripting languages involves many problems.
Problems with Scripting Solutions
From my experience, developing with ASP scripting tools presents these problems:
The documentation for ASP VBScript seems to be targeted at HTML developers who want to make Web sites more dynamic. Few references are targeted at seasoned VB developers who are migrating multitier client/server apps to the Web.
Debugging is much more difficult. One of the first things that blew me away with VB1 was its capability to interactively debug and change source code while your code is running (hey, this was 1991, and I was a Cobol programmer before then). When you get used to debugging with the VB IDE, it's extremely frustrating to resort to coding hundreds of Response.Write statements. Sure, you can try Visual InterDev, but is anyone using a stable version or gotten debugging to work?
One goal of multitier app development is to separate the user interface (UI) from the program logic. ASP apps make a mess of this by mixing both the HTML and logic code intermittently throughout the source files. This also makes it difficult to use a WYSIWIG HTML editor to design the UI.
ASP apps are typically implemented as dozens of ASP files, which makes source code management difficult.
VBScript contains only a subset of the VB programming language. All of the good programming techniques you've learned, such as data type safety, proper error handling, and object-oriented programming techniques, do not apply.
Scripting languages are executed more slowly than compiled languages.
ASP source code is not secure. Sure, it's not sent to the browser, but anyone with access to the Web server can get your code. This is probably not a concern for in-house applications, but what about Web applications that are developed for resale?
I've read that the next version of ASP (ASP+) may help eliminate some of these shortcomings, but using the current ASP and VBScript makes me feel like I might as well be using punch cards.