I
think it was someone on UA years ago who convinced me there was little use in declaring VBA numeric variables as anything other than Long.
I switched to that and have never regretted it.
This article explains one possible reason why one might do so:
https://stackoverflow.com/questions/26717148/integer-vs-long-confusion
The article makes a good point that, despite how it is saved in memory, it is still type checked as the declared type.
But what good does that do when comparing the numeric types?
Is the Compiler going to actually tell me I've declared a variable as Byte and assigned it 999999 ? No! It does not do that at all. The compiler is not that cool. Am I going to get any different behavior from Intellisense? I doubt it, not anything I've ever noticed.
So why use Byte?
So why did I switch to Long for everything?
Well, some might call it "laziness" as Doc has done. But doesn't "laziness" fit into Ease of Use?
Part of development is efficiency. If I can't find a tangible benefit to differentiating them, and if the time it takes me to keep them all straight in my mind and sort through those differentiations mentally while developing IS a tangible benefit/burden, then I guess you can call me lazy, because I do do the occasional thing in development only because I see little benefit in memorizing the 8 ways to do it. That principle is something you can go crazy with and overdo (of course), but that doesn't make it totally without merit.
I love strong typing, I feel it engenders strong principles in otherwise lazy developers.
But as MajP says, everything in its place.
When you have to complete 12 huge SQL queries a week and test and return the results, you DO think about things like speed
I can't tell you how many times a month I type
Decimal(19,2) not because the precision and scale is perfect for the need, only because I know it will work and there is no good reason to take the time to do further research.