6 ms·
PHP is a great fit for most web projects. It is battle tested with great backwards compatibility, fast, offers the best deployment story and combines the advant
by cardanome 5y ago
PHP is a great fit for most web projects. It is battle tested with great backwards compatibility, fast, offers the best deployment story and combines the advantages of dynamic and static typing with it's gradual typing system (Think Typescript without the complexity of Typescript.)
The next version is even going to improve on its weakest point, concurrency, with Fibers:
https://php.watch/versions/8.1/fibers https://php.watch/versions/8.1/fibers
Sure we all remember the bad old times and the horrible legacy projects that are still around but let's no forget PHP allowed the average Joe to hack up his own dynamic websites without jumping any hurdles. It helped democratize the internet for a while.
I really don't get why PHP is not more liked in hacker circles. Probably needs some new languages with slightly different syntax that transpiles to it for it to be hip again.
- jrwr 5y agoI use PHP more for "shell" scripts then I do for web stuff nowadays, I find its just faster to bang out something somewhat complicated in it then other langs I know currently.
- pineconewarrior 5y agoYes! PHP is great for this. I often use it for things that people might use Python for, too, except on the web.
- qsort 5y ago> Probably needs some new languages with slightly different syntax I used to toy around with Haxe: https://haxe.org/ https://haxe.org/ The idea in principle is great (use Haxe the language on your machine, then Haxe the compiler to produce PHP code and upload it to a cheap hosting somewhere), but I've never found a real use for it.
- cardanome 5y agoI am regularly stumbling upon Haxe. It seems like a well designed language but like you I never yet found a use case. Though it seems to be also great for game dev. The show case of games written in Haxe is quite impressive: https://haxe.org/use-cases/games/ https://haxe.org/use-cases/games/
- kevinmgranger 5y agoI think it's close enough to ActionScript that those with flash game dev experience can be comfortable. I think that was even the main point! If I'm not mistaken, OpenFL[1] is an effort by the same people. [1]: https://www.openfl.org/ https://www.openfl.org/
- deleted 5y ago[deleted]
- adventured 5y ago> but let's no forget PHP allowed the average Joe to hack up his own dynamic websites without jumping any hurdles One of the great things about PHP is that that is still ever-present. It's fairly easy to get started utilizing PHP, just as it was 15 years ago. The basics of PHP have not gotten much more complicated over time. Open a text file, write out a bit of PHP, save it, run it somewhere (locally or on a cheap host). Any Joe can still do it. I can't think of much that has gotten more difficult about getting started with PHP versus the first time I used it.
- gitgud 5y ago> "I really don't get why PHP is not more liked in hacker circles" To me PHP is an ugly language, with heaps of quirks and weird api's. The way it mixes markup and logic is gross. That being said, I do like some parts of it. The way you compose pages by just writing "include" is nice. The way the server spins up processes for every request like a micro-service is nice. PHP does have an elegant simplicity that many languages and frameworks lack these days...
- jonwinstanley 5y agoMixing markup and logic is strictly not done in the more modern frameworks like Laravel and Symfony, they use MVC similar to Rails. Wordpress does mix the two, but Wordpress is definitely not a good example for modern PHP development!
- cardanome 5y ago> The way it mixes markup and logic is gross. We don't do that any more. You separate logic and view like in any other language. In fact some people don't even use PHP for templating anymore but a domain specific language. (Though sometimes having a fully features programming language for templating can be nice so jury is still out.) Honestly I am more grossed out with the stuff that some modern frontend frameworks are doing these days, where there is not separation of styling, markup and logic anymore with that thing that is like html but not totally html. I see the advantages but not sure how this will turn out in the long run.
- xtracto 5y ago> To me PHP is an ugly language, with heaps of quirks and weird api's. The way it mixes markup and logic is gross. Kind of tangential, but I've found a similar thing in the React framework: After all these years working towards splitting UI with logic, React asks me to hardcode the graphical components in a return (<module1></module1><module2></module2>) function. It is something I just cannot grok. I prefer frameworks that let you separate the UI elements from the logic that drives them.
- goodpoint 5y ago> It is battle tested The security track record of the language speaks for itself: https://www.cvedetails.com/product/128/PHP-PHP.html https://www.cvedetails.com/product/128/PHP-PHP.html It's been battle tested and lost many battles.