Two times more efficient! --visual Basic.NET New Power

Source: Internet
Author: User
Tags continue new features require requires
Visual Many people have read my last article, "The new power of complex and efficient--visual Basic.NET", which describes the addition of generics, operator overloading, my namespace, and some language elevation in the new version of Visual Basic.NET, such as unsigned integer, Continue statements, using statements, and so on, I believe that the VB supporters of a happy. This time, I'll add the new features of visual Basic Whidbey to the supporters of VB.



First, continue to perform and repair automatically

Users upgraded from VB6.0 miss the very handy debugging features of VB6.0 interpretation. They can modify the code directly when the program goes wrong, and then continue to run it. VB.net this feature was canceled due to the full compile execution. In the vb.net Whidbey, this function is back! The newly added interpreter can interpret the Il compiled by VB for the time being, and when there is an exception, talk about an exception balloon (the so-called balloon, that is, the Windows XP Tray area often pops out of that prompt window). At this point you can modify the code and gently drag the arrow representing the location of the run to where you want to start, and then click Run. See! The code continues to run. VB finally returned to the former convenient and incomparable debugging environment, this is still using the VB6 of hesitation, not fast approaching vb.net?

Now vb.net Whidbey has the function of "auto fix" just like Word's syntax prompts. such as the following code:



Dim S as Strng



In VB.net 2003, the IDE prompts for an error immediately, and in VB.net Whidbey, the IDE displays a "smart tag" under the wrong code, just as in Word, clicking the smart tag pops up the suggested code, such as the correct spelling of string. This feature can help programmers greatly reduce the changes in the code of events, the efficiency is not increased by twice times?



Two, incomplete type

Once upon a time, a type, such as a module or class, must be completed in one file, meaning that a class cannot be implemented separately in two files. This brings trouble to some special requirements, such as the form contains the interface part and the function part, the interface part is best by the experienced art design, while the functional part is written by the programmer, then two people cannot work simultaneously, otherwise will produce the version confusion. Now that vb.net Whidbey supports an incomplete type, you can write a type in two files separately:

Public expands Class Test

' This is the first part of test

Public Sub Function1 ()

' Some code

End Sub

End Class



' In another file

Public expands Class Test

' This is the second part of test

' Some other code

End Class

Now the same type can be placed in separate files according to function, and then the implementation is written by different programmers. If the use of this function, the efficiency is not increased by twice times?



Three, XML annotation document

If writing a comment can be a document, will programmers be more enthusiastic about writing documents? XML annotation documents are not the only way to be provided to programmers. Embedded XML Annotation documents enable programmers to not only translate input annotations into documents, but also create beautiful HTML document reports using the IDE. At the same time, writing XML document annotations can directly provide input coding convenience. Such as

' @<comment>

' @ This is the description of the method

' @</comment>

Public Sub TestMethod ()

The next time you use TestMethod, you will not only be able to do it automatically, but will also be able to display the annotation information "This is the description of this method" so that you no longer confuse the code.

The XML document is C # originally has the function, its convenient use lets the programmer fondle admiringly, now in the VB Programmer's voice, finally introduced the vb.net Whidbey. With XML annotation documents, writing documents and writing programs into one, the efficiency is increased twice times? (The syntax in this case is not finalized yet)



Iv. automatic completion of user interface and smart tags

The current IDE Auto-complete function is also limited to text code, the user interface can be automatically completed? vb.net Whidbey give you a new feeling. A data source from a data connection can be created directly in the newly added data source window. Just click the field of the table you want to use, and then press OK to complete the creation of the data source. Now, as soon as you drag the data source onto the form, you immediately generate a set of interface elements, including the DataGrid, Forward and Rewind buttons, update buttons, and so on, previously only VB6 Data environment is so convenient. But VB.net Whidbey offers more than that, as long as you click the smart tag that appears below the window to change the form of the data interface, such as using a traditional data form or a DataGrid style. If you are using a data form, the input of each field control can be flexibly controlled by a smart tag, such as a field that is read-only, so you can change the control of the fields from a text box to a label, which requires a slight mouse click. All of these features do not require manual input of code, the automatic completion of the user interface and smart tags to the user interface to create a great convenience, this increase in efficiency can be more than twice times.



V. Code Snippets

Everyone will find that the program actually has a lot of idiomatic code, such as try structure, file operation in the open, read, close or registry operation, and so on, although each time to use that, but must be input from beginning to end, it is troublesome. Now vb.net Whidbey provides the functionality of code snippets. Some commonly used program structures have been defined as snippets of code, and you can easily add snippets of code by right-clicking. The added code snippet has many places that require user changes, such as opening a piece of file that requires the user to enter the path of the file and the variables to read and write, which are marked with a marked color to allow the user to "fill in the blanks". With snippets of code, you'll find that many of the most commonly used code don't need to be written manually, and you can generate standard code by simply clicking on a snippet and then filling in the blanks. Does this feature increase your code efficiency by up to twice times?



VB.net's This upgrade greatly improved the language of VB, the RAD programming features, Microsoft claims that you can reduce your code by more than 50%, this is true? Look at the above introduction, do you still doubt it? Look forward to this version of the VB, so that the efficiency of two times increase!


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.