📜 ⬆️ ⬇️

DevConf 2016: Interview with one of the developers of Yii

We present a short interview with one of the DevConf 2016 speakers Alexander Makarov aka SamDark . He is a member of the Yii core team since 2010 and a representative of Yii in PHP-FIG . The author of the book is Yii Application Development Cookbook .

First of all I would like to ask about work. You work at Stay.com . I suspect that remotely. You are also actively participating in conferences, working on Yii. How do you manage to combine? Is this not full time? Or is something akin to the once Google “20% on their projects”?
Yes, I work at Stay.com . Basically, remotely. This is fulltime. Yii doing either in his spare time, or when not very strong loading on the main project.
I have an agreement on conferences: they are paid in exactly the same way as working days.

Is the Yii version on the working draft? ;-) Is it difficult to keep up with a fresh version?
1.1.17 + some patches from master. On 2.0, it does not work out yet. Project rewriting is a resource-intensive task. The project is not small. There are many current tasks.
If the project was originally 2.0, it’s not difficult to keep up with the releases of the framework. They are not as frequent and if they break compatibility, this is reported in a special UPGRADE file.

What do you do in php-fig ? Only vote for PSR? Is it useful for ordinary PHP developers (not those who do frameworks) to know PSR? If useful, then what.
In addition to voting and discussions, I was engaged in PSR-12. The new replacement coding style PSR-2. We started cheerfully, but since it’s about PHP 7, and the seven haven’t been actively used yet, we decided to wait a bit until you can collect normal statistics.
')
Reading all accepted PSRs is very helpful. Many of them are often found in PHP. The rest, like the PSR-6, is at least interesting and useful to study before developing your solutions.

PHP has been developing fast. New version, a bunch of different rfc. And if some changes are just a harmonious development of the language, then such PHP7 features like scalar type hinting and return types greatly brought PHP closer to statically typed languages. Watching the controversy, it seemed to me that PHP developers were divided into two camps. Some welcome new trends. Others don't like turning PHP into Java (C #). The argument of the latter is that PHP has always had its own niche, different from Java and it has always been a dynamically-typed language. What do you think about this?
PHP development is OpenSource, where collective voting decides everything. Judging by the latest results, there are not so many ardent opponents of change among those who have the right to vote. I welcome explicit typification, but I am not going to use it fanatically. Everything has its place. return types in 7.0 are practically useless for me because of nullable types.

In addition to the previous question, it looks like PHP is experiencing some kind of growth problem. Added return types without nullable types . And from the latter - intersection types and union types , which will make it possible to write such code:
function RecordsToList(Array | (Countable & Traversable) $input): String { ... } 
Personally, I have the feeling that with such rfc patches they want to close the underlying problems of PHP - problems with basic interfaces, and an array that does not support these interfaces. As a modern framework, Yii will work on PHP7 (right? Does it already work?), But do you want Yii to use these PHP7 features? Yes, BC will prevent this in the current version. But if we talk about future versions?
PHP is a legacy of decisions made a long time ago. Breaking compatibility immediately and a lot can not be: users will not understand. Therefore, such solutions-patches are obtained. Some of them are strange, some quite fit.
Yii is already working on PHP 7 and is already partially using its capabilities, rolling back to native code for older versions of PHP. In future versions of the requirements for the version of PHP will gradually increase, your code is gradually removed in favor of what appeared in PHP.

In general, what do you think, when mainstream frameworks start breaking their compatibility with PHP 5. *? What can PHP7 lure?
After 2.5 years: secure.php.net/supported-versions.php
While PHP 7 can not lure the developers of frameworks with almost nothing, but compatibility with it is definitely necessary to maintain.

I wrote my latest projects on laravel. And there they use two approaches for Inversion of Control - Service locator in the form of pseudostatic facade classes and DI in the form of Constructor injection, Controller action injection, etc. Those. the same action can almost always be done in two ways. For example:
 Mail::send(....) 
or
 public function __construct(Mailer $mailer) { $this->mailer = $mailer; } ... public function doSomeAction(...) { $this->mailer->send(...) } 

Despite the fact that almost everywhere facades are used in the documentation as a simpler option, experienced laravel developers advise using injections. The code with them is much less associated (low coupling) and, I hope, someday and in the help for beginners will recommend them. As far as I know, in Yii, the main option for IoC is the Service locator. But there are some options for DI there too (used only inside the framework?). Are you going to introduce automatic dependency injection in Yii as the main IoC method?
Automatic injections have long been, documented and actively used by those to whom it is close. It is planned to more actively recommend such an approach in official documentation.

Question from Grikdotnet :
Why is it scored on modularity and when will it be a microkernel?
The microkernel will be somewhere in 2.2 - 2.3. The modularity is not scored. Firstly, it is already in some form: bootstrap, redis, etc. Secondly, in 2.1 from a kernel according to the plan practically everything connected with the client-side will move.

It's time to go to DevConf. You report security . From the description I did not immediately understand for whom he was. For admins or programmers?
For programmers. Admina will be small.

You are one of the organizers of the Yii-hakaton, which will be held as part of DevConf. Share information. Is there already a list of topics?
Topics will be determined depending on the number of people willing to participate. There are two types of tasks. The first is what will be of interest to the whole community: I finished the official extension for queues and other issues with github, jointly parsing and documenting the possibilities, making improvements on the new yiiframework.com. The second is ideas expressed in the community: a blogger with a tutorial on its creation (approximately as it was for 1.1), separate extensions, fruitful discussions on the topic of the now fashionable DDD and service layer, the results of which will be in the form of articles or sections of the manual.

Such a small interview. If you have questions to SamDark in the comments, I will try to invite him to the topic. I'd add that the hackathon will be held on the weekend of June 18-19 and, of course, will be free. The exact time and place will be announced shortly.

See you at DevConf 2016 .

Source: https://habr.com/ru/post/301114/


All Articles