Skip Navigation LinksHome > Books > Code from a Book

VB.Net New conveniences and rules

Book Name: Building Applications and Components with Visual B
Author: Ted Pattison
Building Applications and Components with Visual Basic .NET
Buy This Book: Click Here
    Viewed Times: 4013 Add Date: 08/20/2010
A few new conveniences offered by Visual Basic.Net, examine some other new features designed to improve the quality and maintainability of your code
1. Define values in a row 2. New initialization syntax 3. Use += &= operator 4. Use Return to halt method execution and return value to a calling function 5. No more On Error GoTo statements, but use Try...Catch...End Try 6. Encourage using Explicit Conversions: such as CType, also can use: CBool, CByte, CChar, CDate, CDbl, CDec, CInt, CLng, CObj, CShort, CSng and CStr. 7. Encourage using AndAlso to Replace using And, for example: Above code always check the condition on both side of And, what if passing in target is Nothing, then it will raise an exception when checking: target.Name<> "". Above code won't go to check target.Name<>"" if Not target Is Nothing is False already.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.