tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,834
- Office Version
- 365
- 2019
- Platform
- Windows
When learning about classes, one is usually told that instead of declaring variables as Public, we should use Get, Let and Set Properties, which I agree.
As a result, I see no reason why you should write the following within a class:
because instead of passing SomeArg via the method, its value would be determined using the Let Property beforehand.
Furthermore, I think this would extend to standard modules, ie one could (and probably should) use Properties in a standard module too and do away with passing arguments to Subs.
What is the flaw with my reasoning, other than it takes a bit more work to set up the Properties?
Thanks
As a result, I see no reason why you should write the following within a class:
Code:
Sub SomeMethod (SomeArg As SomeDataType)
' do something
End Sub
because instead of passing SomeArg via the method, its value would be determined using the Let Property beforehand.
Furthermore, I think this would extend to standard modules, ie one could (and probably should) use Properties in a standard module too and do away with passing arguments to Subs.
What is the flaw with my reasoning, other than it takes a bit more work to set up the Properties?
Thanks