Jump to content

Visual Basic (classic)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Bevo (talk | contribs) at 14:43, 26 April 2004 (=Factors leading to commercial success=). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


Visual Basic (VB) is a programming language whose syntax derives from BASIC. Microsoft released it to facilitate creation of Windows-based programs. It allows programmers to model visually the user interface and, to some extent, the code.

VB 1.0 was introduced in 1991. The approach for connecting the programming language to the graphical user interface is derived from a system called Tripod, originally developed by Alan Cooper, which was further developed by Cooper and his associates under contract to Microsoft.

Language features

VB is an event driven programming language centered around a forms engine that enables Rapid Application Development (RAD) of graphical user interface (GUI) applications and a database object library (DAO, RDO, then ADO). It is used primarily for business applications such as database front-ends. A derivative of VB, VBScript, is the default language for Active Server Pages, and can be used in Windows Scripting and client-side web page scripting.

VB was designed to be usable by the novice programmer. It does not require the use of pointer arithmetic and it has a large library of utility objects to do everything from handling a Microsoft Word document to printing barcodes to displaying a web page. A moderately skilled programmer can quickly put together a simple business application using components provided with Visual Basic. This use of built-in visual components and programming aids was an important factor in the acceptance of Visual Basic by programmers. After the introduction of VB, the use of visual components spread to other programming languages and to web editors. Unlike many other programming languages, VB is not case sensitive.

Factors leading to commercial success

Visual Basic spawned the first commercially viable reusable component market. There are thousands of 3rd party components available for sale today from hundreds of vendors.

During the Internet boom, programmers were in great demand, and many new programmers entered the field. These new programmers helped make VBScript one of the most common languages for web-based scripting on the Microsoft platform, although the use of VBScript has largely been superseded. In the browser, it has almost completely been displaced by JavaScript. On the server, JavaScript is often used with Microsoft ASP instead of VBScript. ASP itself (and thus VBScript) has also been displaced on the server by PHP, Java and most recently, .NET (which, it should be noted, does include ASP.NET, a different but somewhat similar system).

Similar languages

Some products are available for other systems that can interpret a subset of the Visual Basic language or similarly target rapid application development. These products are not source-code compatible with Visual Basic, but the similarity of their design environments allows Visual Basic expertise to be leveraged into these environments quickly.

  • POWERbasic (Windows - DOS) - A popular alternative to VB - creates small and quick-loading standalone executables.
  • REALbasic (Macintosh - Windows - Linux) - A popular language that shares some of the same keywords, API, and design-mode interface as Visual Basic.
  • Gambas (GNU/Linux) - Attempts to duplicate the ease of use and interface of Visual Basic.
  • HBasic (Qt, GNU/Linux)
  • Gnome Basic (Gnome, GNU/Linux) - intended to provide VBA functionality to GNOME and to GPL licensed applications in general. Many developers from this project now work on Mono.
  • StarOffice Basic - macro language used in StarOffice and OpenOffice.org

Microsoft has added World Wide Web support into all of their development tools. Visual Basic .NET (VB.NET) makes VB a supported language for web application development (ASP.NET). VB.Net also provides support for web services, allowing remote functions to be called over the Internet. VB.NET compiles to MSIL (a bytecode) that needs JIT compilation the first time it is executed.

Visual Basic for Applications

Visual Basic for Applications (VBA) is built into every product in the Microsoft Office family, and also in several third-party products like Visio (now owned by Microsoft) and WordPerfect Office 2002. This has made VBA a suitable tool for writing small applications for specific purposes.

However, the ability to make VBA run automatically on opening a document - blurring the distinction between passive documents and active code - made macro viruses possible.


Criticisms of Visual Basic

VB is criticized for

  • not being portable (It is only available for Microsoft Windows; a DOS version was marketed at one time.)
  • being larger than necessary
  • not being fully object oriented (this is fixed in VB.NET)
  • performing poorly at mathematical tasks
  • being unwieldy when using out-of-process services
  • having an ugly syntax
  • sometimes crashing for no clear reason
  • not being as vision-based as other products (e.g. some Java-based tools), requiring more hand coding
  • having syntax unrelated to the C-like syntax in most other languages in popular use (e.g. Java, ECMAScript/JavaScript, C#, PHP, Perl, C++, C) -- this is a general criticism of BASIC-like languages

Some of these problems have been addressed in later versions of VB, particularly by VB.NET, but in doing so backwards compatibility has been sacrificed. The language continues to attract much criticism; it also continues to cater to a large base of users and developers.

Older versions of Visual Basic

Visual Basic 1.0 was released for DOS. The language itself was quite sparse, and the interface was barely graphical, using extended ASCII characters to simulate the appearance of a GUI. Visual Basic versions 2.0 through 3.0 were designed to be run within Microsoft Windows. They were 16-bit applications, and the programs produced by them were also 16-bit applications, ideally run under Windows 3.x. Visual Basic 4.0 was available as a 16-bit or a 32-bit version. The 32-bit version was more powerful, and ran on Windows 95. By version 5.0, Microsoft was releasing Visual Basic exclusively for 32-bit versions of Windows. Programmers who preferred to write 16-bit programs were pleased to find that Visual Basic 5.0 was able to import programs written in Visual Basic 4.0, and it was not difficult to convert Visual Basic 5.0 programs to be compatible with Visual Basic 4.0. Visual Basic 6.0 improved a number of areas, and added features. VB6 will enter Microsoft's "non-supported phase" starting March 2008.

  • 1991 VB 1 (May)
  • 1992 VB 2 (Fall)
  • 1993 VB 3 (Summer)
  • 1995 VB 4 (August)
  • 1997 VB 5 (February)
  • 1998 VB 6 (Summer)
  • 2001 VB.NET

Visual Basic and HyperCard

Putting Visual Basic into historical context invites comparison with HyperCard, a programming tool developed by Bill Atkinson, Dan Winkler, and their associates at Apple Computer and released in 1987. Both HyperCard and VB initially present the user with a "drawing" environment in which UI objects can be dragged, sized, captioned, and have a set of properties edited. Both connect a set of events, associated with the visual objects, to fragments of code. In both cases, the code is written in a programming language that is intended to cater to the novice and be easy to use. This is not to suggest that VB is a clone or copy of HyperCard. The relationship is more like that of C or Pascal to ALGOL; one can detect a family resemblance.

Unlike VB, HyperCard's programming language, HyperTalk, like COBOL before it (and AppleScript after it), consists of syntactically valid English sentences, such as "Get the number of card buttons." (Whether this actually makes it any easier to read, write, understand, or maintain than BASIC is questionable.)

The biggest difference, and the reason why VB was a breakthrough in a sense that HyperCard never was, is that VB produced applications that were virtually indistinguishable in look, feel, and general characteristics from Windows applications produced with traditional development tools. That is, it produced "real" Windows applications. HyperCard produced HyperCard stacks, not true Macintosh applications. HyperCard briefly spawned a limited cottage industry of commercial "stackware," rather like the former market in spreadsheet templates, but saw little commercial application (with notable exceptions: the fully commercial adventure game MYST was based on an elaborated version of HyperCard). HyperCard "stacks" were always recognizable as such.

HyperCard made a big impression when it was released in 1987, but for various reasons Apple did not follow it up vigorously or develop it much beyond what it was in 1987. By the year 2000 Apple had effectively abandoned it; it was officially discontinued in April, 2004.

See also

Template:List of programming languages