6 ms·
There is nothing wrong with PHP for websites. I'm fact, PHP is probably the best option for most people(that's a bold statement). It does many things better tha
by NorwegianDude 4y ago
There is nothing wrong with PHP for websites. I'm fact, PHP is probably the best option for most people(that's a bold statement). It does many things better than other languages. It's not without reason that PHP is the most used language for websites.
There is of course situations where PHP isn't a good solution. I would prefer to use something else if something like websocket was important or if performance was critical.
PHP today has about as much in common with PHP from 2005 as today's javascript has in common with javascript from 2005. Languages change.
- xigoi 4y ago> It does many things better than other languages. Such as? (Aside from inconsistency, it's indeed unbeatable at that)
- netol 4y agohe he… I'm not the OP, and I'm not knowledgeable enough in programming languages to answer this question. But I also would be curious to know what the other languages are doing better, regarding backend website development (apart from consistency, which I don't argue is important). PHP may be very inconsistent, but its syntax is also very stable. You don't need to spend hours rewriting your application to use the latest PHP version. I'm not sure if it may have been a good idea to have a "Python 3"-style release, maybe.
- NorwegianDude 4y agoTemplating is built in. It doesn't maintain state between requests, and that is a perfect match for HTTP. It's easy and fast to deploy. You don't need to restart things or think about reusing ports to update without downtime. It's easy to sandbox, making hosting very cheap compared to most other languages. It's basically "serverless" with really good startup times. It has better performance than most other interpreted languages. It has support for many functions that many other languages would require a dependency for. Development speed quite fast as a result of the large amount of included things. You can to some degree decide if you want to use strict types, or just ignore it. It has a large ecosystem with multiple great, feature rich, and battle tested frameworks. It's has very good backwards compatibility, and it's easy to upgrade large code bases to newer version. It's documentation is the gold standard according to many. While it's definetly not one of the coolest or most fun languages, it's definitely one of the greatest for the web. Doesn't PHP run something like 75-80 % of all websites today? Clearly it's doing something much better than others.