A
A
Anton Shamanov2014-11-21 00:32:18
PHP
Anton Shamanov, 2014-11-21 00:32:18

Discussion of an article about the dangers of statics. How accurate are the statements?

The article can be found here: https://r.je/static-methods-bad-practice.html .
The article is very sensible and I would like to publish its translation, but some points are doubtful, for example:

Static methods make it impossible for your code to use powerful and vital OOP features: encapsulation, polymorphism and inheritance.

Why are the basic OOP principles not available in static classes?
To what extent is the content of the section "Why are they used?" relevant in your opinion for completely static classes (helpers)?
Section "So static is always bad?" also causes controversy because I usually try not to mix static and dynamic methods in one class, and the use of statics seems to me appropriate only in completely static helper classes.
Well, in general, I would like to hear comments and comments so that the resulting article is not a simple translation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iliyaisd, 2014-11-27
@iliyaisd

I guess what you mean is that static methods are for slightly different purposes, not related to the OOP approach in general. It's like nails and a microscope, only in reverse)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question