Hi Jim, Well, there are a number of ways you can run into errors by not using an explicit variable declaration.Usually, caused by accidental typos and things like that.
For example, you are writing a Blackjack or Poker game. You have a variable called myCard. Of course, there are a lot of variations on that like MyCard, my_card, mycard, etc. If you are typing along and forget the exact way it was written earlier Visual Basic 6, Python, and various other languages won't flag the misspelled variable and will simply create a new variable on the stack. Not cool as this can lead to runtime errors. The other issue is simply memory leaks. If you use explicit variable declarations like integer, double, float, boolean, etc it sets aside a specified amount of memory for that specific variable. If you don't declare your variables you are waisting memory left and right. If every single developer did that a 3 GHZ system would run like a 300 MHZ system just because the computer would have to interpret every single variable, in every single program, and waiste CPU power and ram doing so. While not an error per say it is still a very nasty habit to get into because it will eventually result in a reduction in system performance. It is just not very good coding practice is what I'm telling you. HTH On 1/28/11, Jim Kitchen <[email protected]> wrote: > Hi Ken, > > The first thing that I did when I started writing in VB6 was to get rid of > the option explicit. I had never needed to declare variables in any Basic > before and I did not want to start. > > May I ask what you mean by you'll slip by with bad errors if you do not use > the option explicit? > > Thanks. > > BFN > > Jim > > Never test for an error you don't know how to handle. > > [email protected] > http://www.kitchensinc.net > (440) 286-6920 > Chardon Ohio USA > --- > Gamers mailing list __ [email protected] > If you want to leave the list, send E-mail to > [email protected]. > You can make changes or update your subscription via the web, at > http://audyssey.org/mailman/listinfo/gamers_audyssey.org. > All messages are archived and can be searched and read at > http://www.mail-archive.com/[email protected]. > If you have any questions or concerns regarding the management of the list, > please send E-mail to [email protected]. > --- Gamers mailing list __ [email protected] If you want to leave the list, send E-mail to [email protected]. You can make changes or update your subscription via the web, at http://audyssey.org/mailman/listinfo/gamers_audyssey.org. All messages are archived and can be searched and read at http://www.mail-archive.com/[email protected]. If you have any questions or concerns regarding the management of the list, please send E-mail to [email protected].
