Answer the question
In order to leave comments, you need to log in
Is it necessary to dress all variables in the class with properties?
There is a class. It has many methods. Let's say there is a certain method that uses two class properties that are used in no other method. Let it, for example, return some result and operate on two variables.
Do these two variables need to be declared as class properties, or can they be left as dynamic variables? Or is it already a bad tone?
Answer the question
In order to leave comments, you need to log in
bad form is to create confusion where it could be dispensed with.
if variables are needed for local work, then there is no need to take them out anywhere.
properties take out data with which several methods work or external code
Some kind of porridge.
a specific method whose properties are not used in any other methodmethod properties?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question