|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RANT: option strict etcwhen 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! 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 Show quoteHide quote "guy" <g**@discussions.microsoft.com> schreef in bericht news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! 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. Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht > news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! > > 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 Show quoteHide quote "RMT" <nospam@nospam.com> schreef in bericht news:e6m3ds$53f$1$8302bc10@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]" <notmyfirstn***@planet.nl> wrote in message > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! >> >> > > yep, 40-50 errors per control - minimum
Show quoteHide quote "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@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]" <notmyfirstn***@planet.nl> wrote in message > > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht > >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! > >> > >> > > > > > > > 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. Show quoteHide quote "guy" <g**@discussions.microsoft.com> wrote in message news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@microsoft.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" <nospam@nospam.com> schreef in bericht >> news:e6m3ds$53f$1$8302bc10@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]" <notmyfirstn***@planet.nl> wrote in message >> > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht >> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! >> >> >> >> >> > >> > >> >> >> 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 Show quoteHide quote "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" <g**@discussions.microsoft.com> wrote in message > news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@microsoft.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" <nospam@nospam.com> schreef in bericht > >> news:e6m3ds$53f$1$8302bc10@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]" <notmyfirstn***@planet.nl> wrote in message > >> > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht > >> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! > >> >> > >> >> > >> > > >> > > >> > >> > >> > > > "RMT" <nospam@nospam.com> wrote in message Fairly bold statements, considering the ~known~ history of VB. If you had news:e6m79k$pmc$1$8300dec7@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. > 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. Show quoteHide quote > "guy" <g**@discussions.microsoft.com> wrote in message > news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@microsoft.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" <nospam@nospam.com> schreef in bericht >>> news:e6m3ds$53f$1$8302bc10@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]" <notmyfirstn***@planet.nl> wrote in message >>> > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht >>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! >>> >> >>> >> >>> > >>> > >>> >>> >>> > > 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 Show quoteHide quote "msnews" wrote: > > "RMT" <nospam@nospam.com> wrote in message > news:e6m79k$pmc$1$8300dec7@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" <g**@discussions.microsoft.com> wrote in message > > news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@microsoft.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" <nospam@nospam.com> schreef in bericht > >>> news:e6m3ds$53f$1$8302bc10@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]" <notmyfirstn***@planet.nl> wrote in message > >>> > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht > >>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! > >>> >> > >>> >> > >>> > > >>> > > >>> > >>> > >>> > > > > > > > > Fairly bold statements, considering the ~known~ history of VB. If you had Personally, I think the possibility to upgrade is more of a spec-sheet > 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). 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. > Well quite frankly often, yes.> Do you honestly believe that "laziness" is a reason to turn off Option > Strict? Ignorance, perhaps, but not laziness. > Show quoteHide quote > > > >> "guy" <g**@discussions.microsoft.com> wrote in message >> news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@microsoft.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" <nospam@nospam.com> schreef in bericht >>>> news:e6m3ds$53f$1$8302bc10@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]" <notmyfirstn***@planet.nl> wrote in message >>>> > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht >>>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! >>>> >> >>>> >> >>>> > >>>> > >>>> >>>> >>>> >> >> > > 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. Show quoteHide quote "RMT" <nospam@nospam.com> wrote in message news:e6mcqi$ftj$1$8302bc10@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" <g**@discussions.microsoft.com> wrote in message > >> news:C68202BB-5CDB-4EC4-9B5F-DF2C47DE2F59@microsoft.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" <nospam@nospam.com> schreef in bericht > >>>> news:e6m3ds$53f$1$8302bc10@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]" <notmyfirstn***@planet.nl> wrote in message > >>>> > news:eH2Z28sjGHA.1208@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" <g**@discussions.microsoft.com> schreef in bericht > >>>> >> news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! > >>>> >> > >>>> >> > >>>> > > >>>> > > >>>> > >>>> > >>>> > >> > >> > > > > > > "RMT" <nospam@nospam.com> escribió en el mensaje Yep, even late binding can be done with Option Strict On using Reflection news:e6m3ds$53f$1$8302bc10@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. 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 Carlos,
As I responded to Cor: I use partial classes when I need "code level" Option Strict Off. -- Show quoteHide quoteHope 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@NOSPAMsogecable.com> wrote in message news:uSjnsXtjGHA.4884@TK2MSFTNGP03.phx.gbl... | "RMT" <nospam@nospam.com> escribió en el mensaje | news:e6m3ds$53f$1$8302bc10@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 | | | | | 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 Show quoteHide quote "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> schreef in bericht news:OnKh0hAkGHA.5020@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]" <carlosq@NOSPAMsogecable.com> wrote in > message > news:uSjnsXtjGHA.4884@TK2MSFTNGP03.phx.gbl... > | "RMT" <nospam@nospam.com> escribió en el mensaje > | news:e6m3ds$53f$1$8302bc10@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 > | > | > | > | > | > > Cor,
| You are completely right in my opinion. Option strict off should only be Option Strict Off is also very useful for COM interop with "untyped" objects | used in cases where there is some modeling or testing to be done. 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]" <notmyfirstn***@planet.nl> wrote in message How did you know that Jon Vaughan would sent a message about 25 minutesnews:eH2Z28sjGHA.1208@TK2MSFTNGP02.phx.gbl... | Guy, | Show quoteHide quote | 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" <g**@discussions.microsoft.com> schreef in bericht | news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! | | 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. Show quoteHide quote "guy" <g**@discussions.microsoft.com> wrote in message news:3CA25A15-0897-4AD1-B9B2-65D297F69DF2@microsoft.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! >
Handling DBNull from databases
Function Vs. Sub Procedure Final Post of the day Loopin trough colors Linking childform to Main Form in VB6 getting screen coordinates for positioning a floating control next to a tableLayOutPanel embeded con Tokenizing Emulating keyboard strokes in vb.net Refer to sheet2 - even when named A Question About Regular Expressions and Capture |
|||||||||||||||||||||||