casting at compile-time not available in VB - TechRepublic
General discussion
October 3, 2007 at 05:50 AM
arzewski

casting at compile-time not available in VB

by arzewski . Updated 18 years, 10 months ago

Most of the differences that people note between these two .NET languages occurr because the default setting in VB.NET is Option Strict Off. It it is set to On, then, people will say, VB.NET is basically the same as C#.

One area where this is not true is in casting from one type to another. In C#, that occurrs at compile-time, and the compiler will check that. In VB, the “cast” occurrs in the run-time invokation of a function, and thus the app can generate a run-time exception if the build was made from VB.NET code.

This discussion is locked

All Comments