Re: Option Strict
From: Kevin Spencer (kspencer_at_takempis.com)
Date: 10/14/04
- Next message: Rob T: "Re: html email with embedded images"
- Previous message: Jim Cheshire [MSFT]: "RE: asp.net 1.1 would not start: web server is not running 1.1"
- In reply to: Scott M.: "Re: Option Strict"
- Next in thread: Sahil Malik: "Re: Option Strict"
- Reply: Sahil Malik: "Re: Option Strict"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 11:50:14 -0400
Great point. Let me give an example, from my real-life experience. I came to
work for this company a year and a half ago, and the guy that was directly
underneath me had taught himself VB.Net coming from a VB/ASP background. He
didn't use Option Strict. He had private fields that were integers exposed
via public properties that were strings. Imagine the difficulty tracing down
an issue with a non-integer string value being used to set the value of the
Integer field. Data types are important, moreso as the bigger and more
complex the app becomes. Making sure that your data types are correct not
only speeds up runtime performance, but can prevent some hard-to-identify
errors from happening as well.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP I get paid good money to solve puzzles for a living "Scott M." <s-mar@nospam.nospam> wrote in message news:urgzotWsEHA.1404@TK2MSFTNGP11.phx.gbl... > Option Strict also "disallows late binding". > > Late binding is when the application doesn't know until run time what an > object's true type is. This causes more overhead to your application and > opens the door to errors. > > Not allowing late binding (and therefore enforcing early binding) means that > all objects must know their type at design time, because of this, the > IntelliSense in VS.NET tells you what class members are allowed on the > object. > > > "Simon Harris" <too-much-spam@makes-you-fat.com> wrote in message > news:uxdp6OWsEHA.2808@TK2MSFTNGP14.phx.gbl... > > Hi All, > > > > I've been advised to use option strict. I've tried to read up on this, all > > i can find is that it... > > > > "disallows implicit narrowing conversions" > > > > This kinda makes sense - Means I have to explicitly cast or convert data > > when comparing/setting two different data types right? > > > > Is there any more to it than this? What are the benefits of using option > > strict? > > > > Regards, > > Simon. > > > >
- Next message: Rob T: "Re: html email with embedded images"
- Previous message: Jim Cheshire [MSFT]: "RE: asp.net 1.1 would not start: web server is not running 1.1"
- In reply to: Scott M.: "Re: Option Strict"
- Next in thread: Sahil Malik: "Re: Option Strict"
- Reply: Sahil Malik: "Re: Option Strict"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|