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

RANT: option strict etc

P: n/a
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
Share this Question
Share on Google+
15 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.