I don't have any beef with PHP, although I switched from learning PHP to Python.
For web development, no other language will get you producing dynamic websites and deploying them as easily as PHP. Compare deployment of Python or Ruby web apps - messier and not simple.
What don't I like about PHP? The language itself. Its piecemeal, adhoc development is laid bare in its unattractive syntax (this is always subjective I know).
On the positive side, my impression is that the PHP community are open to criticism - they have to be given the amount of negative comments thrown their way.
This is in contrast to other language communities that have far too much zeal and sensitivity to criticism.
That criticism against PHP is also taken on board at times in the implementation of PHP's language features or best practices. I've been impressed by PHP's huge speed up in PHP 7. I wish other scripting languages would also address speed and memory usage with the same priority.
Finally, it's worth stating the obvious: if you're looking for a CMS, a message board, a blogging platform etc, PHP gives you enormous choice. And yes, some of these solutions do follow modern, secure coding practices. Look at the other popular scripting languages for web development and you'll find the variety of solutions far more spartan.
I haven't done any PHP scripting for at least 6 years, but my beef was mostly with the community, not the language. If you do your best, you can write decent and clean code in PHP. But the community largely exists of people who don't have the slightest clue what they're doing and who are writing absolute garbage pieces of code. Usually when there's a data leak on a website, it's the result of insecure PHP scripts (again, the language has ways to prevent this, but the scripters just suck).
Mmmmhhh most languages are, more than anything else, their own standard library ... Although there are languages with a very small standard library that are not "batteries included", but they are lower level so it's an apples to oranges comparison.
What other languages are you familiar with to compare it too? Because Javascript is in no way well thought out and it doesn't do parallel computing let alone do it right, it's bound to a single core.
I don't have any, it's great, depending on your use case. I think it's because I learnt it growing up (age 14 onwards) that I always fall back to it as my 'natural' coding language.
If someone gives me a big file of text to parse through, even though I know Python, can use Perl and BASH, I'll likely still use PHP if it's a one-time thing (sometimes even if it isn't). Why? Because within 5 minutes, I can have a script that reads a file from anywhere, parses it line by line and does any number of interpretation. No worrying about casting strings to integers, no worries about general syntax or indenting (Ok, this is a benefit of Python, but if you just need to do something on the fly, PHP!).
IMO PHP is very easy to use, very easy to learn and can do almost anything - good and bad. Good because you can use it to solve tons of problems, bad because everyone learns it early on, or as their first language (like me), and therefore most people aren't great at it, the community gets worse.
If you embrace what PHP is good at, which to me is fast, easy to understand code that is dispatched once per web request in a shared nothing state, PHP is great. When you have to deal with PEAA style PHP, things start to go off the rails in both speed and simplicity.
I happen to like PHP's standard lib: it's big and addresses a lot of needs in building web apps. But you don't really see tons of new high quality bindings or libraries being introduced at the rate that, say, Go is getting them.
> But you don't really see tons of new high quality bindings or libraries being introduced at the rate that, say, Go is getting them.
While true, this is an apples to oranges comparison. Go libraries, bindings, and extensions are written in Go. PHP bindings and extensions are written in C.
Writing a language extension or library binding in PHP requires an understanding of PHP internals and the C language. Compared to writing a binding or library in Go, this is difficult. It requires the knowledge of 2 languages (instead of 1) and an understanding of how PHP works "under the hood".
However, I think that Zephyr shows promise. It's a high-level language designed for creating PHP extensions, without a direct understanding of PHP internals or C being required. https://zephir-lang.com/ (I just wish it didn't limit you to OO design/implementation.)
I've seen "flamework"-style code go horribly, undeniably bad. But if your goal is "simple and fast and damn the technical debt"-development then I have no qualms with anyone who does it.
I don't have any beef with PHP. It pays for my current living so I don't complain. PHP 7 has been a great improvement over the previous versions so that helps as well. At the end of the day, it is just another tool.
Best thing about PHP applications is that even my grandmother can deploy it. Yes, that can be bad or good depending on where you are looking from.
Add frameworks like Laravel and you can create some serious prototypes in no time. That's what I care about to get something out of the door.
My beef with PHP is all the added traffic I get on my http server. Every day I get a list php directories get request from people looking to score on some low hanging miss configured lamp box. Then on the flip side the people that do have php files miss configure they get turn into DDoS boxes against me.
I've actually configured my webservers to start firewalling hosts that make requests for /admin.php, /wordpress/wp-admin/blah.php, and any other request which is destined for a PHP-file.
I don't use PHP, and these kind of bots are just too noisy to put up with.
open-source-ux|9 years ago
For web development, no other language will get you producing dynamic websites and deploying them as easily as PHP. Compare deployment of Python or Ruby web apps - messier and not simple.
What don't I like about PHP? The language itself. Its piecemeal, adhoc development is laid bare in its unattractive syntax (this is always subjective I know).
On the positive side, my impression is that the PHP community are open to criticism - they have to be given the amount of negative comments thrown their way.
This is in contrast to other language communities that have far too much zeal and sensitivity to criticism.
That criticism against PHP is also taken on board at times in the implementation of PHP's language features or best practices. I've been impressed by PHP's huge speed up in PHP 7. I wish other scripting languages would also address speed and memory usage with the same priority.
Finally, it's worth stating the obvious: if you're looking for a CMS, a message board, a blogging platform etc, PHP gives you enormous choice. And yes, some of these solutions do follow modern, secure coding practices. Look at the other popular scripting languages for web development and you'll find the variety of solutions far more spartan.
Avalaxy|9 years ago
neilsimp1|9 years ago
https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/#...
mastazi|9 years ago
Xeoncross|9 years ago
1) PHP is slow, uses too much memory. (I wrote the MicroMVC framework and IOSQL)
2) Makes concurrent (and especially parallel) computing hard (file locking and pcntl_fork())
3) PHP isn't well though-out (like Javascript) so you are always second-guessing the std lib because of odd/short-sighted design choices.
I moved to Go and lost nothing.
However, PHP is (like Javascript) improving and will probably eventually (like Javascript) get parallel computing right.
Where the users are the features are. That is why PHP, Java, and Javascript aren't going anywhere fast.
flukus|9 years ago
iDemonix|9 years ago
If someone gives me a big file of text to parse through, even though I know Python, can use Perl and BASH, I'll likely still use PHP if it's a one-time thing (sometimes even if it isn't). Why? Because within 5 minutes, I can have a script that reads a file from anywhere, parses it line by line and does any number of interpretation. No worrying about casting strings to integers, no worries about general syntax or indenting (Ok, this is a benefit of Python, but if you just need to do something on the fly, PHP!).
IMO PHP is very easy to use, very easy to learn and can do almost anything - good and bad. Good because you can use it to solve tons of problems, bad because everyone learns it early on, or as their first language (like me), and therefore most people aren't great at it, the community gets worse.
anamoulous|9 years ago
I happen to like PHP's standard lib: it's big and addresses a lot of needs in building web apps. But you don't really see tons of new high quality bindings or libraries being introduced at the rate that, say, Go is getting them.
If someone told me I had to build a product from scratch in PHP, I would probably start here: https://github.com/exflickr/flamework/blob/master/docs/philo...
trebor|9 years ago
While true, this is an apples to oranges comparison. Go libraries, bindings, and extensions are written in Go. PHP bindings and extensions are written in C.
Writing a language extension or library binding in PHP requires an understanding of PHP internals and the C language. Compared to writing a binding or library in Go, this is difficult. It requires the knowledge of 2 languages (instead of 1) and an understanding of how PHP works "under the hood".
However, I think that Zephyr shows promise. It's a high-level language designed for creating PHP extensions, without a direct understanding of PHP internals or C being required. https://zephir-lang.com/ (I just wish it didn't limit you to OO design/implementation.)
existcreate|9 years ago
codegeek|9 years ago
Best thing about PHP applications is that even my grandmother can deploy it. Yes, that can be bad or good depending on where you are looking from.
Add frameworks like Laravel and you can create some serious prototypes in no time. That's what I care about to get something out of the door.
smilesnd|9 years ago
stevekemp|9 years ago
I don't use PHP, and these kind of bots are just too noisy to put up with.
taf2|9 years ago
Bahamut|9 years ago
stephenr|9 years ago
wazanator|9 years ago
For example it feels like we can't go a year without WordPress making the news for a security flaw.
crispytx|9 years ago