Hoeist!? Blog of Colin Raaijmakers.
VB.NET Option Strict and Option Explicit
Development
Option Explicit On forces you to declare all your variables, which makes your code easier to read and maintain. Be sure to use the As clause in every declaration, including procedure arguments. If you do not specify As, your variables and arguments take data type Object, which is usually not the optimal type. Using As improves performance because it moves type inference from run time to compile time. For more information, see Option Explicit Statement.
Option Strict On disallows implicit narrowing, requires the As clause in every declaration, and disallows late binding regardless of the Option Explicit setting. You can still perform narrowing type conversions, but you must use explicit conversion keywords such as CInt and CType. Explicit declaration improves performance because it protects your code from inadvertent late binding. For more information, see Option Strict Statement.
Option Compare Binary specifies that strings are to be compared and sorted based on the binary representation of their characters, without considering equivalent characters such as uppercase/lowercase pairs. You should use binary comparison whenever your application's logic permits it. It improves performance because the code does not need to deal with case insensitivity, or with groups of characters considered alphabetically the same in a given culture.
VB.NET Short Circuiting (AndAlso OrElse)
Development
When possible, you should use the short-circuiting Boolean operators, AndAlso and OrElse. These can save time by bypassing the evaluation of one expression depending on the result of the other. In the case of AndAlso, if the result of the expression on the left is False, the final result is already determined and the expression on the right is not evaluated. Similarly, OrElse bypasses the expression on the right if the one on the left evaluates to True. Note also that the Case statement can short-circuit a list of multiple expressions and ranges, if it finds a match value before the end of the list.
About me
Application & Web Developer
at The Cre8ion.Lab
Application Developer, Database Administrator, and Project Manager in a wide variety of business applications. Particularly interested in client/server and relational database design using MS-SQL Server. Always interested in migration projects, as well as close interaction with the .NET and DB manufacturers.
Skills
Microsoft Visual Studio 6.0, 2002, 2003, 2005, 2008 & 2010, Macromedia Flash (8.0, CS3, AS2, AS3) en Dreamweaver, Microsoft SQL Server 2000, 2005 & 2008, MySQL Server, Microsoft IIS WebServer 5, 6 en 7, Apache Webserver, Microsoft Commerce Server 2000, HTML, dHTML, XHTML, CSS, W3C, Javascript, ASP, VBscript, ASP.NET, VB.NET, C#.NET, basis PHP, XML, jQuery + Plugins, Diverse Frameworks & Content Management Systemen, TCP/IP, DHCP, LAN, WAN, WLAN, Microsoft .NET Micro Framework 4.1.
Tagcloud
colin raaijmakers, vb.net, logitech, g19, applet, plugin, application, g19app, xfire, teamspeak, winamp, asp, windows, remote, vista, internet, booty, suit, of, sin, sql, function, ie8, app, applets, microsoft, ie7, android, samsung, google, 2.3.5, 2.3.6, update, kies, upgrade