RANT: option strict etc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • guy

    #1

    RANT: option strict etc

    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!
  • Cor Ligthert [MVP]

    #2
    Re: option strict etc

    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" <guy@discussion s.microsoft.com > schreef in bericht
    news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.com...[color=blue]
    > 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![/color]


    Comment

    • RMT

      #3
      Re: option strict etc

      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]" <notmyfirstname @planet.nl> wrote in message
      news:eH2Z28sjGH A.1208@TK2MSFTN GP02.phx.gbl...[color=blue]
      > 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" <guy@discussion s.microsoft.com > schreef in bericht
      > news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.com...[color=green]
      >> 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![/color]
      >
      >[/color]


      Comment

      • Cor Ligthert [MVP]

        #4
        Re: option strict etc

        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" <nospam@nospam. com> schreef in bericht
        news:e6m3ds$53f $1$8302bc10@new s.demon.co.uk.. .[color=blue]
        > 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]" <notmyfirstname @planet.nl> wrote in message
        > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.phx.gbl...[color=green]
        >> 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" <guy@discussion s.microsoft.com > schreef in bericht
        >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.com...[color=darkred]
        >>> 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![/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Carlos J. Quintero [VB MVP]

          #5
          Re: option strict etc

          "RMT" <nospam@nospam. com> escribió en el mensaje
          news:e6m3ds$53f $1$8302bc10@new s.demon.co.uk.. .[color=blue]
          > 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.[/color]

          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:
          MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.






          Comment

          • guy

            #6
            Re: option strict etc

            yep, 40-50 errors per control - minimum

            "Cor Ligthert [MVP]" wrote:
            [color=blue]
            > 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" <nospam@nospam. com> schreef in bericht
            > news:e6m3ds$53f $1$8302bc10@new s.demon.co.uk.. .[color=green]
            > > 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]" <notmyfirstname @planet.nl> wrote in message
            > > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.phx.gbl...[color=darkred]
            > >> 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" <guy@discussion s.microsoft.com > schreef in bericht
            > >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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!
            > >>
            > >>[/color]
            > >
            > >[/color]
            >
            >
            >[/color]

            Comment

            • RMT

              #7
              Re: option strict etc

              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" <guy@discussion s.microsoft.com > wrote in message
              news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@mi crosoft.com...[color=blue]
              > yep, 40-50 errors per control - minimum
              >
              > "Cor Ligthert [MVP]" wrote:
              >[color=green]
              >> 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" <nospam@nospam. com> schreef in bericht
              >> news:e6m3ds$53f $1$8302bc10@new s.demon.co.uk.. .[color=darkred]
              >> > 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]" <notmyfirstname @planet.nl> wrote in message
              >> > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.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" <guy@discussion s.microsoft.com > schreef in bericht
              >> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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!
              >> >>
              >> >>
              >> >
              >> >[/color]
              >>
              >>
              >>[/color][/color]


              Comment

              • guy

                #8
                Re: option strict etc

                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:
                [color=blue]
                > 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" <guy@discussion s.microsoft.com > wrote in message
                > news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@mi crosoft.com...[color=green]
                > > yep, 40-50 errors per control - minimum
                > >
                > > "Cor Ligthert [MVP]" wrote:
                > >[color=darkred]
                > >> 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" <nospam@nospam. com> schreef in bericht
                > >> news:e6m3ds$53f $1$8302bc10@new s.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]" <notmyfirstname @planet.nl> wrote in message
                > >> > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.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" <guy@discussion s.microsoft.com > schreef in bericht
                > >> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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!
                > >> >>
                > >> >>
                > >> >
                > >> >
                > >>
                > >>
                > >>[/color][/color]
                >
                >
                >[/color]

                Comment

                • msnews

                  #9
                  Re: option strict etc


                  "RMT" <nospam@nospam. com> wrote in message
                  news:e6m79k$pmc $1$8300dec7@new s.demon.co.uk.. .[color=blue]
                  > 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.
                  >[/color]

                  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)?
                  [color=blue]
                  >It's just plain laziness that leads people to code like this.[/color]

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



                  [color=blue]
                  > "guy" <guy@discussion s.microsoft.com > wrote in message
                  > news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@mi crosoft.com...[color=green]
                  >> yep, 40-50 errors per control - minimum
                  >>
                  >> "Cor Ligthert [MVP]" wrote:
                  >>[color=darkred]
                  >>> 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" <nospam@nospam. com> schreef in bericht
                  >>> news:e6m3ds$53f $1$8302bc10@new s.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]" <notmyfirstname @planet.nl> wrote in message
                  >>> > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.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" <guy@discussion s.microsoft.com > schreef in bericht
                  >>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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!
                  >>> >>
                  >>> >>
                  >>> >
                  >>> >
                  >>>
                  >>>
                  >>>[/color][/color]
                  >
                  >[/color]


                  Comment

                  • guy

                    #10
                    Re: option strict etc

                    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:
                    [color=blue]
                    >
                    > "RMT" <nospam@nospam. com> wrote in message
                    > news:e6m79k$pmc $1$8300dec7@new s.demon.co.uk.. .[color=green]
                    > > 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.
                    > >[/color]
                    >
                    > 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)?
                    >[color=green]
                    > >It's just plain laziness that leads people to code like this.[/color]
                    >
                    > Do you honestly believe that "laziness" is a reason to turn off Option
                    > Strict? Ignorance, perhaps, but not laziness.
                    >
                    >
                    >
                    >[color=green]
                    > > "guy" <guy@discussion s.microsoft.com > wrote in message
                    > > news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@mi crosoft.com...[color=darkred]
                    > >> 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" <nospam@nospam. com> schreef in bericht
                    > >>> news:e6m3ds$53f $1$8302bc10@new s.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]" <notmyfirstname @planet.nl> wrote in message
                    > >>> > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.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" <guy@discussion s.microsoft.com > schreef in bericht
                    > >>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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!
                    > >>> >>
                    > >>> >>
                    > >>> >
                    > >>> >
                    > >>>
                    > >>>
                    > >>>[/color]
                    > >
                    > >[/color]
                    >
                    >
                    >[/color]

                    Comment

                    • RMT

                      #11
                      Re: option strict etc

                      [color=blue]
                      > 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).[/color]

                      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.
                      [color=blue]
                      >
                      > Do you honestly believe that "laziness" is a reason to turn off Option
                      > Strict? Ignorance, perhaps, but not laziness.
                      >[/color]

                      Well quite frankly often, yes.
                      [color=blue]
                      >
                      >
                      >[color=green]
                      >> "guy" <guy@discussion s.microsoft.com > wrote in message
                      >> news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@mi crosoft.com...[color=darkred]
                      >>> 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" <nospam@nospam. com> schreef in bericht
                      >>>> news:e6m3ds$53f $1$8302bc10@new s.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]" <notmyfirstname @planet.nl> wrote in message
                      >>>> > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.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" <guy@discussion s.microsoft.com > schreef in bericht
                      >>>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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!
                      >>>> >>
                      >>>> >>
                      >>>> >
                      >>>> >
                      >>>>
                      >>>>
                      >>>>[/color]
                      >>
                      >>[/color]
                      >
                      >[/color]


                      Comment

                      • Michael D. Ober

                        #12
                        Re: option strict etc

                        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" <guy@discussion s.microsoft.com > wrote in message
                        news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.com...[color=blue]
                        > 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[/color]
                        it[color=blue]
                        > 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[/color]
                        no[color=blue]
                        > 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[/color]
                        back[color=blue]
                        > from a database call is 'Object' with a string appended to make it a[/color]
                        valid[color=blue]
                        > 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[/color]
                        suicide[color=blue]
                        > first!
                        >[/color]



                        Comment

                        • Michael D. Ober

                          #13
                          Re: option strict etc

                          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" <nospam@nospam. com> wrote in message
                          news:e6mcqi$ftj $1$8302bc10@new s.demon.co.uk.. .[color=blue]
                          >[color=green]
                          > > Fairly bold statements, considering the ~known~ history of VB. If you[/color][/color]
                          had[color=blue][color=green]
                          > > 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).[/color]
                          >
                          > Personally, I think the possibility to upgrade is more of a spec-sheet
                          > feature than something that is actually useful. I cannot see the[/color]
                          advantage[color=blue]
                          > 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[/color]
                          6[color=blue]
                          > 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[/color]
                          lazy[color=blue]
                          > 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[/color]
                          become[color=blue]
                          > competent .NET programmers, it is better for them to develop from the[/color]
                          ground[color=blue]
                          > 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.
                          >[color=green]
                          > >
                          > > Do you honestly believe that "laziness" is a reason to turn off Option[/color][/color]
                          [color=blue][color=green]
                          > > Strict? Ignorance, perhaps, but not laziness.
                          > >[/color]
                          >
                          > Well quite frankly often, yes.
                          >[color=green]
                          > >
                          > >
                          > >[color=darkred]
                          > >> "guy" <guy@discussion s.microsoft.com > wrote in message
                          > >> news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@mi crosoft.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[/color][/color][/color]
                          seeing[color=blue][color=green][color=darkred]
                          > >>>> 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" <nospam@nospam. com> schreef in bericht
                          > >>>> news:e6m3ds$53f $1$8302bc10@new s.demon.co.uk.. .
                          > >>>> > I'm not sure but also it should be "on" by default - when you[/color][/color][/color]
                          create[color=blue][color=green][color=darkred]
                          > >>>> > a new
                          > >>>> > project and it should also be difficult to find to switch it off.[/color][/color][/color]
                          In[color=blue][color=green][color=darkred]
                          > >>>> > 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]" <notmyfirstname @planet.nl> wrote in message
                          > >>>> > news:eH2Z28sjGH A.1208@TK2MSFTN GP02.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" <guy@discussion s.microsoft.com > schreef in bericht
                          > >>>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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[/color][/color][/color]
                          defined,[color=blue][color=green][color=darkred]
                          > >>>> >>> 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[/color][/color][/color]
                          it[color=blue][color=green][color=darkred]
                          > >>>> >>> 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!
                          > >>>> >>
                          > >>>> >>
                          > >>>> >
                          > >>>> >
                          > >>>>
                          > >>>>
                          > >>>>
                          > >>
                          > >>[/color]
                          > >
                          > >[/color]
                          >
                          >[/color]



                          Comment

                          • Jay B. Harlow [MVP - Outlook]

                            #14
                            Re: option strict etc

                            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]" <notmyfirstname @planet.nl> wrote in message
                            news:eH2Z28sjGH A.1208@TK2MSFTN GP02.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" <guy@discussion s.microsoft.com > schreef in bericht
                            | news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@mi crosoft.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!
                            |
                            |


                            Comment

                            • Jay B. Harlow [MVP - Outlook]

                              #15
                              Re: option strict etc

                              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]" <carlosq@NOSPAM sogecable.com> wrote in message
                              news:uSjnsXtjGH A.4884@TK2MSFTN GP03.phx.gbl...
                              | "RMT" <nospam@nospam. com> escribió en el mensaje
                              | news:e6m3ds$53f $1$8302bc10@new s.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
                              |
                              |
                              |
                              |
                              |


                              Comment

                              Working...