Live data from Hacker News

A look at modern PHP

lwn.net

41–50 of 610 posts

Re: A look at modern PHP

#41

PHP, Python and Ruby all feel to me like last-generation languages. IMO we should be building new frameworks on modern languages that support concurrency & static typing. The most promising new stack I've seen is Kotlin's KTOR framework. Thanks to the expressiveness of Kotlin it's not really any more verbose than something like PHP or Ruby but it's far more powerful and robust.

Nah. The JVM must go; we have Docker and the universal platform are Linux ELF binaries so the entire "bytecode" concept makes sense for the compiler (i.e. LLVM), but no longer at runtime. It's just bloat.

Re: A look at modern PHP

#42

Earlier quoted context omitted.

you can run PHP pretty much anywhere, even the cheapest VPS probably has PHP, as well as all managed hosting. For python, go or other languages it can be more tricky if you're looking for cheap hosting / VPS

With docker containers and the numerous PaaS/FaaS runtimes, does that really matter? You can run anything just about anywhere these days, cheaply or even for free.

For us techies, no, it doesn't really matter.

For average business owners who buy a WordPress template and some 5€ hosting in order to set up a business card web site on their own, on the other hand, it matters a lot. So if your project targets that group of people then PHP is pretty much the only option; anything more complicated than an FTP upload/MySQL import is pretty much to advanced for them and they generally aren't interested in learning new skills just to get a web site online.

Re: A look at modern PHP

#43

PHP, Python and Ruby all feel to me like last-generation languages. IMO we should be building new frameworks on modern languages that support concurrency & static typing. The most promising new stack I've seen is Kotlin's KTOR framework. Thanks to the expressiveness of Kotlin it's not really any more verbose than something like PHP or Ruby but it's far more powerful and robust.

Agree that PHP, Python and Ruby Web Frameworks lack modern features. Have you tried Elixir + Phoenix?

Re: A look at modern PHP

#44

Many of the features highlighted in that article as "new" are from PHP 5.x, so it reads more like a list written by someone who has been out of touch with PHP development for a number of years.

Did you actually read the article or just the headings? Any features that pre-date 7.x are discussed as being 5.x features and, where applicable, the author expands on how it's been further refined / improved upon in 7.x releases

Re: A look at modern PHP

#45

Whether you like or hate PHP, it has achieved something that no other language has done - made it easy to host a dynamic website or app on the server. Other languages may claim to be 'web-friendly' (e.g. Python, Ruby) but when it comes to ease of deployment, they are anything but 'web-friendly' or easy. This is what programmer and blogger Jeff Atwood - who isn't a fan of PHP - has written about PHP: "If you want to p…

>If you want to get your customers to self-install your software as painlessly as possible, what other language can match or exceed the ease of deployment of PHP?

Anything with containers. Docker was a real game-changer here.

Re: A look at modern PHP

#48

Earlier quoted context omitted.

you can run PHP pretty much anywhere, even the cheapest VPS probably has PHP, as well as all managed hosting. For python, go or other languages it can be more tricky if you're looking for cheap hosting / VPS

With docker containers and the numerous PaaS/FaaS runtimes, does that really matter? You can run anything just about anywhere these days, cheaply or even for free.

Yes it matters. This is often unessecary maintenance overhead.

Re: A look at modern PHP

#49
post #33
post #10

I've worked with PHP since 5.4, and to me the language has not been the obstacle, it has been my own skill-level that has held me back, and still is - I lack very much the core architectural skills in getting forward as a developer, among many other things. I've seen some codebases using an even older version, and I think I can understand where people are coming from with their angst towards the language - but I thin…

I got back into web development in the last year or so. Previously I did mostly Python/Django and then 5 years of something unrelated to dev. Now I'm working in a fairly typical PHP/Wordpress mixed joint, and now I understand why PHP has the bad rep - because it allows/tolerates/even encourages bad practices (and beyond the usual "shoot yourself in the leg" we can see in other popular/common languages). And I guess t…

The thing I hate about php is the inconsistency and unpredictability for new-to-php developers.

camelCase? snake_case? nocase? Who knows what the global function will be.

And who knows what order the arguments should go in. Sometimes the array is first, sometimes not (in array iterating functions like map).

The thing that got my goat the most however was that referencing an undefined variable merely caused a warning, but referencing an undefined key in an array borked it.

And what's with arrays and maps being the same thing?!

Re: A look at modern PHP

#50
post #14

Even with PHP7, PHP still feels like it is playing catch up. There is nothing new or revolutionary in PHP7, just adopting features present in other major languages. Adopting as other newer languages like Go and Rust seems to be moving beyond those features. A catch up into a world that's on its way out, if one will feel so blunt. PHP's raison d'être remains its ease of getting an instance running on a webserver. But…

PHP still remains incredibly accessible, the documentation and legacy of problem solving means you can find help for any problem you'll encounter and the lack of complicated tooling makes it easy to focus on the problems that matter.

There is also a maturity in the tooling and community for PHP that doesn't exist in newer, better languages. There's no shortage of developers, and moreso nowadays there's also a huge body of best practices that embody good software engineering.

If what you want is a monolithic standalone web application paired with SQL, I'd argue PHP is a pragmatic choice from a business point of view. I would also argue that a monolithic web application is all the vast majority of companies need.

The biggest source of bad software and failing to meet business requirements in my experience has been following the industry's whim and rebuilding every time the wind blows in a new tech stack. If you're a PHP shop delivering web applications, you will be able to do that successfully for years to come. Picking the "right" language is a wild goose chase, just be good at the language you choose and you'll be able to deliver good software reliably.

Post reply on HN