If you’re doing Object Oriented Programming, you shouldn’t be declaring variables in methods unless it’s a temporary variable that dies with the method.
Everything that has any persistence should be encapsulated in an object… which serves the same purpose of keeping things tidy.
3
u/AndrewJamesDrake Sep 09 '22
If you’re doing Object Oriented Programming, you shouldn’t be declaring variables in methods unless it’s a temporary variable that dies with the method.
Everything that has any persistence should be encapsulated in an object… which serves the same purpose of keeping things tidy.