Answer the question
In order to leave comments, you need to log in
What is better to use when there is no difference in technical terms - static methods or class instances?
Good afternoon.
We are talking about, for example, models that contain only self-sufficient functions that do not contact each other in any way, or libraries of functions. Create a new instance before calling, or just make all methods static - wouldn't the latter be faster and better? In architectural terms, there is no difference, because. the two approaches are interchangeable in this case .
Thanks in advance for your advice!
Answer the question
In order to leave comments, you need to log in
In architectural terms, there is no difference, because. the two approaches are interchangeable in this case.
Read (don't skim, just read) Martin's Clean Code, McConnell's Perfect Code, Gang of Four Design Patterns.
Then you stop asking such dubious questions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question