By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Option Strict ON - WHY use it???

P: n/a
I have a project that was created all with Option Strict OFF. Works great,
not a problem with it. But if I turn Option Strict ON then I get a LOT of
errors.

My question, should I even care about Option Strict?
What advantages do I get with Option Strict On?
Does better type statement make my code run faster?

If anyone knows THE ANSWERS! please fill me in. I have ideas and belief but
I would once and for all like to know what the difference is.

Thank in advance

Clyde W.


Nov 21 '05 #1
Share this Question
Share on Google+
30 Replies


P: n/a
There are likely many reasons why you should have OPTION STRICT ON all the
time.

My main reason for using it is to watch for narrowing conversions. Places
in code where I might inadvertanly perform a conversion from a double to a
single ore perhaps any floating point value to an integer value.
--
Gerry O'Brien
Visual Basic.NET MVP
"Microsoft News" <Na**@coxinet.net> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
I have a project that was created all with Option Strict OFF. Works great,
not a problem with it. But if I turn Option Strict ON then I get a LOT of
errors.

My question, should I even care about Option Strict?
What advantages do I get with Option Strict On?
Does better type statement make my code run faster?

If anyone knows THE ANSWERS! please fill me in. I have ideas and belief
but
I would once and for all like to know what the difference is.

Thank in advance

Clyde W.

Nov 21 '05 #2

P: n/a

"Microsoft News" <Na**@coxinet.net> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
I have a project that was created all with Option Strict OFF. Works great, not a problem with it. But if I turn Option Strict ON then I get a LOT of
errors.


If you notice the different between having it ON or OFF, then you aren't
programming very well.

Turn it on and fix the errors.
Nov 21 '05 #3

P: n/a
Clyde,

It is up to you, when you are programming in an access kind of way,
scripting way, you can use option strict of and let the computer do things
for you at run time.

This means directly that your program becomes more insecure and does not
have the performance as it could be.

A simple sample.
When you say
dim a as object
a = 1
dim 1 as integer = a
Than this goes with option strict of, however the program does now not know
what conversion should be done at run time and solves it at that moment.

With option strict on it has to be
dim 1 as integer = Cint(a) 'or any other casting, conversion, parsing
command and is it done at run time.

Before you say it, I myself find it strange that this is not build in
automaticly, because the compiler knows this at run time. He tells you that
you that Option Strict Disallows you to do an implicit conversion from
integer to object.

Therefore he can do that in my opinion in design time himself at least by
giving a default which can be choosen with one click. (Or with an option
which tells always to set the standard conversion function in this kind of
situations).

I hope this helps?

Cor
Nov 21 '05 #4

P: n/a
I believe using a lot of late binding will cause your program to run quite a
bit slower.

"Microsoft News" wrote:
I have a project that was created all with Option Strict OFF. Works great,
not a problem with it. But if I turn Option Strict ON then I get a LOT of
errors.

My question, should I even care about Option Strict?
What advantages do I get with Option Strict On?
Does better type statement make my code run faster?

If anyone knows THE ANSWERS! please fill me in. I have ideas and belief but
I would once and for all like to know what the difference is.

Thank in advance

Clyde W.


Nov 21 '05 #5

P: n/a
It definitely will affect performance - not to mention it will greatly
increase the chances of making some hard to find logic errors.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
I believe using a lot of late binding will cause your program to run quite a bit slower.

"Microsoft News" wrote:
I have a project that was created all with Option Strict OFF. Works great, not a problem with it. But if I turn Option Strict ON then I get a LOT of errors.

My question, should I even care about Option Strict?
What advantages do I get with Option Strict On?
Does better type statement make my code run faster?

If anyone knows THE ANSWERS! please fill me in. I have ideas and belief but I would once and for all like to know what the difference is.

Thank in advance

Clyde W.


Nov 21 '05 #6

P: n/a
Amen!

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Noozer" <do******@me.here> wrote in message
news:J55Ad.601425$%k.374308@pd7tw2no...

"Microsoft News" <Na**@coxinet.net> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
I have a project that was created all with Option Strict OFF. Works

great,
not a problem with it. But if I turn Option Strict ON then I get a LOT of errors.


If you notice the different between having it ON or OFF, then you aren't
programming very well.

Turn it on and fix the errors.

Nov 21 '05 #7

P: n/a
Bill,
It definitely will affect performance -


It does not.

Cor
Nov 21 '05 #8

P: n/a
"Cor Ligthert" <no************@planet.nl> schrieb:
It definitely will affect performance -


It does not.


Huh?!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #9

P: n/a
Herfried K. Wagner [MVP] wrote:
"Cor Ligthert" <no************@planet.nl> schrieb:
It definitely will affect performance -


It does not.

Huh?!


I don't know if it affects performance or not. But I do know this. I
turned it on in my application and now I have about 500 errors to fix!
Thanks alot people! ;)

--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.
Nov 21 '05 #10

P: n/a
Cor - not sure if you understood what I was saying or not. What I was
saying is that Option Strict On code runs much faster - by having it off
code will definitely run slower. If you wrote code with Option Strict Off
that was strongly typed and woudl compile with Option Strict On, that
difference would be minimized somewhat but it will still run slower. I
could go through the list of reasons why but I could never do it as well as
Dan Appleman did
http://www.desaware.com/products/boo...ing/index.aspx

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Bill,
It definitely will affect performance -


It does not.

Cor

Nov 21 '05 #11

P: n/a
Aaron - trust me on this - Seriously - This is the best thing you've done
for yourself. Option Strict Off is bad in so many ways. Yes, it's a little
more of a pain getting used to On at first, but it's soooo worth it. You'll
get much better performance, catch potential bugs early and get the added
benefit of intellisense.

Take this beauty which I got from the DailyWTF - Friend ReadOnly Property
CheckUserRole() As Boolean
Get
Dim user As SystemUser = SystemUser.CurrentUser
If user.AssertRole(RoleTypes.Admin) Then
Return 0
Else
If user.AssertRole(RoleTypes.Training) Then
Return 1
Else
If user.AssertRole(RoleTypes.Supervisor) Then
Return 2
End If
End If
End If
End Get
End Property

http://msmvps.com/williamryan/archiv.../11/23477.aspx

Here's a great quote that someone posted in response to this code:
Isn't it incredible how many run-time mysteries become compile-time wavy
underlines with circles and arrows and flashing lights and sound effects
when you use Option Explicit/Option Strict?
--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Aaron Smith" <th**********@smithcentral.net> wrote in message
news:c8*****************@newssvr31.news.prodigy.co m...
Herfried K. Wagner [MVP] wrote:
"Cor Ligthert" <no************@planet.nl> schrieb:
It definitely will affect performance -

It does not.

Huh?!


I don't know if it affects performance or not. But I do know this. I
turned it on in my application and now I have about 500 errors to fix!
Thanks alot people! ;)

--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.

Nov 21 '05 #12

P: n/a
Aaron, I'm sure you realize those are necessairly errors, it's just that with
option strict on, you have to tell the compiler the type of the object before
you use it in code situations that requires knowing the object type in order
to execute.

"Aaron Smith" wrote:
Herfried K. Wagner [MVP] wrote:
"Cor Ligthert" <no************@planet.nl> schrieb:
It definitely will affect performance -

It does not.

Huh?!


I don't know if it affects performance or not. But I do know this. I
turned it on in my application and now I have about 500 errors to fix!
Thanks alot people! ;)

--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.

Nov 21 '05 #13

P: n/a
I didn't even know much about Option Strict until I started to read
about after looking through this thread.

I used to do a lot of Visual C++ development a few years ago. An app can
run when there are warnings but no errors... Will it run good?
Probably.. Could it have a ton of bugs in it because there are warnings?
Yep. Then why not fix the warnings and prevent the bugs?

W.G. Ryan eMVP wrote:
Aaron - trust me on this - Seriously - This is the best thing you've done
for yourself. Option Strict Off is bad in so many ways. Yes, it's a little
more of a pain getting used to On at first, but it's soooo worth it. You'll
get much better performance, catch potential bugs early and get the added
benefit of intellisense.

Take this beauty which I got from the DailyWTF - Friend ReadOnly Property
CheckUserRole() As Boolean
Get
Dim user As SystemUser = SystemUser.CurrentUser
If user.AssertRole(RoleTypes.Admin) Then
Return 0
Else
If user.AssertRole(RoleTypes.Training) Then
Return 1
Else
If user.AssertRole(RoleTypes.Supervisor) Then
Return 2
End If
End If
End If
End Get
End Property

http://msmvps.com/williamryan/archiv.../11/23477.aspx

Here's a great quote that someone posted in response to this code:
Isn't it incredible how many run-time mysteries become compile-time wavy
underlines with circles and arrows and flashing lights and sound effects
when you use Option Explicit/Option Strict?

--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.
Nov 21 '05 #14

P: n/a
Dennis wrote:
Aaron, I'm sure you realize those are necessairly errors, it's just that with
option strict on, you have to tell the compiler the type of the object before
you use it in code situations that requires knowing the object type in order
to execute.


Yea, but I would rather have it all correct.

--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.
Nov 21 '05 #15

P: n/a
100% Agree with you.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Aaron Smith" <th**********@smithcentral.net> wrote in message
news:qb*****************@newssvr31.news.prodigy.co m...
I didn't even know much about Option Strict until I started to read
about after looking through this thread.

I used to do a lot of Visual C++ development a few years ago. An app can
run when there are warnings but no errors... Will it run good?
Probably.. Could it have a ton of bugs in it because there are warnings?
Yep. Then why not fix the warnings and prevent the bugs?

W.G. Ryan eMVP wrote:
Aaron - trust me on this - Seriously - This is the best thing you've done for yourself. Option Strict Off is bad in so many ways. Yes, it's a little more of a pain getting used to On at first, but it's soooo worth it. You'll get much better performance, catch potential bugs early and get the added benefit of intellisense.

Take this beauty which I got from the DailyWTF - Friend ReadOnly Property CheckUserRole() As Boolean
Get
Dim user As SystemUser = SystemUser.CurrentUser
If user.AssertRole(RoleTypes.Admin) Then
Return 0
Else
If user.AssertRole(RoleTypes.Training) Then
Return 1
Else
If user.AssertRole(RoleTypes.Supervisor) Then
Return 2
End If
End If
End If
End Get
End Property

http://msmvps.com/williamryan/archiv.../11/23477.aspx

Here's a great quote that someone posted in response to this code:
Isn't it incredible how many run-time mysteries become compile-time wavy
underlines with circles and arrows and flashing lights and sound effects
when you use Option Explicit/Option Strict?

--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.

Nov 21 '05 #16

P: n/a
Or they may be things that will cause real errors - A prime example is what
I posted above:

CheckUserRole() As Boolean
Get
Dim user As SystemUser = SystemUser.CurrentUser
If user.AssertRole(RoleTypes.Admin) Then
Return 0
Else
If user.AssertRole(RoleTypes.Training) Then
Return 1
Else
If user.AssertRole(RoleTypes.Supervisor) Then
Return 2
End If
End If
End If
End Get
End Property

This is a Boolean function that can return 0, 1 or 2 - Very good chance what
you'll get back isn't what you expected. The problem is that they may or
may not be 'real' errors or cause 'real' errors - and you won't know until
runtime - better to catch it at design time - cheaper across the board.

Option Strict Off is an abomination and the few cases that it may be needed
notwithstanding (because they are very very few) it should be avoided like
the plague. Turning on Option Explicit may cause errors too - and they may
not be 'real' errors but they are surely bad and certainly capable of
causing problems you didn't expect and that you'll have to spend time
tracking down.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:8F**********************************@microsof t.com...
Aaron, I'm sure you realize those are necessairly errors, it's just that with option strict on, you have to tell the compiler the type of the object before you use it in code situations that requires knowing the object type in order to execute.

"Aaron Smith" wrote:
Herfried K. Wagner [MVP] wrote:
"Cor Ligthert" <no************@planet.nl> schrieb:

>>It definitely will affect performance -
>
>It does not.
Huh?!


I don't know if it affects performance or not. But I do know this. I
turned it on in my application and now I have about 500 errors to fix!
Thanks alot people! ;)

--
---
Aaron Smith
Remove -1- to E-Mail me. Spam Sucks.

Nov 21 '05 #17

P: n/a
Does the compiler directive itself affect performance? Or is just the
coding style it imposes that creates the performance boost?

In others words, if you wrote a program with Option Strict On and then
changed it to Off when finished, would it suddenly run slower???

Isn't the IL code the same?

Greg

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ur**************@TK2MSFTNGP11.phx.gbl...
"Cor Ligthert" <no************@planet.nl> schrieb:
It definitely will affect performance -


It does not.


Huh?!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #18

P: n/a
Greg - I believe the answer answer is yes. If you coded it exactly the same
you'd minimize the hit, but Option strict off generates late bound IL - but
mainly - the runtime doesn't have to do the same amount of checking. Let me
see if I can find the article I read on this...

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:#m**************@TK2MSFTNGP11.phx.gbl...
Does the compiler directive itself affect performance? Or is just the
coding style it imposes that creates the performance boost?

In others words, if you wrote a program with Option Strict On and then
changed it to Off when finished, would it suddenly run slower???

Isn't the IL code the same?

Greg

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ur**************@TK2MSFTNGP11.phx.gbl...
"Cor Ligthert" <no************@planet.nl> schrieb:
It definitely will affect performance -

It does not.


Huh?!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Nov 21 '05 #19

P: n/a
I just ordered a copy of Appleman's book. You perked my curiosity about the
Option Strict info inside.

Glad to see he did away with the security feature on the ebooks. My last
one from him I cannot even open anymore (dead login link). ;(

Greg

"W.G. Ryan eMVP" <Wi*********@NoSpam.gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Greg - I believe the answer answer is yes. If you coded it exactly the
same
you'd minimize the hit, but Option strict off generates late bound IL -
but
mainly - the runtime doesn't have to do the same amount of checking. Let
me
see if I can find the article I read on this...

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:#m**************@TK2MSFTNGP11.phx.gbl...
Does the compiler directive itself affect performance? Or is just the
coding style it imposes that creates the performance boost?

In others words, if you wrote a program with Option Strict On and then
changed it to Off when finished, would it suddenly run slower???

Isn't the IL code the same?

Greg

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ur**************@TK2MSFTNGP11.phx.gbl...
> "Cor Ligthert" <no************@planet.nl> schrieb:
>>> It definitely will affect performance -
>>
>> It does not.
>
> Huh?!
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
>



Nov 21 '05 #20

P: n/a
It's definitely a good read and I agree, that security stuff was a pain - i
can't get to mine either ;-(

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl...
I just ordered a copy of Appleman's book. You perked my curiosity about the Option Strict info inside.

Glad to see he did away with the security feature on the ebooks. My last
one from him I cannot even open anymore (dead login link). ;(

Greg

"W.G. Ryan eMVP" <Wi*********@NoSpam.gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Greg - I believe the answer answer is yes. If you coded it exactly the
same
you'd minimize the hit, but Option strict off generates late bound IL -
but
mainly - the runtime doesn't have to do the same amount of checking. Let me
see if I can find the article I read on this...

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message
news:#m**************@TK2MSFTNGP11.phx.gbl...
Does the compiler directive itself affect performance? Or is just the
coding style it imposes that creates the performance boost?

In others words, if you wrote a program with Option Strict On and then
changed it to Off when finished, would it suddenly run slower???

Isn't the IL code the same?

Greg

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ur**************@TK2MSFTNGP11.phx.gbl...
> "Cor Ligthert" <no************@planet.nl> schrieb:
>>> It definitely will affect performance -
>>
>> It does not.
>
> Huh?!
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
>



Nov 21 '05 #21

P: n/a
Bill,

Because we had a discussion in this newsgroup where I wrote something the
same as you although I wrote something more. I was almost sure that there
would be a reaction on my text so there could be a discussion.

Greg answered it by the way. In the context as you write it now does it
nothing. Option Strict On prevents you from writting bad programs. Option
Strict On or Off does nothing when the program is already writen right.

Cor
Nov 21 '05 #22

P: n/a
"Cor Ligthert" <no************@planet.nl> schrieb:
Greg answered it by the way. In the context as you write it now does it
nothing. Option Strict On prevents you from writting bad programs. Option
Strict On or Off does nothing when the program is already writen right.


W.G. Ryan replied to a post that was talking about the bad performance
impact of heavily using late binding -- which is only possible with 'Option
Strict Off'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #23

P: n/a
Herfried,

It is only to show him to be a little bit more prudence. He wrote that more
in this style and the ones who don't know can think it is a kind of a
booster. I know Bill from other newsgroups.

Cor
Nov 21 '05 #24

P: n/a
> Option Strict On or Off does nothing when the program is already writen
right.
My gut reaction is to agree with you on this. But Bill (I thought) was
suggesting that there is more to it. I am waiting for my eBook from
Appleman to arrive to see what his thoughts are on the subject.

I'll let you know what I find.

Greg
"Cor Ligthert" <no************@planet.nl> wrote in message
news:OH**************@TK2MSFTNGP11.phx.gbl... Bill,

Because we had a discussion in this newsgroup where I wrote something the
same as you although I wrote something more. I was almost sure that there
would be a reaction on my text so there could be a discussion.

Greg answered it by the way. In the context as you write it now does it
nothing. Option Strict On prevents you from writting bad programs. Option
Strict On or Off does nothing when the program is already writen right.

Cor

Nov 21 '05 #25

P: n/a
Cor:

I'm not sure I follow you. If you have Option Strict OFF - it's next to
impossible to write your code and not make any violations if your project is
of any notable size. You could take the same argument you made to Option
Explicit and it would be technically correct. Realisitically though it's
not because chances are you'll make a typo with Explicit Off and more than
likely you'll violate if you have Strict off. Actually, it's not just more
than likely - it's practically guaranteed that on something of any size 500+
lines, that hitting everything exactly and making no violations will not
occur.

Forgetting one single conversion in a big loop is all it takes to degrade
performance.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <no************@planet.nl> wrote in message
news:OH**************@TK2MSFTNGP11.phx.gbl...
Bill,

Because we had a discussion in this newsgroup where I wrote something the
same as you although I wrote something more. I was almost sure that there
would be a reaction on my text so there could be a discussion.

Greg answered it by the way. In the context as you write it now does it
nothing. Option Strict On prevents you from writting bad programs. Option
Strict On or Off does nothing when the program is already writen right.

Cor

Nov 21 '05 #26

P: n/a
Bill,

As Greg stated, when you make your program completly with Option Strict On
and than put it to Option Strict Off, there will be no difference. This is
the same as was in a discussion last week about the same topic.

That does not mean that we don't agree, you would have seen offently when
you visit this message or the dotnet general newsgroup that I write this
everytime and tell than often, while that is because Option strict On
prefent writing programs with late binding. (Although there can still be
used reflection)

With Option Strict On
VBNet = C#
with OF
VBNet = VB6

This writting was exactly the reason from that thread past week where
Herfried told that this was not always true, however he forgot that I had as
well that statement about late binding in my message.

Probably exactly the reason why Herfried pointed me on the fact that the
message you answered was about late binding.

Cor
Nov 21 '05 #27

P: n/a
To much text changes again.

you visit this message or the dotnet general newsgroup

delete "message"

Cor
Nov 21 '05 #28

P: n/a
Bill,

I just got a chance to read the chapter "Option Slow On". I did not come
away with the same conclusion you state here. Nowhere did Appleman state
(or imply) that Option Strict On by itself makes your code run faster. It
is simply the coding style (strict type checking) that it enforces that
provides the speed benefit.

Please take another look for yourself. :^)

Happy New Year!

Greg
"W.G. Ryan eMVP" <Wi*********@gmail.com> wrote in message
news:u0*************@TK2MSFTNGP11.phx.gbl...
Cor - not sure if you understood what I was saying or not. What I was
saying is that Option Strict On code runs much faster - by having it off
code will definitely run slower. If you wrote code with Option Strict Off
that was strongly typed and woudl compile with Option Strict On, that
difference would be minimized somewhat but it will still run slower. I
could go through the list of reasons why but I could never do it as well
as
Dan Appleman did
http://www.desaware.com/products/boo...ing/index.aspx

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Bill,
> It definitely will affect performance -


It does not.

Cor


Nov 21 '05 #29

P: n/a
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> schrieb:
I just got a chance to read the chapter "Option Slow On". I did not come
away with the same conclusion you state here. Nowhere did Appleman state
(or imply) that Option Strict On by itself makes your code run faster. It
is simply the coding style (strict type checking) that it enforces that
provides the speed benefit.


One could easily check that by comparing the IL of the same application,
compiled with 'Option Strict Off' and 'Option Strict On'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #30

P: n/a
ACK

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Op**************@TK2MSFTNGP15.phx.gbl...
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> schrieb:
I just got a chance to read the chapter "Option Slow On". I did not come
away with the same conclusion you state here. Nowhere did Appleman state
(or imply) that Option Strict On by itself makes your code run faster.
It is simply the coding style (strict type checking) that it enforces
that provides the speed benefit.


One could easily check that by comparing the IL of the same application,
compiled with 'Option Strict Off' and 'Option Strict On'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #31

This discussion thread is closed

Replies have been disabled for this discussion.