Why is PHP hated but everyone uses it?


PHP is that terrible?

Let’s just say no. We can say for a long time that there are no bad languages, and so on. etc., but PHP is a common programming language with its own advantages and disadvantages.

Why is PHP good?

The answer on the surface is that PHP’s entry threshold is extremely low. To learn how to program on it, it is enough to take a short course or figure it out yourself. Along with the specificity of HTML to render everything possible, however you write the code, PHP makes it easy to create websites.

PHP provides everything you need for web development, it is undemanding to learn, the most common language for the web

Oleg

developer cat

Ease of learning and use popularized the language, became the reason for its spread. The vast majority of sites are created in PHP, many CMS are written in it. Even such a large project as YouTube was originally based on PHP.

PHP is ideal for creating a website. It will withstand a large number of visitors and cope with a serious load, if there was a good hosting at hand (yes, this is a hint at us). In addition, PHP is undemanding to hardware and can start on any “wheelbarrow”.

Why does PHP deserve scolding from programmers?

The pluses of the language turn into minuses for its reputation. The ease of use of PHP allows novice developers to write code the way they see it, without thinking about its readability and efficiency. June feels a fit of pride from the working site, but in fact the result is far from an adequate state. Of course, we do not claim that all beginners get bad code, but without proper experience, not everyone does well.

The problem is exacerbated by the fact that such PHP developers, after the first works, continue to create projects of dubious quality in terms of code. It works, don’t touch it. But if something breaks or you need to make changes to the code after a while, then it will be very difficult to understand the mess of PHP. The lion’s share of the internet has been written this way.

PHP was originally created to be simple so that even “housewives” and people very far from programming could use it. And they began to use it, because of which a lot of game poured onto the Internet. The “real” programmers, who constantly puzzled over the code, wrote it strictly according to the documentation and were afraid to put a comma in the wrong place, naturally burned out from how uncomplicated the “puff” turned out to be.

Someone writes code for hours, tests it, it doesn’t work, looks for bugs, writes code again, and someone collects something from PHP, creates a Frankenstein monster, and it will still work. And then you still need to support everything that the “craftsmen” created in PHP. “Fair?” – think “real” IT people. “Not!” shout their burnt-out colleagues.

Negativity towards PHP quickly spread among programmers and took root in the mind. Even after many years and versions with improved language, this attitude has not changed much.

I think, for the most part, it’s already a fashion not to like PHP. Although there are certain shortcomings, as in any other language. Specifically, in PHP – dynamic typing, not very convenient syntax

Here we sneak up on the next problem of language – syntax. Stones (and other unpleasant things) fly into his garden for excessive freedom of opportunity, dynamic typing. Variables can be declared anywhere, you can name them whatever you like. The same variable in different places in the code can take on different types of values. It turns out a mess and complete chaos.

The broken “==” operator deserves a separate censure. The expression “1111 == 1111sph” will give us True. “Puff” simply turns the right side of the expression into a number and it doesn’t care that it’s a string. A third-party developer, seeing such code, may simply explode with indignation.

For me, this is one of the tools that can be used in my work. But it has disadvantages that I can highlight for myself:

– Zoo of versions and backward compatibility;

– Early versions do not have frills and features that appeared over time in later versions;

– It is necessary to support the same zoo, which is discussed in the first paragraph

And yet without him nothing

PHP was predicted to die quickly, that there would be a good replacement and everyone would live beautifully, but it is still one of the most sought-after programming languages ​​​​- lightweight, obedient and efficient for websites.

Yes, they joke about PHP and some even hate it, but, firstly, a lot has already been written in it and it needs to be supported. Porting everything to another language is much more expensive in terms of resources than leaving the project in PHP. Secondly, why port if sites work great in a language that was created specifically for this. Thirdly, PHP continues to evolve, many of its imperfections disappear, scripts speed up, and code readability increases, more strict typing appears. The language is becoming clearer and more professional – it has long been not that scripting addition for Perl, but something more, albeit overgrown with jokes and memes.

PHP development is fast due to the abundance of ready-made solutions: libraries, frameworks, CMS. Often you don’t even need to know PHP itself, depending on the complexity of the project, of course.

If you want to create websites, then PHP is a great tool that allows you to earn good money. Skillful hands with the help of any tool can make a quality product – it’s all about the master.

Leave a Reply

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