Answer the question
In order to leave comments, you need to log in
Is it worth adding constants to a class?
What do you think, is it right to make definitions of constants in a class if these constants are used only inside the class. Or is it considered bad programming style?
Example:
class SomeClass {
private readonly CONST_FOR_CLASS_ONLY = 'value of constant';
methodOfClass() {
// использование this.CONST_FOR_CLASS_ONLY
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question