name

Why is it Good to Choose PHP? Interview with PHP Developers from Droptica

The new version of PHP, scheduled for November, is approaching. In one of the previous posts, we wrote about what is new in PHP 8, and a separate article was devoted to the JIT compiler, which will be finally officially added as a functionality.

Below is an interview with PHP programmers from Droptica who have been programming in PHP for many years and know very well how to use the advantages of this language to offer the clients as many benefits when building their websites as possible.

How many years have you been working with PHP?

Sebastian Rogala: Professionally – from the end of 2013, which makes it almost 7 years now.

Damian Skiba: I have been working as a PHP programmer for 9 years.

Mariusz Andrzejewski: In web technologies – for 10 years, with 7 years focused on programming in PHP.

What are the biggest advantages of programming in PHP in your opinion?

Sebastian Rogala: The flexibility of the code being written, as well as the fact that it is currently being rapidly developed and it does not seem that this development is going to slow down any time soon.

Damian Skiba: The application stability in PHP. The large community.

Mariusz Andrzejewski: The rich syntax and capabilities of the language allow one to write both static and more dynamic code. What is also important to me is the active development of the language and the community that focuses on more and more thoughtful solutions with each release.

What do you think makes PHP competitive when compared to other programming languages?

Sebastian Rogala: I do not think that PHP is the golden mean that can be used for everything and will be suitable for any project. The advantage is certainly the relatively low entry threshold for writing applications. The vast majority of web hosting’s also offer a PHP server immediately after purchasing their services, and many of them also offer ready-made installers, such as: Drupal, WordPress, or Joomla. I believe that it has a definite advantage among the existing and usually free solutions for most basic needs, such as a blog or an online store, and with dedicated systems, it offers well-written and tested components, so in many cases, we can add them like pieces of a puzzle.

Damian Skiba: PHP is a web-dedicated language. It was created with this type of use in mind – in contrast to many other languages that were created as general-purpose languages.

Mariusz Andrzejewski: Due to many years of development and activity, already been written for PHP is a huge number of ready-made libraries or platforms such as the popular CMSs: WordPress, Drupal, which even a novice programmer can fully benefit from.

As many as 82% of websites are based on PHP. What are in your opinion the greatest benefits for clients when building a website on PHP?

Sebastian Rogala: I think that such a high share comes exactly from these ready-made systems, such as blogs or e-commerce. If the client is just starting their adventure with, for example, an online store, there is no need to employ commercial solutions. And even if the scale of the project is huge, PHP offers its own solutions, such as Magento. Also, the content management systems, such as the aforementioned Drupal or WordPress, are ready-made solutions that we use as part of PHP development in cooperation with our clients.

Damian Skiba: It is very easy to switch from other languages, e.g. C, C ++, to PHP – due to this many pages were created on PHP. For example, the first version of Facebook is PHP.

Mariusz Andrzejewski: PHP was created at a time when there were not many sensible solutions on the market, hence it quickly became popular as the most frequently chosen server-side language and, paradoxically, this popularity is its foundation to this day. Thanks to its widespread use, a greater number of programmers are available on the labour market, which makes it much easier to assemble a project team or hire a dedicated team of programmers.

What was the most ambitious project you implemented in PHP?

Sebastian Rogala: A good example is the system of labels – statuses. This consisted of giving the client the possibility to set their own rules for "adding status" and "removing status" from the order to "status addition" or "status removal" from the order. It might seem simple at first glance, but it did require thinking over the data flow, as it was very easy to get stuck or looped. It was also necessary to provide an appropriate configuration mechanism so that the user could independently define the statuses and actions that were to occur.

Damian Skiba: Writing a server in Node.JS that sent messages to hundreds of connected clients. And all support for this server was developed in Drupal. There were cases taken into account where if one of the Docker containers shuts down, it has to be restarted. And containers with Node.JS and Drupal are to be synchronised in order to know what was already sent to clients and what is waiting in the queue.

Mariusz Andrzejewski: One of the most interesting and complex projects I had to deal with is the participation in the creation of a site-builder platform, i.e. a platform for building new web portals. The multitude of possible solutions, the flexibility of each of the components, as well as the openness to changes while maintaining the stability of the already existing web portals were the greatest challenges that were set before us and that were implemented.

What do you think the client should pay attention to if they want to create a PHP web page from scratch, and when they want to expand the current one?

Sebastian Rogala: In both cases, the basic question is "how big is the system supposed to be and is its development planned?" If we create a new page, then for something not too complicated and without plans for long-term development, one of the popular frameworks and the use of classic MVC or Drupal is enough. For projects of larger scale, other aspects should be considered – such as system architecture in a broad sense. One of the most popular approaches is using Symfony with hexagonal architecture and heading towards microservices, although it is better to create a modular monolith.

Damian Skiba: If it is going to be some big modification, then a lot of the existing logic would have to be changed. If it would be Drupal, there is a lot of room for manoeuvre to add this functionality. And if it is not Drupal, it would be a good idea to choose it and rewrite all the existing logic into Drupal services, and then add the new functionality.

Mariusz Andrzejewski: As with everything, people are the most important. The multitude of available programmers on the market does not always translate into quality. First of all, it is worth to assemble a team of experienced programmers and architects who will be able to translate the business logic into the best solution, choosing the most appropriate technology for a specific solution.

Why do you think Drupal attracts more high-class PHP specialists than any other CMS?

Sebastian Rogala: I think it is because Drupal gives the greatest possibilities when it comes to designing and creating applications when compared to other CMSs. It also has a higher entry threshold, which means that it is good to have some previous programming experience to be able to navigate Drupal and write effective solutions.

Damian Skiba: In my opinion, it is because of Drupal 8, which was written in Symfony.

Mariusz Andrzejewski: Being a member of the Drupal developers team, I think the CMS is a comprehensive one that uses the solid foundations of Symfony development. It is very difficult to go "around" some things in a non-standard way, so most experienced programmers who are not afraid of working with documentation and who are able to understand and trace the logic of the entire application code are better at it.

What PHP framework do you use the most and what are its advantages?

Sebastian Rogala: I have been dealing with Laravel the most lately, but I have been working the most on Zend Framework, now called Laminas. In my opinion, it is a "sister" framework to Symfony. The main advantages are modularity and the use of most "good" design patterns. The "configuration over convention" approach also has its positive aspects, as it gives us great flexibility to provide tailored solutions. Thanks to this, e.g. we do not have to stick to the MVC architectural pattern, but we also have the freedom to use Hexagonal or CQRS.

Damian Skiba: Symfony. For me, the advantage is "dependency injection" and speed of operation.

Mariusz Andrzejewski: Due to my strong attachment to Drupal, I find the Symfony framework to be the closest to me. Both Drupal and Symfony are most often used by professionals, and a huge community of programmers works on the development and popularisation of them.

If you had to convince a novice programmer, what argument would you use to get them to start learning PHP?

Sebastian Rogala: First of all, I don't think that any tool (and that is a programming language) is good for every situation. On the other hand, if a person's interest and direction is related to the broadly understood web application development, I think a good argument is a low entry threshold and the ability to start working and see the results faster than in other "server" languages. Another thing is the flexibility of PHP and a very large community that offers a lot of ready-made solutions. I think these are good arguments for a novice programmer.

Damian Skiba: Low entry threshold. If you know a programming language from high school or college, you can learn PHP without much problem.

Mariusz Andrzejewski: Ease of learning, a large and active community translating into an extensive knowledge base available on the Internet. The ready-made solutions will lower the so-called "entry threshold" even more.

What do you think will be most valuable in the new version of PHP?

Sebastian Rogala: Union Types, Named Arguments, Match Expressions. There are quite a few interesting elements to mention.

Damian Skiba: JIT, thanks to which PHP will run even faster.

Mariusz Andrzejewski: Many PHP programmers like its dynamic nature. However, I am pleased with the changes towards greater control over the state of the application, including the control over the errors shown, which will be tidied up with the latest release of the language.

Resume

We are waiting impatiently to the release of PHP 8. We will take a careful look at the solutions and check out our agency on how the new functionalities translate into everyday development work.

Cover of an e-book