re: Is PHP relevant? VIEW POST


PHP like JS is popular. No question about the fact that you can do great things in PHP and that great things have been done with it.
I appreciate all bootstrapping courses that teach programming.

That being said, your post does not demonstrate anything.

Saying “But when written properly, following methodologies such as DRY, SOLID and MVC” is not a valid point. Simply because :

  • those patterns have no formal methods of verification.
  • You also can’t test that those patterns are respected in your app.
  • You can write “proper” assembly code to run on the server. The fact that it’s “proper” does not matter because you have to understand your assembly, processors ... in order to maitain the codebase and do evolution on it. I’ll take bad PHP code to maintain over “proper” assembly code anyday, simply for the fact that you can maintain it by knowing less that you would otherwise (whithout taking into account, more technical issues). My point Is that writting something “properly” helps you to maintain and evolve it over time, but it will never solve fundamentals issues of your language (or stack), for all its qualities PHP requires to know its quirks and there are legion.

PHP is fast fo pick up, has a model that fits fine with the HTTP protocols ( stateless request / response), can be run everywhere, have great frameworks and a great community. I think that to begin with PHP is not a bad choice, especially if you aim at being operational fast.

However PHP7 does not fix PHP, it helps but it does nor fix it. Yes it is broken :
In the space of distributed application, PHP lacks maturity compared to Java (jvm rocks) by example, in the space of concurrency and parallism, there are also better choice.

In short, yes PHP is not dead.
Statistics don’t say that it’s a good, just that it’s there.
Yes every languages have flaws but very few have flaws like PHP (where is PHP 6??) which are important to know.

It does matter for those who plan to work in challenging environments in the futur.

(Edits some mistakes)

My question is if those patterns are not valid, what is a verified method? Your response did not give an apparent valid method that you are seeking as an example. I'm curious because I use MVC and design patterns as a base of understanding and translating a system. Or what do you mean by validity?

I also think every system is broken. Every framework is broken, but it does move us forward from where we were before sometimes, too.

Systems are inherently, just like humans being perfectly imperfect. :)

I liked reading your response as it was well written and gives me room for thought. Thanks!

Thanks for the appreciation :-)

Before replying, I just want to say once more that I find the initiative which allows someone to get a job, to be a good thing, using PHP or whatever.
My original reply was to demystify the idea of the bad press against PHP, is being done by programmers with bad practice.

I agree that every system in general, like everything humans do, have flaws. Perfection is out of this world, to keep trying is part of what makes thing better. Another part is letting things go.

We do not know, how to let go in our industry, so we often debate / rant / troll over things, over and over. I find that most of the time it comes down to the idea of: Cost vs Benefit.

I called PHP broken, because of the cost of these points:

  • PHP has deep design flaws which far overweight its good parts. You cannot get the good part without knowing about the flaws. This create cognitive charge and add a complexity which can be avoided. Part of the reason PHP6, never got out are due to this.
  • PHP as a platform does not have any clear advantages over its concurrents.
  • Complex systems in PHP, are truly hard to maintain, PHP do not scale well. Facebook demonstrated this. They know the web, they have in their staff top engineer who knows all the good practices and still they decided to rewrite the runtime of PHP amongst other thing

PHP is only relevant by its market share, which is reason enough, to being taught (imho) and use but hardly qualify the platform as relevant in itself. PHP7 brings no innovation or game changing feature whatsoever. NodeJS does for example, despite its flaws (still not my thing though), like the way it solves concurrence issue while focusing on performance.

One can argue that, PHP is still fine for small things. I do agree on that.

About MVC or Design Patterns in general, I got no issues with those. However, it’s important to remember that Design Patterns were presented with use case scenario and the cost of using them.
I found useful to read / overview original papers on those subject, you often find little details which changes your perspective. This article about MVC, is a good example, of what you can get when you dig on this:

So, in short my point was not about MVC in itself but about the fact that MVC does not guarantee good software. Saying that if I write a piece of software properly using MVC, does not mean that if MVC is used the software has been written properly, neither does it define the term “properly”.

Writing software is hard, that is why good code is rare and that is also why, tooling and the platform being used are as fundamental as using patterns / skills and understanding architecture.

Without knowing which problem is being solved, in which context / constraints, it’s better not to make a statement about any piece of code in my statement.

Thanks !

code of conduct - report abuse