Visual Basic
By: July • Essay • 1,641 Words • January 26, 2010 • 1,072 Views
Join now to read essay Visual Basic
INTRODUCTION
Visual Basic (VB) is an event driven programming language and associated development environment prototyped by Alan Cooper as Project Ruby, then bought and vastly improved upon by Microsoft. In business programming, it has one of the largest user bases.
It is derived heavily from BASIC and enables rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using DAO, RDO, or ADO, and creation of ActiveX controls and objects. A programmer can put together an application using the components provided with Visual Basic itself.
As of 2003, 52 percent of software developers used Visual Basic, making it the most popular programming language at that time. 43 percent of those Visual Basic developers, however, planned to move to other languages.[1] The popularity of Visual Basic perhaps results from its easy to understand syntax. Like all other Turing complete programming languages, it can also be used to create arbitrarily complex applications. Programs written in Visual Basic can use the Windows API, but doing so requires external function declarations.
DERIVATIVE LANGUAGES
Microsoft has developed derivatives of Visual Basic for use in scripting. It is derived heavily from BASIC and host applications, and has replaced the original Visual Basic language with a .NET platform version:
- Visual Basic for Applications (VBA) is included in many Microsoft applications (like Microsoft Office), and also in several third-party products like WordPerfect Office 2002. There are small inconsistencies in the way VBA is implemented in different applications, but it is largely the same language as VB6.
- VBScript is the default language for Active Server Pages and can be used in Windows scripting and client-side web page scripting. Although it resembles VB in syntax, it is a separate language and it is executed by the Windows Script Host as opposed to the VB runtime. These differences can affect the performance of an ASP web site (namely inefficient string concatenation and absence of short-cut evaluation). ASP and VBScript must not be confused with ASP.NET which uses Visual Basic.Net or any other language that targets the .NET Common Language Runtime.
- Visual Basic .NET is the successor to Visual Basic 6.0, which is part of Microsoft's .NET platform. The VB.NET programming language is a true object-oriented language that compiles and runs on the .NET Framework. VB.NET is a totally new tool from the ground up, not backwards compatible with VB6. It ships with a basic converter to upgrade legacy VB6 code although the inefficient nature of the resulting VB.NET code (due to major differences between the two languages) often leads programmers to prefer manual conversion instead. This usually involves re-writing much of the code although in doing so, the programmer can simplify and improve the code through use of the extensive .NET framework and the more powerful constructs offered by the newer language.
LANGUAGE FEATURES
Visual Basic was designed to be usable by all programmers, whether novice or expert. The language is designed to make it easy to create simple GUI applications, but also has the flexibility to develop fairly complex applications as well. Programming in VB is a combination of visually arranging components on a form, specifying attributes and actions of those components, and writing additional lines of code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code. Performance problems were experienced by earlier versions, but with faster computers and native code compilation this has become less of an issue.
Although programs can be compiled into native code executables from version 5 onwards, they still require the presence of runtime libraries of approximately 2 MB in size. This runtime is included by default in Windows 2000 and later, but for earlier versions of Windows it must be distributed together with the executable.
Forms are created using drag and drop techniques. A tools palette is used to place controls (e.g., text boxes, buttons, etc.) on the form (window). Controls have attributes and event handlers associated with them. Default values are provided when the control is created, but may be changed by the programmer. Many attribute values can be modified during run time based on user actions or changes in the environment, providing a dynamic application. For example, code can be inserted into the form resize event handler to reposition a control so that it remains centered on the form, expands to fill up the form, etc. By inserting code into the event handler for