And maybe.......thousands of hours wasted in the world because programmers can't find the code error, because they DIDN'T declare their variables !!
Peter
It does not take thousand of hours typing this information in.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>So question is: where is the line between simple and complex?
<o></o>So the question is: have we got the right balance?
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Here is my take on this subject, by the way this should be in the Lounge instead of Excel Questions.
1. You wrote the code
2. You understand it
3. You will maintain it
4. You will fix it when “broke”
5. It was written just for YOU
6. You could care less after you are gone
THE LINE_________________________________________THE LINE
1. You write the code in a more understandable way
2. As Norie stated, Option Explicit, Declarations, Variables, Comments, etc. all help long after it was written(years in some cases) to fix any problem or add to it
3. If writing code to help “others” the above is all good for their learning experience
4. Easily adapted once YOU are gone
<o></o>
<o></o>
That is a question that only YOU can answer. What do YOU want to do or achieve.
If I have work I need done, I prefer to hire someone that does it right every single time, no matter how simple the job is.
And by "Does it right" I mean, follows the same rules and procedures in place for their job. Every Time.
Take your car...
If you need some maintenance done (even a simple oil change).
do you take your car to Wal-Mart, where they find the quickest cheapest way to get the job done?
Or do you take it a mechanic you trust to do the job right every time?
I would rather spend the extra minute or so to declare my variable, then spend several minutes or hours chasing down a problem because I misspelled the variable.
Or Even worse, you didnt' realize you misspelled the variable and assumed the result of the code was correct, when it actually isn't.