What is PHP used for?


If you want to know what is PHP language, what kind of possibilities it brings and what are its pros and cons, let read the interview below that was conducted with our PHP Developer- Paweł.

What do you like the most in programming? What are the advantages of working in IT?

I have always liked practical solutions, create something that really works. That is why I like the most in programming that you can create something that is useful. The greatest advantages of working in IT is that in addition to being creative, you still earn money – and that’s very good.

In which direction you want to develop yourself? What are your professional interests?

I like working on backend and I will rather stay here 😉 I am thinking about extending my skills towards IoT devices and creating software for the above.

You specialize in PHP, why did you choose this programming language? Can you explain for strangers what language is it and what possibilities it offers?

I chose PHP in 2008, during the days when I started to be interested in programming more. It was the easiest way to create something specific and more interesting than the next program adding two numbers in the console. I liked it more when the Steam API appeared. PHP is a programming language used primarily as a web application backend. It is more and more mature language and quite simple to learn. It gives a lot of possibilities. In each edition it is more efficient and of course most popular backend language in the world.

What pros and cons you see in using PHP?

The advantage will definitely be gigantic popularity, some statistics even say that 80% of websites (of those where the language on the backend is known) use PHP. Even if these statistics are significantly overstated (and probably are), still finding a job with this language is not a problem. In addition, there is a low entry threshold, which gives beginners a chance at a low-burden entry into the industry. The disadvantages would include a fairly large amount of poor quality code, which accumulated due to the little experience of programmers, old language creator decisions and the consequences in the form of backward compatibility (as I mentioned, more than half of the sites can stand on PHP, so any serious change must have it on note, and any changes that interfere with existing solutions – properly spread over time). It should also be borne in mind that this language is primarily addressed to the web application backend.

Where does controversy around this language and why?

PHP was created as a simple set of scripts for a simple website, at which more interest began to gather. Something bigger was never planned, even than PHP 3, which was created for the needs of eCommerce application. You just have a set of functions from which you write a script that generates a page. There was no such standardization, even in methods related to arrays there are still different order of data in some places until today, e.g. in `array_map`, callback is the first parameter, and array is the second, but in` array_reduce` and `array_filter `callback is the second and array is the first parameter. It should be borne in mind, however, that quite a few fairly legitimate language flaws are no longer valid (some myths may be almost 20 years old!), As it applies to versions that are not already supported. At the time of writing, April 17, 2020, the oldest supported version of PHP is 7.3 released at the end of 2018 (There is still 7.2, which receives security patches by the end of November this year). In the latest 7.4, however, many changes have been introduced, which further “modernize” the language syntax, improve performance, introduce safer forms of data entry, etc. Therefore, I think that you can not look at PHP only through the prism of the past, but focus on current facts. Creators the language and community around some projects have done a really good job recently.

What is the best way to learn this language? Where to gain knowledge and how to improve it?

First of all, it is worth knowing the basics of the basics that are universal regardless of the language 😊 I guess it will not be anything strange if I simply recommend the great books of “uncle Bob” Robert C. Martin. There are many cool and current sources available on the internet, where you can learn the language and – most importantly – learn how to use it well. A great source for beginners and those wanting to learn the basics of good practice, moreover translated into many other languages, including Polish is the site phptherightway.com. In addition, the Polish PHPers community with groups on Facebook for beginners and the general PHP group on Facebook Recommended standards in PHP, especially recommended to know PSR-1, PSR-2, PSR-4, PSR-12 can be found here. For Symfony leaders, I also recommend the Symfony chapter on best practices from official documentation. I would like to point out that there is no single standard a lot for some issues, and a good deal are just recommendations that can be used or not. An ideal example is the code writing standard – you can use either the PHP-FIG recommendation, which speaks of PSR-12 (formerly PSR-2), but there is also a separate recommendation created by Symfony developers (based on PSR-2). The one we decide on depends primarily on the needs. In addition to sources from the Internet, live meetings are also organized, the most popular and common in Poland are organized by PHPers, and a list of events can be found on their website. In addition, PHPCon conferences are held from time to time, and until recently there were phpCE conferences.

Finally, can you write to the undecided people why you should learn PHP?

The language situation on the market is stable (despite the pessimism of some that PHP “is dying”), so it will never be that all this knowledge will prove to be unnecessary over time. If you are interested in what is happening “under the hood” of a web application, PHP will be a very good choice.

Leave a Reply

Your email address will not be published. Required fields are marked *