Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Jul 24, 1997

Evolution of Visual Basic

Question:
How did VB originate, where did it originate from, what is it main purpose or function. Who basically saw it as a need for its future uses?

Answer:
This is part of the first chapter of my new book, which will be out in December. It should answer any questions you have.

Before Microsoft Windows 3.0 was introduced in May 1990, application programming was a very boring proposition - all text with no concept of a mouse or a window. Some enterprising programmers created toolkits to create window-like atmospheres using the IBM's extended character set, which included graphical characters such as line segments and partially shaded characters.

However, after the introduction of Microsoft Windows, programmers had a whole new world to explore. Application programs like Microsoft Word and Excel gave programmers ideas for their own applications, including features like:

  • Toolbars
  • Multiple windows within an application's window
  • Basic support for multiple applications running simultaneously
Unfortunately, programming these features was time-consuming and confusing. Until now, the only languages that were available were traditional languages, such as Basic, COBOL, and C. Microsoft did have a product called QuickBasic, which was fairly popular among Basic programmers. QuickBasic could run old Basic programs that used line numbers and lots of GOTO statements, but it was better than Basic. It supported many additional language concepts, but it could not create Windows applications. It did not support the Windows API (Application Programming Interface), which specified how to create windows, graphics, and the other components used in Windows applications.

In order to get more programmers to start writing Windows applications, a development tool was clearly needed. In the summer of 1991, Microsoft introduced a development tool called Visual Basic. This tool's language was based on the QuickBasic product, with additional features added to support the Windows environment.

Windows introduced the concept of a message. Every action you perform in Windows generates one or more messages. For instance, if you move the mouse across the screen, a series of messages are generated for each position the mouse occupies while you are moving it. If you were to move your mouse over an application that is running, Windows sends these messages to that application. The application then has to determine if you are doing something within itself, or if you are just "passing through". Every application has to look at every message sent by Windows and make this determination. The code required to make this work is lengthy and complex, to say the least. Besides having to handle simple messages like mouse movements, a Windows application also has to handle complex actions, such as when you move a window from one place to another. Windows tells you what the user is doing, but it doesn't do any of the work for you. You have to tell your windows to repaint in a new position. Even after you have dealt with all the Windows messages you might receive, you're still not done. You still have to write the code to handle your application's features.

Visual Basic revolutionized all this tedious code. Instead of having to write lengthy code to make a window respond to a mouse, Visual Basic handled all of those actions and hid them from the programmer. To indicate to your program that the user clicked the mouse, Visual Basic provided an event instead of a series of messages. You then write code to respond to the event and not the message. This is an important distinction. An event, when translated into Windows messages, could consist of one or more messages. Even a simple action like a mouse click actually consists of more than one Windows message.

With the introduction of the event, Visual Basic programmers could concentrate on writing the application's features and not worry about the simple things about why a button click worked. They could simply write the code to run when a button was clicked. The code that runs when the user clicks a button is known as an event handler.

Besides hiding the complexities of Windows messaging, Visual Basic also provided a design environment in which the programmer could draw an application's windows instead of writing code to create them. Want a button on your form? Pick it from the Visual Basic toolbox and draw it on your window. Button not quite in the right place? Grab it with your mouse and drag it to the correct position. This ability to rapidly draw the interfaces of an application made Visual Basic into an excellent tool for creating prototypes. A prototype is a preliminary version of an application used for discussion among designers. For consultants, a prototype is an excellent way to show your client what the application might look like. With Visual Basic, you could even add simple code to cause one window to flow into the next. Speaking from personal experience, it is much easier to let your client interact with a real live application instead of one on paper. Besides being able to see how the windows work, the user might also suggest changes in functionality before you even start writing your application.

Unfortunately, the version 1.0 of Visual Basic was slow and did not have the performance required for most business applications, so it was relegated to hobbyists, low-priority applications, and the prototyping just discussed. However, Visual Basic continued to improve. In fact, Bill Gates, CEO of Microsoft Corporation, once commented that Visual Basic was his favorite language. A comment like that from the CEO of the largest software company in the world would ensure that Visual Basic would continue to improve.

Version 2.0 of Visual Basic introduced the concept of the custom control, or VBX control. This allowed programmers to buy controls from third parties and use them in their own applications. These controls could be created in any language supporting Windows. This introduction created an entire industry in itself: the custom control market. Now a programmer could get a low-cost, commercial control or even download one for free and add functionality to an application without having to write the code to do it. In addition, components were inherently stable, since they had already been tested by the company that produced it. For corporate developers on tight time and money budgets, the savings in buying a control versus the cost to develop it is quite significant.

Many new companies were started for the sole purpose of creating these controls, and now there are over 100 companies creating controls for Visual Basic programmers. Some of these controls add enhanced functionality to those included with Visual Basic; others provide functionality missing from Visual Basic.

By the time Visual Basic 3 was released in 1993, its following had greatly increased. However, many of the people who were buying Visual Basic wanted to create database applications for it. Visual Basic 3 introduced direct access to many types of databases through both the Data Control and the Data Access Objects. This greatly improved programmers' access to databases and thus made programs more useful. At this point, Visual Basic's growth really took off. Estimates of the user base were well over 1 million users and it continued to grow.

The main change in the user base was that corporate developers were starting to use Visual Basic to create full applications and not just prototypes. With access to many databases through Microsoft's Open Database Connectivity (ODBC) product, databases such as Oracle, Sybase, and Informix could be accessed just as easily as Microsoft Access, Microsoft's database that was included with Microsoft Office.

The custom control market continued to grow, as well. Software companies were creating more and more unique controls to mimic functionality available in Windows 3.1, such as toolbars and tabbed dialogs.

Visual Basic 3 was a very stable product and was the mainstay development tool until Windows 95 was released in 1996, at which point Visual Basic 4 was released. Visual Basic 3 was also the first version in which two different versions of the product were available: the Standard Edition and the Professional Edition. The Standard Edition was a lower cost version that included fewer custom controls, whereas the Professional Edition included all of the controls and several additional development tools.

When Visual Basic 4 was released in early 1996, its major purpose was to allow development for Windows 95, which was a 32-bit development environment. Up until Windows 95, software ran in a 16-bit environment. Essentially, the difference is that programs running in a 32-bit environment are able to take full advantage of the computer's central processing unit's (CPU) 32-bit capabilities.

Visual Basic 4 also expanded the capabilities of the Data Access Objects, providing even greater access to databases. This version of Visual Basic also introduced a new edition: the Enterprise Edition. With more and more corporate developers using the product, Microsoft realized the need to include more enterprise-oriented tools. One of these tools was the Remote Data Objects feature. By using Remote Data Objects, a developer could access ODBC databases just like they were local databases. In addition, Microsoft acquired a tool called SourceSafe, which was included with the Enterprise Edition. SourceSafe is version control software. Version control software allows a team of developers to coordinate their development efforts by allowing files to be checked in and checked out, much like a public library does. Only one developer can edit a file at once. If a mechanism like this was not in place, two developers might make different changes to the same file. When the developers realize this, they would have to somehow merge their changes together. Version control software prevents this situation from happening.

Visual Basic also included support for classes. A class is a term in object-oriented programming that you will learn about in chapter 5. Basically, a class incorporates data and code to work with that data. Using classes allows programmers to make their projects more modular. By hiding the code that deals with a particular type or piece of data, that code can be changed without affecting the rest of a program. Classes can also be used to create OLE (Object Linking and Embedding) Automation servers, which can be called by other programs, whether they were created with Visual Basic or another tool. These servers can be used to perform business functions by multiple programs, thus providing additional reusability. You will learn more about OLE servers in chapter 17.

Finally, since the VBX custom control was a 16-bit control, a new format had to be introduced. The OCX format is a 32-bit control that was unfortunately incompatible with the VBX format. This caused a great deal of headaches for programmers whose programs were written with VBXs. The controls had to be replaced with OCXs in order to build a 32-bit application. This required the programmers to first find a replacement, and then most likely spend more money to acquire the control. However, the component vendors all stepped up with 32-bit versions of their controls, and most had an easy upgrade path, requiring very few changes, if any, to make the new component work with the old code. While Visual Basic 4 was considered by many to be an interim release, it did not stop Visual Basic's growth. Depending on who was counting, the user base was between 2.5 and 4 million users. This user base also included programmers using Visual Basic for Applications, a reduced feature set version included in Microsoft Excel and Word. In addition, Microsoft's Internet Explorer 3.0 browser introduced Visual Basic Scripting Edition, or VBScript as it is more commonly known. This language allowed web developers to add scripting to their web pages using a language very similar to Visual Basic. Finally, Microsoft also worked out a deal with Summit Software to license Visual Basic for Applications to other software packages to provide scripting capabilities for other Windows applications.

One of the major drawbacks to using Visual Basic is that the language is interpreted and not compiled. Interpreted languages may be stored in an executable file (.EXE), but the programmer's instructions are stored in a special format that are executed at runtime by a runtime engine. If you have ever seen files called VBRUN300.DLL, VB40016.DLL, or VB40032.DLL sitting in your Windows SYSTEM directory, these are the runtime engines required by Visual Basic versions 3.0, 4.0 (16-bit), and 4.0 (32-bit), respectively. Interpreted code is much slower than compiled code, which includes all of the functions required to execute the actual code. In fact, this lack of a compiled executable spawned several products: the add-on Visual Basic compiler, and Borland's Delphi product. Several companies created add-on Visual Basic compilers, including a company called PowerBasic. Borland's Delphi product boasted a true compiler that could create much faster executables. While they emphasized that advantage for a long time, the advantage no longer exists.

Visual Basic 5's major improvement and most anticipated feature is the inclusion of a native code compiler. This compiler's options allow you to build a variety of different executable formats based on the target machine the program will be run on.

Besides being able to build much faster executables, Visual Basic 5 also includes support for creating ActiveX controls and servers. ActiveX was a term introduced in 1996 when Microsoft "discovered" the Internet. The slogan "Activating the Internet" was also used, since ActiveX controls could be embedded on web pages. When these controls were introduced, there was a great deal of confusion as to the differences between ActiveX and OCX controls. At this point, all controls being produced are known as ActiveX controls and are all written to the same standard, called OCX96.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date