Live data from Hacker News

A look at modern PHP

lwn.net

381–390 of 610 posts

Re: A look at modern PHP

#381

Earlier quoted context omitted.

Node developer here, but... two notes about your comment concern me a little. 1. "I can't think of a single reason to use PHP over Node" this is fine but can you think of a single reason to use Node over PHP. Is adoption cost the only one? 2. "you might be a bit behind the curve" while the original commenter was talking about PHP being "modern" and dimissing talk of it existing because of legacies, criticising someon…

1. Off the top of my head: SSR of JS apps, performance, better security track record. It also fits in the modern architecture better: you can certainly write a rest API in PHP, but that's not typically what you would use PHP for... and if you're going to write a react, vue, etc app, you're likely writing an api also. 2. This is not my attitude at all. I've been programming since the 90s.. In the past I've maintained…

> you can certainly write a rest API in PHP, but that's not typically what you would use PHP for

Definitely not true in my experience. lot's of people are writing REST apis in PHP.

> NodeJS is 11 years old... it's not a shiny new thing anymore.

I write Node stuff for work at $dayjob, and lot's of stuff is great. But it still has nothing that's close to competing with Rails/Django/Laravel in terms of completeness.

Re: A look at modern PHP

#382

Earlier quoted context omitted.

as a Ruby/Rails guy, I feel the same way. Seems like Rails became the top stack to shit on to feel better about your stack these days. People are just tribal. We need to feel superior to the "other" to feel better about ourselves.

Funny, I remember everyone hating on PHP when they moved to RoR, and now they hate that are and moving on. Its almost as if they just need things to hate so they can rewrite code. its very cyclical IMO. The elitism of learning a new language and then mocking those that haven't put in the same time and effort to row in the exact same direction, has always amused me. Ive never judged anyone for what tools they use to g…

RoR was guilty of that as well, so we kinda deserve it. The community was more of an antithesis to java actually, not php.

Re: A look at modern PHP

#383
post #370
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

Here's some interesting facts about PHP I like to know and share. How many of them are now untrue? "foo" == TRUE, and "foo" == 0, but TRUE != 0 NULL PHP sez: Parse error: syntax error, unexpected (T_PAAMAYIM_NEKUDOTAYIM)

You may have missed it, but with PHP 7 the language has even more shifted towards stricter typing paradigms. People use strict comparison, typed properties, typed arguments, etc. Couple that with one of the popular static analysis tools and you'll never see any such errors.

Re: A look at modern PHP

#384

Earlier quoted context omitted.

RoR and Django are probably the closest (Laravel was inspired by RoR). Still, I don't think they support all those features. Like I can't find any official RoR support for payments, full text search, encryption, pagination, scheduled tasks or building CLI commands. With Django, full text search seems limited. It supports PostgreSQL, but I couldn't find first-party integration for Algolia, Solr, Elasticsearch etc. or…

Why would RoR bake payments support into the framework? RoR is there to tackle common web application tasks, payments is there for maybe 30% of web apps / services. There's an active debate on what popular libraries should be included in Rails, and all the features you listed can be found in libraries if they aren't in Rails already.

> Why would RoR bake payments support into the framework?

I'm not saying they should, just comparing features for the sake of demonstrating that the functionality that's present in modern PHP frameworks isn't readily available in just any random framework in any random language.

Re: A look at modern PHP

#385

can anybody explain what is the purpose of static typing in a dynamic language ? It's not like you get benefit of compilation like java/C#. Why is PHP trying to become java so hard, if there is already java and .NET ?

You can compare static typing in php to typescript or static typing in python. It's for correctness, not performance.

Re: A look at modern PHP

#386
post #147

Earlier quoted context omitted.

> And last, people compare it to languages like Rust or Go since they consider those are "innovative". I hope everyone understands that a language is fit for a certain type of task. PHP was created for website development, and in that area neither Go or Rust are even close to matching it in terms of maturity. I'm not disagreeing with you, but "website development" is a very broad category. For example, if you definit…

For a more or less static website, what’s probably the best bet, and has been the standard for many years, largely because it allows the non technical restaurant owner to easily update and make changes, is Wordpress. In which case you’re back again in PHP land.

WP is not in anyway static (without plugins) and you will quickly realize that when your site deals with a non-trivial amount of traffic and it completely seizes up.

WP hasn't been a good choice for small business owners for a long time - web security is hard, and hardening a WP install is not simple. There's a ton of options out there that do everything WP does without the overhead: squarespace, weebly, wix, shopify, etc.

Re: A look at modern PHP

#387

Earlier quoted context omitted.

as a Ruby/Rails guy, I feel the same way. Seems like Rails became the top stack to shit on to feel better about your stack these days. People are just tribal. We need to feel superior to the "other" to feel better about ourselves.

Funny, I remember everyone hating on PHP when they moved to RoR, and now they hate that are and moving on. Its almost as if they just need things to hate so they can rewrite code. its very cyclical IMO. The elitism of learning a new language and then mocking those that haven't put in the same time and effort to row in the exact same direction, has always amused me. Ive never judged anyone for what tools they use to g…

This and the parent comments are assuming that all language criticism boils down to tribalism/elitism and not problems with the language itself, as if all PLs are the same, and the choice to use them is arbitrary.

Re: A look at modern PHP

#388
Funny, while I see that many people enjoy the features that come with this maturity (and I am happy for those people of course), I long for the simplicity of the classic style PHP.

Personally, I do not enjoy the Java-style 'enterprisey' direction of PHP. I don't like types, anonymous functions, treats and all the other fancy stuff. To be honest, I think I myself would still be happy with PHP4. I use thin scripts, almost no classes, alternative PHP template syntax and I am completely frameworkless. But I guess I am just a nihilist ;-).

Re: A look at modern PHP

#389

Earlier quoted context omitted.

I've done plenty of PHP programming (including modern) in the past. I'm excited about recent developments. Not sure about the productivity claim. I once wrote from scratch (frameworks excluded) backend and frontend (version 1) of a multi-tenant, cloud-based video-sharing platform with PHP as the backend (aws cloud) in a matter of weeks. I once wrote, from scratch (frameworks excluded), an entire backend (and front-en…

Can you attribute that specifically to PHP making that possible? Why couldn't an equivalently capable peer use Python to do the same?

Why is php development quicker?

Because of spaces vs tabs additional overhead. Packages vs built-in libruaries. RAD frameworks like laravel vs Django.

Re: A look at modern PHP

#390
post #112

The amount of misinformation, false claims and unsupported statements in this thread is mindblowing for the quality that I've been used to see on HN. Here are some facts: - Symfony was the backend framework with the most contributors in 2019 [1] (yes, out of any backend framework written in any language) - PHP has more active contributors than it ever had [2] - Laravel is one of the most used frameworks in the world…

Do you have some recommendations for books about laravel and lumen ? (I hate laracasts, I rather read than play/pause/type/play/type, etc.).

"Laravel Up and Running"[0] is a popular choice. Lumen is just Laravel with a few features stripped out of the framework. They both use the same underlying packages.

0: http://shop.oreilly.com/product/0636920179467.do

Post reply on HN