-
Notifications
You must be signed in to change notification settings - Fork 75
Application::t()
is too long
#4
Comments
Please note it's not static. |
Which is better to use |
The main point is "destatification" inside the framework core. While static methods can serve as good shortcuts for faster code composing, they encourage developers to rely on global application state, that is usually not a good thing. You don't like to use There are some posts [1], [2] that explain problem a bit wider. |
Do you plan to remove |
Not now. And only after having very good alternative(s). |
At the moment we are only trying to clean up the framework core. |
Excelent "destatification" helpers also. |
Hi guys! About the "destatification", as I was reading the pointed articles, I tended to discord of them. I think it could be just "over-engineering" to simple situations. When I got to the end of the article, many comments came with strong variated contrary arguments (like this). I think the "Yeah, it is" could be lost if Yii3 "dificult" some simple things. And helpers are this: simple things. They have no state. They dont change states. They are simple functions. It would be great to hear really "strong" arguments to remove (or substitute) static helpers, because I read the pointed articles and I could not find them (nor the most of the commenters). Hope to hear you here... thank you. |
@slinstj I think the problem is that Yii::t() is not pure function. Yii:t() behavior depends on settings. We can change the settings at any time and change the behavior. |
@slinstj
It is more "clean" because I'm trying to bring modern approaches and more "clean" OOP while keeping "Yes, it is" style and soul. P.S. |
See https://github.com/yiisoft/core/commit/c6e0e031d419881d1c02d4894155e94516da1a26
Application::t()
is too long thanYii::t()
.This method is often used. What aboutApp::t()
?The text was updated successfully, but these errors were encountered: