Current location - Quotes Website - Excellent quotations - Visual Basic (VB) Overview of Visual Basic 2005
Visual Basic (VB) Overview of Visual Basic 2005

Development History

In 1991, Microsoft launched Visual Basic version 1.0. This caused quite a stir at the time. This advancement in connecting programming languages ??and user interfaces was called Tripod (sometimes called Ruby), and was originally designed by Alan Cooper. Many experts regard the emergence of VB as an epoch-making event in the history of software development. In fact, from our current perspective, the functions of VB1.0 are really too weak; (but recently VB6.0 has quite a lot of functions!). But at the time, it was the first "visual" programming software. This made programmers extremely happy, and they all tried to create software on the VB platform. Microsoft also lost no time in launching three versions of VB2.0, VB3.0, and 4.0 within four years. And starting from VB3, Microsoft integrated the ACCESS database driver into VB, which greatly improved VB's database programming capabilities. Starting from VB4, VB also introduced object-oriented programming ideas. VB is powerful and easy to learn. Moreover, VB also introduces the concept of "control", so that a large number of already compiled VB programs can be used directly by us. The DOS version of VB1.0, VB1.0, was released in 1991. This advancement in connecting programming languages ??and user interfaces was called Tripod (sometimes called Ruby), and was originally designed by Alan Cooper in 2002 for Visual Basic .NET 2002 ( v7.0) came out, Visual Basic .NET 2003 (v7.1) came out in 2003, Visual Basic 2005 (v8.0) came out on November 7, 2005, and at the same time a free simplified version of Visual Basic 2005, Visual Basic 2005 Express, was launched Edition is for Visual Basic beginners and students.

The "significant" advantage of VB 2005 is that you can directly write XP-style buttons and other controls. However, the small program written by it takes up nearly 10MB of memory.

After several years of development, it has become a professional development language and environment. Users can quickly create Windows programs with Visual Basic and can now write enterprise-level client/server programs and powerful database applications.

VB will attract more praise and criticism, and will continue to be used by a large number of users and programmers. It is very suitable for developing programs with a friendly interface (such as data for terminals), but it is not suitable for developing other programs (such as joint calculation programs).

There are also streamlined versions of some VB software, such as the streamlined version of VB6.

Language features

A typical VB process The central idea of ??VB is to be easy to use for programmers, whether they are novices or experts. VB uses a GUI system that can easily create applications, but can also develop fairly complex programs. A VB program is a form-based arrangement of visual components, and code is added to specify the properties and methods of the components. Because some of the default properties and methods are already defined in the component, programmers can complete a simple program without writing much code. In past versions, the performance issue of VB programs has been put on the desktop, but with the rapid increase in computer speed, there are fewer and fewer debates about performance.

The addition and change of form controls can be achieved using drag-and-drop technology. A toolbox filled with controls displays available controls (such as text boxes or buttons). Each control has its own properties and events. Default property values ??are provided when the control is created, but can be changed by the programmer. Many attribute values ????can be changed with user actions and modifications during runtime, thus forming a dynamic program. For example: Code that can change the position of the control is added to the form's size change event. Whenever the user changes the window size during runtime, the control will also change its position. By adding the corresponding code to the text change event in the text box, the program can automatically translate or prevent the input of certain characters when text is entered.

A VB program can contain one or more forms, or a main form and multiple subforms, similar to an operating system. Dialog windows with little functionality (such as forms without maximize or minimize buttons) can be used to provide pop-up functionality.

VB components can have user interfaces or not. This way the server-side program can handle the added modules.

VB uses the parameter calculation method to perform garbage collection. This method contains a large number of objects and provides basic object-oriented support. As more and more components appear, programmers can choose the extension libraries they need.

Unlike some languages, VB is not case-sensitive, but it can automatically convert keywords to standard case, and force the variable names of entities in symbol table entries to follow writing rules. String comparisons are case-sensitive by default, but this feature can be turned off.

VB allows a large number of external controls to have their own living space. A large number of third-party controls are provided for VB. VB also provides methods to create, use and reuse these controls, but due to language issues, it is not simple to create another from one application.

Terminology

When discussing Visual Basic, you often hear the following terms, so a basic understanding of these terms is very helpful.

Control - simply put, a control is a graphical tool that constitutes or builds a Visual Basic application, including forms, buttons, check boxes, list boxes, data controls, table controls and picture controls. etc....

Event - An action initiated by the user or the operating system. Examples of events are keystrokes, mouse clicks (Click), double mouse clicks (DblClick), time limits, or receiving data from a port.

Method - Programming code embedded in the object definition that defines how the object processes information and responds to events. For example, a database object has the basic elements of a program with methods for opening a recordset and moving from one record to another. It contains properties that define its characteristics, methods that define its tasks, and methods that identify the events to which it can respond. Controls and forms are examples of all objects in Visual Basic.

Object - A control, form, etc. can be regarded as an object.

Procedure - a piece of code written to complete certain specific tasks. Procedures are usually used to respond to specific events, and can also be used as user-defined functions in applications.

Attributes - Attributes are specific descriptions of the properties of each object that make up the user interface. For example, the size, position, color, width, height, etc. mentioned in the above "object" are all called properties of the control. Properties determine an object's appearance and sometimes its behavior. Most of the properties of the object have been defined in advance in VB, but some properties need to be defined during the application process. Properties can provide data to objects and retrieve information from objects.

Limitations of VB

Inheritance. VB5 and VB6 are both object-oriented programming languages, but do not contain inheritance features. VB provides special class functions, but it still cannot meet the needs of programmers. Contains all object-oriented features.

Multi-threading support (2002 and later versions support multi-threading technology.)

Exception handling. Try-Catch-Finally is used to handle exceptions. There is only the On Error Goto line statement in VB.

Support for pointers is very limited.

VB can only support 8 to 32-bit integers, and many languages ??have unlimited support.

VB does not allow immutable variables in any array.

VB does not support the above features, and programmers need to construct their own methods to achieve similar functions.

Controversy

Opposition:

VB is a language full of controversy: many programmers have strong feelings about the quality of VB programs. Many people think that VB is not suitable for them to use, thinking that it is a language for children and novice programmers. It has been a simple language since its design. Some features in C++ and Java do not appear in VB. While feeling the convenience and speed of development, some functions such as type and declaration checking at compile time are turned off by default. In this way, some programmers lament the ease of use of VB and generally watch with frustration the occurrence of errors similar to "undefined type".

Some critics believe that the simple nature of VB makes it harmful in the future. Many people have taught themselves VB, but have not learned good programming habits. When VB enters the classroom, students will not learn many basic programming techniques and structures because many techniques are already included in components visible to the user. There is no need to learn standard programming habits, because VB has visual characteristics, which leads to the generation of some inexplicable codes. Moreover, many error and warning checks are turned off by default, making it difficult for programmers to find hidden errors. Experienced programmers will turn on these options when programming in VB.

Many critics criticized Microsoft for simply copying BASIC ideas into VB. The famous computer scientist Edsger Dijkstra once said a famous saying: "If a student first learned BASIC, it is almost impossible for him to learn excellent programming: because these people have given up hope of nirvana." (Dijkstra treats Fortran, PL/1 , COBOL and APL are also merciless. )

Another joke is: "Real programmers don't use BASIC. Only children under 12 years old do."

It is not very simple. The programs it develops can only run in Microsoft Windows.

It is too big. It takes several disks to install Visual Studio. VB The program also requires a 1.4M runtime library.

There is an error in the IDE.

VB cannot integrate the basic API of Windows very well, and low-level operations are often used. "Little tricks" for programming. The low-level memory operations of C language are much simpler than those of VB.

Supporting point of view:

But many VB supporters explain that VB. Its greatest advantage is its ease of use, which allows experienced VB programmers or those who have just scratched the surface to quickly develop programs in their own way. Moreover, VB programs can be easily connected to databases, for example. The database can be bound, so that programs written in VB can master all the information of the database without writing a line of code.

Many language features such as GoSub, On Error and the last one using variable names. Character judgment declaration types (such as string type str$) come from VB. The syntax of VB is different from that of most languages, which may confuse new programmers. For example, the declaration "Dim a, b, c As". Integer" declares c as an integer variable, but a and b are both of Variant type. {Let me explain here, if you want to declare 3 Integer, you must write Dim a as Integer, b As Integer, c as Integer; and directly write Dim a, if you don't write a type after it, it will automatically become a Variant type - it takes up a lot of resources. } There are also some features, such as the underscore character "_" that is used by some programmers when writing a line of code in multiple lines. Non-standardization will cause errors.

Development Timeline

In April 1991, Visual Basic 1.0 Windows version was released

September 1992, Visual Basic 1.0. The DOS version was released.

In November 1992, VB2.0 was released. It improved the interface and speed of the previous version.

In the summer of 1993, VB3.0 was released. , divided into standard version and professional version. It contains a data engine that can directly read Access database. In August 1995, VB4.0 was released, which included a 32-bit version and a 16-bit version. Support for classes was added.

In February 1997, VB5.0 was released. Programmers can use the 32-bit version to import 16-bit programs created by version 4.0, and they can also be compiled smoothly. Support for user-built controls.

In the summer of 1998, VB6.0 was released.

In 2001, Visual Basic.net and .NET Framework were released. Because it uses new cores and features, many VB programmers have to rewrite programs.

In 2003, Visual Basic.net 2003 and .NET Framework 1.1 were released.

In 2004, Microsoft opened a beta version of Visual Studio 2005 (codenamed Whidbey). Contains a beta version of .NET Framework 2.0.

In 2005, Microsoft announced that it would no longer support non-.NET versions of VB. The VB community immediately responded to express concern about the news, and some old users also submitted a petition hoping to continue technical support for VB. Microsoft is not yet willing to change their decision.

Languages ??derived from VB

Microsoft has developed a series of VB-related scripting languages:

Visual Basic for Applications, or VBA, is included in Microsoft applications In programs (such as Microsoft Office), and in third-party products such as WordPerfect Office. It may seem contradictory that VBA is embedded in various applications, but its functions are as powerful as VB.

VBScript is the default ASP language and can also be used in Windows scripting and web page coding. Although its syntax is similar to VB, it is a completely different language. VBS does not use the VB runtime library to run, but is interpreted and executed by the Windows script host. The differences between these two languages ??affect the performance of ASP websites.

When Microsoft prepares to develop a new programming tool, its first decision is to use the most popular VB6 to make changes, or to reorganize the project to develop new tools. Microsoft later developed Visual Basic .NET, the successor to VB, which is also part of the .NET platform. The VB.net programming language is a true object-oriented programming language and is not fully compatible with VB.

About VB.NET

Visual Studio.net 2005 was released on November 7, 2005.

Visual Basic.NET (referred to as VB.NET) is a new generation of VB. It is not a simple upgrade of VB 6.0. There is a very big difference between VB.NET and VB. Its new features are mainly reflected in the following aspects:

1. VB.NET is fully integrated into the Visual Studio integrated development environment, which differs from VB in several aspects. It is mainly reflected in the differences in form layout and menus.

2. VB.NET projects are different from VB. It uses a folder-based model where all projects are placed in a project folder hierarchy.

3. ADO.NET is used in VB.NET to access the database. ADO.NET is part of the .NET framework. There are two important ways to implement data access in VB.NET: one is to create and configure the data adapter DataAdapter and generate the data set DataSet during the programming phase; the other is to dynamically create configuration data through programming during operation. Adapter and create and generate data sets.

4. In VB.NET, ASP.NET technology is used to write Web pages. What is used in ASP.NET is not a scripting language, but a real programming language. With ASP.NET's Web applications, XML Web Services and other Web-based functions, developing Web pages with VB.NET is very similar to developing Windows applications, and the Web page code also appears organized.

5. VB.NET has become a completely object-oriented programming language.