473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

RANT: option strict etc

guy
when i first started using .net (beta 1) i came across option strict and
thought hey this could be really good, and since then have always turned it
on, most people here seem to agree that this is a good thing.

i have now been asked to debug a vb2005 web app for 3 weeks and there is no
mention of option strict in it, (there are also no classes defined, just a
couple of structures) everything is define as 'as object', data coming back
from a database call is 'Object' with a string appended to make it a valid
string ...

trying to debug this nightmare is worse than i could possibly imagine

so if you ever are tempted to turn option strict off please consider suicide
first!
Jun 13 '06 #1
15 1523
Guy,

How did you know that Jon Vaughan would sent a message about 25 minutes
after you for which this message can maybe something he has to overthink.

You are completely right in my opinion. Option strict off should only be
used in cases where there is some modeling or testing to be done.

Cor

"guy" <gu*@discussions.microsoft.com> schreef in bericht
news:3C**********************************@microsof t.com...
when i first started using .net (beta 1) i came across option strict and
thought hey this could be really good, and since then have always turned
it
on, most people here seem to agree that this is a good thing.

i have now been asked to debug a vb2005 web app for 3 weeks and there is
no
mention of option strict in it, (there are also no classes defined, just a
couple of structures) everything is define as 'as object', data coming
back
from a database call is 'Object' with a string appended to make it a
valid
string ...

trying to debug this nightmare is worse than i could possibly imagine

so if you ever are tempted to turn option strict off please consider
suicide
first!

Jun 13 '06 #2
RMT
I'm not sure but also it should be "on" by default - when you create a new
project and it should also be difficult to find to switch it off. In fact,
with casting (DirectCast, CType), I can't see ANY reason for making it
optional at all. Only one case I can think of where I needed to switch it
off and that was a workaround for some Interop stuff. I managed to find a
better workaround that didn't require "off" later on.

It's just plain laziness that leads people to code like this.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eH**************@TK2MSFTNGP02.phx.gbl...
Guy,

How did you know that Jon Vaughan would sent a message about 25 minutes
after you for which this message can maybe something he has to overthink.

You are completely right in my opinion. Option strict off should only be
used in cases where there is some modeling or testing to be done.

Cor

"guy" <gu*@discussions.microsoft.com> schreef in bericht
news:3C**********************************@microsof t.com...
when i first started using .net (beta 1) i came across option strict and
thought hey this could be really good, and since then have always turned
it
on, most people here seem to agree that this is a good thing.

i have now been asked to debug a vb2005 web app for 3 weeks and there is
no
mention of option strict in it, (there are also no classes defined, just
a
couple of structures) everything is define as 'as object', data coming
back
from a database call is 'Object' with a string appended to make it a
valid
string ...

trying to debug this nightmare is worse than i could possibly imagine

so if you ever are tempted to turn option strict off please consider
suicide
first!


Jun 13 '06 #3
RMT,

It is just off by default because the expected (and probably is seeing this
newsgroup) developers upgrading from VB6 to VBNet 2005. With option strict
on the code would have been only a bunch of errors.

In fact there is in that upgrade than nothing changed in the way the binding
is handled. It is late binding. It runs than still at a speed not comparable
with C# but more like VB6.

VBNet with option Strict on runs at the same speed as C#

Cor

"RMT" <no****@nospam.com> schreef in bericht
news:e6*******************@news.demon.co.uk...
I'm not sure but also it should be "on" by default - when you create a new
project and it should also be difficult to find to switch it off. In
fact, with casting (DirectCast, CType), I can't see ANY reason for making
it optional at all. Only one case I can think of where I needed to switch
it off and that was a workaround for some Interop stuff. I managed to
find a better workaround that didn't require "off" later on.

It's just plain laziness that leads people to code like this.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eH**************@TK2MSFTNGP02.phx.gbl...
Guy,

How did you know that Jon Vaughan would sent a message about 25 minutes
after you for which this message can maybe something he has to overthink.

You are completely right in my opinion. Option strict off should only be
used in cases where there is some modeling or testing to be done.

Cor

"guy" <gu*@discussions.microsoft.com> schreef in bericht
news:3C**********************************@microsof t.com...
when i first started using .net (beta 1) i came across option strict and
thought hey this could be really good, and since then have always turned
it
on, most people here seem to agree that this is a good thing.

i have now been asked to debug a vb2005 web app for 3 weeks and there is
no
mention of option strict in it, (there are also no classes defined, just
a
couple of structures) everything is define as 'as object', data coming
back
from a database call is 'Object' with a string appended to make it a
valid
string ...

trying to debug this nightmare is worse than i could possibly imagine

so if you ever are tempted to turn option strict off please consider
suicide
first!



Jun 13 '06 #4
"RMT" <no****@nospam.com> escribió en el mensaje
news:e6*******************@news.demon.co.uk...
Only one case I can think of where I needed to switch it off and that was
a workaround for some Interop stuff. I managed to find a better
workaround that didn't require "off" later on.


Yep, even late binding can be done with Option Strict On using Reflection
instead.

Currently Option Strict can be set only at project or file level. It is a
pity that it can not be set at "code region" level...

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

Jun 13 '06 #5
guy
yep, 40-50 errors per control - minimum

"Cor Ligthert [MVP]" wrote:
RMT,

It is just off by default because the expected (and probably is seeing this
newsgroup) developers upgrading from VB6 to VBNet 2005. With option strict
on the code would have been only a bunch of errors.

In fact there is in that upgrade than nothing changed in the way the binding
is handled. It is late binding. It runs than still at a speed not comparable
with C# but more like VB6.

VBNet with option Strict on runs at the same speed as C#

Cor

"RMT" <no****@nospam.com> schreef in bericht
news:e6*******************@news.demon.co.uk...
I'm not sure but also it should be "on" by default - when you create a new
project and it should also be difficult to find to switch it off. In
fact, with casting (DirectCast, CType), I can't see ANY reason for making
it optional at all. Only one case I can think of where I needed to switch
it off and that was a workaround for some Interop stuff. I managed to
find a better workaround that didn't require "off" later on.

It's just plain laziness that leads people to code like this.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eH**************@TK2MSFTNGP02.phx.gbl...
Guy,

How did you know that Jon Vaughan would sent a message about 25 minutes
after you for which this message can maybe something he has to overthink.

You are completely right in my opinion. Option strict off should only be
used in cases where there is some modeling or testing to be done.

Cor

"guy" <gu*@discussions.microsoft.com> schreef in bericht
news:3C**********************************@microsof t.com...
when i first started using .net (beta 1) i came across option strict and
thought hey this could be really good, and since then have always turned
it
on, most people here seem to agree that this is a good thing.

i have now been asked to debug a vb2005 web app for 3 weeks and there is
no
mention of option strict in it, (there are also no classes defined, just
a
couple of structures) everything is define as 'as object', data coming
back
from a database call is 'Object' with a string appended to make it a
valid
string ...

trying to debug this nightmare is worse than i could possibly imagine

so if you ever are tempted to turn option strict off please consider
suicide
first!



Jun 13 '06 #6
RMT
Ahh. Then this is a serious flaw in the conversion process. It's basically
encouraging anyone from a VB6 background to continue on with their dodgy
development ways.

"guy" <gu*@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
yep, 40-50 errors per control - minimum

"Cor Ligthert [MVP]" wrote:
RMT,

It is just off by default because the expected (and probably is seeing
this
newsgroup) developers upgrading from VB6 to VBNet 2005. With option
strict
on the code would have been only a bunch of errors.

In fact there is in that upgrade than nothing changed in the way the
binding
is handled. It is late binding. It runs than still at a speed not
comparable
with C# but more like VB6.

VBNet with option Strict on runs at the same speed as C#

Cor

"RMT" <no****@nospam.com> schreef in bericht
news:e6*******************@news.demon.co.uk...
> I'm not sure but also it should be "on" by default - when you create a
> new
> project and it should also be difficult to find to switch it off. In
> fact, with casting (DirectCast, CType), I can't see ANY reason for
> making
> it optional at all. Only one case I can think of where I needed to
> switch
> it off and that was a workaround for some Interop stuff. I managed to
> find a better workaround that didn't require "off" later on.
>
> It's just plain laziness that leads people to code like this.
>
>
> "Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
> news:eH**************@TK2MSFTNGP02.phx.gbl...
>> Guy,
>>
>> How did you know that Jon Vaughan would sent a message about 25
>> minutes
>> after you for which this message can maybe something he has to
>> overthink.
>>
>> You are completely right in my opinion. Option strict off should only
>> be
>> used in cases where there is some modeling or testing to be done.
>>
>> Cor
>>
>> "guy" <gu*@discussions.microsoft.com> schreef in bericht
>> news:3C**********************************@microsof t.com...
>>> when i first started using .net (beta 1) i came across option strict
>>> and
>>> thought hey this could be really good, and since then have always
>>> turned
>>> it
>>> on, most people here seem to agree that this is a good thing.
>>>
>>> i have now been asked to debug a vb2005 web app for 3 weeks and there
>>> is
>>> no
>>> mention of option strict in it, (there are also no classes defined,
>>> just
>>> a
>>> couple of structures) everything is define as 'as object', data
>>> coming
>>> back
>>> from a database call is 'Object' with a string appended to make it a
>>> valid
>>> string ...
>>>
>>> trying to debug this nightmare is worse than i could possibly imagine
>>>
>>> so if you ever are tempted to turn option strict off please consider
>>> suicide
>>> first!
>>
>>
>
>


Jun 13 '06 #7
guy
definitely.
maybe the problem is that currently you don not need to know of the
existence of option strict to start using vb.net
at least if it was on by default vb6 developers would have to turn it off,
and learn the implications of doing so

"RMT" wrote:
Ahh. Then this is a serious flaw in the conversion process. It's basically
encouraging anyone from a VB6 background to continue on with their dodgy
development ways.

"guy" <gu*@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
yep, 40-50 errors per control - minimum

"Cor Ligthert [MVP]" wrote:
RMT,

It is just off by default because the expected (and probably is seeing
this
newsgroup) developers upgrading from VB6 to VBNet 2005. With option
strict
on the code would have been only a bunch of errors.

In fact there is in that upgrade than nothing changed in the way the
binding
is handled. It is late binding. It runs than still at a speed not
comparable
with C# but more like VB6.

VBNet with option Strict on runs at the same speed as C#

Cor

"RMT" <no****@nospam.com> schreef in bericht
news:e6*******************@news.demon.co.uk...
> I'm not sure but also it should be "on" by default - when you create a
> new
> project and it should also be difficult to find to switch it off. In
> fact, with casting (DirectCast, CType), I can't see ANY reason for
> making
> it optional at all. Only one case I can think of where I needed to
> switch
> it off and that was a workaround for some Interop stuff. I managed to
> find a better workaround that didn't require "off" later on.
>
> It's just plain laziness that leads people to code like this.
>
>
> "Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
> news:eH**************@TK2MSFTNGP02.phx.gbl...
>> Guy,
>>
>> How did you know that Jon Vaughan would sent a message about 25
>> minutes
>> after you for which this message can maybe something he has to
>> overthink.
>>
>> You are completely right in my opinion. Option strict off should only
>> be
>> used in cases where there is some modeling or testing to be done.
>>
>> Cor
>>
>> "guy" <gu*@discussions.microsoft.com> schreef in bericht
>> news:3C**********************************@microsof t.com...
>>> when i first started using .net (beta 1) i came across option strict
>>> and
>>> thought hey this could be really good, and since then have always
>>> turned
>>> it
>>> on, most people here seem to agree that this is a good thing.
>>>
>>> i have now been asked to debug a vb2005 web app for 3 weeks and there
>>> is
>>> no
>>> mention of option strict in it, (there are also no classes defined,
>>> just
>>> a
>>> couple of structures) everything is define as 'as object', data
>>> coming
>>> back
>>> from a database call is 'Object' with a string appended to make it a
>>> valid
>>> string ...
>>>
>>> trying to debug this nightmare is worse than i could possibly imagine
>>>
>>> so if you ever are tempted to turn option strict off please consider
>>> suicide
>>> first!
>>
>>
>
>


Jun 13 '06 #8

"RMT" <no****@nospam.com> wrote in message
news:e6*******************@news.demon.co.uk...
Ahh. Then this is a serious flaw in the conversion process. It's
basically encouraging anyone from a VB6 background to continue on with
their dodgy development ways.

Fairly bold statements, considering the ~known~ history of VB. If you had
any experience in the former product you'd understand that there can't
possibly be a reliable conversion process, especially with regard to Option
Strict (since the option didn't exist in VB6). Given the options available
in VB6, what would you have recommended a programmer do to prevent the
upgrade errors (remembering that the programmer had to work within the
current technologies at that time and that he had no knowledge that VB would
be completely re-written as a new language in the future)?
It's just plain laziness that leads people to code like this.
Do you honestly believe that "laziness" is a reason to turn off Option
Strict? Ignorance, perhaps, but not laziness.

"guy" <gu*@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
yep, 40-50 errors per control - minimum

"Cor Ligthert [MVP]" wrote:
RMT,

It is just off by default because the expected (and probably is seeing
this
newsgroup) developers upgrading from VB6 to VBNet 2005. With option
strict
on the code would have been only a bunch of errors.

In fact there is in that upgrade than nothing changed in the way the
binding
is handled. It is late binding. It runs than still at a speed not
comparable
with C# but more like VB6.

VBNet with option Strict on runs at the same speed as C#

Cor

"RMT" <no****@nospam.com> schreef in bericht
news:e6*******************@news.demon.co.uk...
> I'm not sure but also it should be "on" by default - when you create a
> new
> project and it should also be difficult to find to switch it off. In
> fact, with casting (DirectCast, CType), I can't see ANY reason for
> making
> it optional at all. Only one case I can think of where I needed to
> switch
> it off and that was a workaround for some Interop stuff. I managed to
> find a better workaround that didn't require "off" later on.
>
> It's just plain laziness that leads people to code like this.
>
>
> "Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
> news:eH**************@TK2MSFTNGP02.phx.gbl...
>> Guy,
>>
>> How did you know that Jon Vaughan would sent a message about 25
>> minutes
>> after you for which this message can maybe something he has to
>> overthink.
>>
>> You are completely right in my opinion. Option strict off should only
>> be
>> used in cases where there is some modeling or testing to be done.
>>
>> Cor
>>
>> "guy" <gu*@discussions.microsoft.com> schreef in bericht
>> news:3C**********************************@microsof t.com...
>>> when i first started using .net (beta 1) i came across option strict
>>> and
>>> thought hey this could be really good, and since then have always
>>> turned
>>> it
>>> on, most people here seem to agree that this is a good thing.
>>>
>>> i have now been asked to debug a vb2005 web app for 3 weeks and
>>> there is
>>> no
>>> mention of option strict in it, (there are also no classes defined,
>>> just
>>> a
>>> couple of structures) everything is define as 'as object', data
>>> coming
>>> back
>>> from a database call is 'Object' with a string appended to make it
>>> a
>>> valid
>>> string ...
>>>
>>> trying to debug this nightmare is worse than i could possibly
>>> imagine
>>>
>>> so if you ever are tempted to turn option strict off please consider
>>> suicide
>>> first!
>>
>>
>
>


Jun 13 '06 #9
guy
i may be wrong but i read 'conversion' in RMTs comment to mean converting the
developer (retraining) rather than converting the code:)

the app i am working on is not a conversion, it started life as vb2005

"msnews" wrote:

"RMT" <no****@nospam.com> wrote in message
news:e6*******************@news.demon.co.uk...
Ahh. Then this is a serious flaw in the conversion process. It's
basically encouraging anyone from a VB6 background to continue on with
their dodgy development ways.


Fairly bold statements, considering the ~known~ history of VB. If you had
any experience in the former product you'd understand that there can't
possibly be a reliable conversion process, especially with regard to Option
Strict (since the option didn't exist in VB6). Given the options available
in VB6, what would you have recommended a programmer do to prevent the
upgrade errors (remembering that the programmer had to work within the
current technologies at that time and that he had no knowledge that VB would
be completely re-written as a new language in the future)?
It's just plain laziness that leads people to code like this.


Do you honestly believe that "laziness" is a reason to turn off Option
Strict? Ignorance, perhaps, but not laziness.

"guy" <gu*@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
yep, 40-50 errors per control - minimum

"Cor Ligthert [MVP]" wrote:

RMT,

It is just off by default because the expected (and probably is seeing
this
newsgroup) developers upgrading from VB6 to VBNet 2005. With option
strict
on the code would have been only a bunch of errors.

In fact there is in that upgrade than nothing changed in the way the
binding
is handled. It is late binding. It runs than still at a speed not
comparable
with C# but more like VB6.

VBNet with option Strict on runs at the same speed as C#

Cor

"RMT" <no****@nospam.com> schreef in bericht
news:e6*******************@news.demon.co.uk...
> I'm not sure but also it should be "on" by default - when you create a
> new
> project and it should also be difficult to find to switch it off. In
> fact, with casting (DirectCast, CType), I can't see ANY reason for
> making
> it optional at all. Only one case I can think of where I needed to
> switch
> it off and that was a workaround for some Interop stuff. I managed to
> find a better workaround that didn't require "off" later on.
>
> It's just plain laziness that leads people to code like this.
>
>
> "Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
> news:eH**************@TK2MSFTNGP02.phx.gbl...
>> Guy,
>>
>> How did you know that Jon Vaughan would sent a message about 25
>> minutes
>> after you for which this message can maybe something he has to
>> overthink.
>>
>> You are completely right in my opinion. Option strict off should only
>> be
>> used in cases where there is some modeling or testing to be done.
>>
>> Cor
>>
>> "guy" <gu*@discussions.microsoft.com> schreef in bericht
>> news:3C**********************************@microsof t.com...
>>> when i first started using .net (beta 1) i came across option strict
>>> and
>>> thought hey this could be really good, and since then have always
>>> turned
>>> it
>>> on, most people here seem to agree that this is a good thing.
>>>
>>> i have now been asked to debug a vb2005 web app for 3 weeks and
>>> there is
>>> no
>>> mention of option strict in it, (there are also no classes defined,
>>> just
>>> a
>>> couple of structures) everything is define as 'as object', data
>>> coming
>>> back
>>> from a database call is 'Object' with a string appended to make it
>>> a
>>> valid
>>> string ...
>>>
>>> trying to debug this nightmare is worse than i could possibly
>>> imagine
>>>
>>> so if you ever are tempted to turn option strict off please consider
>>> suicide
>>> first!
>>
>>
>
>



Jun 13 '06 #10
RMT
Fairly bold statements, considering the ~known~ history of VB. If you had
any experience in the former product you'd understand that there can't
possibly be a reliable conversion process, especially with regard to
Option Strict (since the option didn't exist in VB6).
Personally, I think the possibility to upgrade is more of a spec-sheet
feature than something that is actually useful. I cannot see the advantage
of potentially seriously broken code in .NET from developers that may have
been comfortably able to manage it in VB6. What need is there to upgrade,
rather than start over? Medium term, bad VB.NET code or VB 6 code is bad
code period and more costly to maintain and develop. The mapping from VB 6
to .NET is not a natural one.

From my experience, if the plumbing is the most important thing, you can
rapidly re-write this in .NET. If the algorithms are important, then you
can copy/paste and modify those quite easily, within your new and correct
..NET class structure. In effect, I see the upgrade wizard as being for lazy
programmers or managers who don't really understand the difference between
the two paradigms. It was a Microsoft marketing move to gain some
acceptance for .NET from the existing VB 6 base, rather than a useful
technical challenge. Moreover, if you want your VB 6 programmers to become
competent .NET programmers, it is better for them to develop from the ground
up, rather than suddenly being presented with potentially bad coding
practice via. the results of any wizard, which of course will be only the
start of their problems.

Do you honestly believe that "laziness" is a reason to turn off Option
Strict? Ignorance, perhaps, but not laziness.

Well quite frankly often, yes.


"guy" <gu*@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
yep, 40-50 errors per control - minimum

"Cor Ligthert [MVP]" wrote:

RMT,

It is just off by default because the expected (and probably is seeing
this
newsgroup) developers upgrading from VB6 to VBNet 2005. With option
strict
on the code would have been only a bunch of errors.

In fact there is in that upgrade than nothing changed in the way the
binding
is handled. It is late binding. It runs than still at a speed not
comparable
with C# but more like VB6.

VBNet with option Strict on runs at the same speed as C#

Cor

"RMT" <no****@nospam.com> schreef in bericht
news:e6*******************@news.demon.co.uk...
> I'm not sure but also it should be "on" by default - when you create
> a new
> project and it should also be difficult to find to switch it off. In
> fact, with casting (DirectCast, CType), I can't see ANY reason for
> making
> it optional at all. Only one case I can think of where I needed to
> switch
> it off and that was a workaround for some Interop stuff. I managed
> to
> find a better workaround that didn't require "off" later on.
>
> It's just plain laziness that leads people to code like this.
>
>
> "Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
> news:eH**************@TK2MSFTNGP02.phx.gbl...
>> Guy,
>>
>> How did you know that Jon Vaughan would sent a message about 25
>> minutes
>> after you for which this message can maybe something he has to
>> overthink.
>>
>> You are completely right in my opinion. Option strict off should
>> only be
>> used in cases where there is some modeling or testing to be done.
>>
>> Cor
>>
>> "guy" <gu*@discussions.microsoft.com> schreef in bericht
>> news:3C**********************************@microsof t.com...
>>> when i first started using .net (beta 1) i came across option
>>> strict and
>>> thought hey this could be really good, and since then have always
>>> turned
>>> it
>>> on, most people here seem to agree that this is a good thing.
>>>
>>> i have now been asked to debug a vb2005 web app for 3 weeks and
>>> there is
>>> no
>>> mention of option strict in it, (there are also no classes defined,
>>> just
>>> a
>>> couple of structures) everything is define as 'as object', data
>>> coming
>>> back
>>> from a database call is 'Object' with a string appended to make it
>>> a
>>> valid
>>> string ...
>>>
>>> trying to debug this nightmare is worse than i could possibly
>>> imagine
>>>
>>> so if you ever are tempted to turn option strict off please
>>> consider
>>> suicide
>>> first!
>>
>>
>
>



Jun 13 '06 #11
As a VB 6 developer who has also developed in other strictly typed
languages, the very first thing I did after installing VS 2005 was to go
into the VB settings in the IDE and turn Explicit and Strict On for all all
new files. I also explicitely code them at the start of each file. The
conversion pain is minor compared to having the compiler do a lot of the
type checking grunt work for me.

The should both be on by default when the install is completed!

Mike Ober.

"guy" <gu*@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
when i first started using .net (beta 1) i came across option strict and
thought hey this could be really good, and since then have always turned it on, most people here seem to agree that this is a good thing.

i have now been asked to debug a vb2005 web app for 3 weeks and there is no mention of option strict in it, (there are also no classes defined, just a
couple of structures) everything is define as 'as object', data coming back from a database call is 'Object' with a string appended to make it a valid string ...

trying to debug this nightmare is worse than i could possibly imagine

so if you ever are tempted to turn option strict off please consider suicide first!


Jun 14 '06 #12
I use the upgrade wizard for code snippets, not for entire files or
projects. It's actually useful for upgrading business logic - but that's
about all it's useful for.

Mike Ober.

"RMT" <no****@nospam.com> wrote in message
news:e6*******************@news.demon.co.uk...
Fairly bold statements, considering the ~known~ history of VB. If you had any experience in the former product you'd understand that there can't
possibly be a reliable conversion process, especially with regard to
Option Strict (since the option didn't exist in VB6).
Personally, I think the possibility to upgrade is more of a spec-sheet
feature than something that is actually useful. I cannot see the

advantage of potentially seriously broken code in .NET from developers that may have
been comfortably able to manage it in VB6. What need is there to upgrade,
rather than start over? Medium term, bad VB.NET code or VB 6 code is bad
code period and more costly to maintain and develop. The mapping from VB 6 to .NET is not a natural one.

From my experience, if the plumbing is the most important thing, you can
rapidly re-write this in .NET. If the algorithms are important, then you
can copy/paste and modify those quite easily, within your new and correct
.NET class structure. In effect, I see the upgrade wizard as being for lazy programmers or managers who don't really understand the difference between
the two paradigms. It was a Microsoft marketing move to gain some
acceptance for .NET from the existing VB 6 base, rather than a useful
technical challenge. Moreover, if you want your VB 6 programmers to become competent .NET programmers, it is better for them to develop from the ground up, rather than suddenly being presented with potentially bad coding
practice via. the results of any wizard, which of course will be only the
start of their problems.

Do you honestly believe that "laziness" is a reason to turn off Option Strict? Ignorance, perhaps, but not laziness.


Well quite frankly often, yes.


"guy" <gu*@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com...
yep, 40-50 errors per control - minimum

"Cor Ligthert [MVP]" wrote:

> RMT,
>
> It is just off by default because the expected (and probably is seeing> this
> newsgroup) developers upgrading from VB6 to VBNet 2005. With option
> strict
> on the code would have been only a bunch of errors.
>
> In fact there is in that upgrade than nothing changed in the way the
> binding
> is handled. It is late binding. It runs than still at a speed not
> comparable
> with C# but more like VB6.
>
> VBNet with option Strict on runs at the same speed as C#
>
> Cor
>
> "RMT" <no****@nospam.com> schreef in bericht
> news:e6*******************@news.demon.co.uk...
> > I'm not sure but also it should be "on" by default - when you create> > a new
> > project and it should also be difficult to find to switch it off. In> > fact, with casting (DirectCast, CType), I can't see ANY reason for
> > making
> > it optional at all. Only one case I can think of where I needed to
> > switch
> > it off and that was a workaround for some Interop stuff. I managed
> > to
> > find a better workaround that didn't require "off" later on.
> >
> > It's just plain laziness that leads people to code like this.
> >
> >
> > "Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
> > news:eH**************@TK2MSFTNGP02.phx.gbl...
> >> Guy,
> >>
> >> How did you know that Jon Vaughan would sent a message about 25
> >> minutes
> >> after you for which this message can maybe something he has to
> >> overthink.
> >>
> >> You are completely right in my opinion. Option strict off should
> >> only be
> >> used in cases where there is some modeling or testing to be done.
> >>
> >> Cor
> >>
> >> "guy" <gu*@discussions.microsoft.com> schreef in bericht
> >> news:3C**********************************@microsof t.com...
> >>> when i first started using .net (beta 1) i came across option
> >>> strict and
> >>> thought hey this could be really good, and since then have always
> >>> turned
> >>> it
> >>> on, most people here seem to agree that this is a good thing.
> >>>
> >>> i have now been asked to debug a vb2005 web app for 3 weeks and
> >>> there is
> >>> no
> >>> mention of option strict in it, (there are also no classes defined,> >>> just
> >>> a
> >>> couple of structures) everything is define as 'as object', data
> >>> coming
> >>> back
> >>> from a database call is 'Object' with a string appended to make it> >>> a
> >>> valid
> >>> string ...
> >>>
> >>> trying to debug this nightmare is worse than i could possibly
> >>> imagine
> >>>
> >>> so if you ever are tempted to turn option strict off please
> >>> consider
> >>> suicide
> >>> first!
> >>
> >>
> >
> >
>
>
>




Jun 14 '06 #13
Cor,
| You are completely right in my opinion. Option strict off should only be
| used in cases where there is some modeling or testing to be done.
Option Strict Off is also very useful for COM interop with "untyped" objects
such as CDO 1.2.1

I normally limit any Option Strict Off modules to the smallest Class (or
Partial Class) that I can.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:eH**************@TK2MSFTNGP02.phx.gbl...
| Guy,
|
How did you know that Jon Vaughan would sent a message about 25 minutes
| after you for which this message can maybe something he has to overthink.
|
| You are completely right in my opinion. Option strict off should only be
| used in cases where there is some modeling or testing to be done.
|
| Cor
|
| "guy" <gu*@discussions.microsoft.com> schreef in bericht
| news:3C**********************************@microsof t.com...
| > when i first started using .net (beta 1) i came across option strict and
| > thought hey this could be really good, and since then have always turned
| > it
| > on, most people here seem to agree that this is a good thing.
| >
| > i have now been asked to debug a vb2005 web app for 3 weeks and there is
| > no
| > mention of option strict in it, (there are also no classes defined, just
a
| > couple of structures) everything is define as 'as object', data coming
| > back
| > from a database call is 'Object' with a string appended to make it a
| > valid
| > string ...
| >
| > trying to debug this nightmare is worse than i could possibly imagine
| >
| > so if you ever are tempted to turn option strict off please consider
| > suicide
| > first!
|
|
Jun 14 '06 #14
Carlos,
As I responded to Cor:

I use partial classes when I need "code level" Option Strict Off.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Carlos J. Quintero [VB MVP]" <ca*****@NOSPAMsogecable.com> wrote in message
news:uS**************@TK2MSFTNGP03.phx.gbl...
| "RMT" <no****@nospam.com> escribió en el mensaje
| news:e6*******************@news.demon.co.uk...
| > Only one case I can think of where I needed to switch it off and that
was
| > a workaround for some Interop stuff. I managed to find a better
| > workaround that didn't require "off" later on.
|
| Yep, even late binding can be done with Option Strict On using Reflection
| instead.
|
| Currently Option Strict can be set only at project or file level. It is a
| pity that it can not be set at "code region" level...
|
| --
|
| Best regards,
|
| Carlos J. Quintero
|
| MZ-Tools: Productivity add-ins for Visual Studio
| You can code, design and document much faster:
| http://www.mztools.com
|
|
|
|
|
Jun 14 '06 #15
Jay,

I was trying yesterday to give the same answer.

But because it was Carlos who had stated the reply I have tried it first.

It did not work.

I will not show you what dump syntax error I made which had nothing to do
with Option Strict off..

I tested it again and it does as I though it should do. (Because I know that
you don't have it in your options and I have, I was first looking in that
direction).

Thanks for replying because I got now the idea it would not go.

Cor

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> schreef in
bericht news:On**************@TK2MSFTNGP02.phx.gbl...
Carlos,
As I responded to Cor:

I use partial classes when I need "code level" Option Strict Off.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Carlos J. Quintero [VB MVP]" <ca*****@NOSPAMsogecable.com> wrote in
message
news:uS**************@TK2MSFTNGP03.phx.gbl...
| "RMT" <no****@nospam.com> escribió en el mensaje
| news:e6*******************@news.demon.co.uk...
| > Only one case I can think of where I needed to switch it off and that
was
| > a workaround for some Interop stuff. I managed to find a better
| > workaround that didn't require "off" later on.
|
| Yep, even late binding can be done with Option Strict On using
Reflection
| instead.
|
| Currently Option Strict can be set only at project or file level. It is
a
| pity that it can not be set at "code region" level...
|
| --
|
| Best regards,
|
| Carlos J. Quintero
|
| MZ-Tools: Productivity add-ins for Visual Studio
| You can code, design and document much faster:
| http://www.mztools.com
|
|
|
|
|

Jun 15 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Microsoft News | last post by:
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...
11
by: Daylor | last post by:
hi. im using option strict on. im doing in ,from the simple reason ,to be warn when there are implict conversion like string to int ,int to string. BUT. the price ,(now i see ), is very bad....
8
by: Rich | last post by:
Hello, If I leave Option Strict Off I can use the following syntax to read data from a Lotus Notes application (a NotesViewEntry object represents a row of data from a Lotus Notes View - like a...
17
by: David | last post by:
Hi all, I have the following problem: my program works fine, but when I add option strict at the top of the form, the following sub fails with an error that option strict does not allow late...
13
by: C. Moya | last post by:
I fully expected the lack of a way to set Option Strict globally to be fixed in SP1. I can't seem to figure out if it has been fixed or not. It still seems we have to add the declaration at the top...
1
by: Jerad Rose | last post by:
I believe this issue is specific to ASP.NET. Why does VB.NET (2.0) ignore the project-level setting for Option Strict? I have the setting turned on in web.config: <compilation debug="true"...
18
by: Poldie | last post by:
How do I turn it on? I'm using vb 2005 in visual studio 2005 sp1. In my web.config I have: <compilation debug="true" strict="true" /> In my Tools/Options/Projects and solutions/vb defaults...
8
by: Rory Becker | last post by:
A wise man once said: "Never put off until runtime what you can fix at compile time." Actually I think he said it about 10 minutes before I started this post. I am a firm believer, like the...
8
by: =?Utf-8?B?R3JlZw==?= | last post by:
We have an application in our office that has the Option Strict option set to off right now. I do understand it should be set to ON, but right now, I'm just going to continue with it this way since...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.