Live data from Hacker News

A look at modern PHP

lwn.net

51–60 of 610 posts

Re: A look at modern PHP

#51
Depicts language feature, PHP ecosystem is dying. For me, an example is latest MediaWiki syntax highlight extension dropped GeSHi (PHP) which is not updated anymore, to pygments (Python) using a sub process.

I realized I have to drop MediaWiki because my host didn't expose PHP proc_open() feature.

I don't even know where to start. A natively written syntax highlighter can be considered as an important brick in an ecosystem (GeSHi was used everywhere few years ago), but it looks like no-one is working on it anymore so MediaWiki did an strong technological move to use Python via a sub process.

This kind of move (dropping a existing natively written tool for a tool from another language) shows how bad the ecosystem situation is.

Re: A look at modern PHP

#52

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?

Elixir and Phoenix look very appealing but I'm very firmly in the strong static typing camp.

Re: A look at modern PHP

#53
post #48

Earlier quoted context omitted.

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.

A docker container is more overhead than managing your own VPC?

Re: A look at modern PHP

#54
post #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.

Kotlin native might eventually make the JVM superfluous but for now there are a lot of benefits to being on the JVM including great performance, a huge ecosystem of Java libraries, and very battle hardened monitoring and debugging tools.

Re: A look at modern PHP

#55

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.

What do you mean by concurrency here? JS like async or Java/C# like threads? And why would concurrency help in problems where PHP is involved, in the problems I solve with PHP I don't think I ever needed async. For unning more things in parallel like processing 1000 RSS feeds you can spawn 10 scripts that run in parallel and if one crashes the others still continue to work(I had experienced crashes with some RSS XML files crashing the built-in XML parser).

Re: A look at modern PHP

#56

Earlier quoted context omitted.

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…

Who's doing that anymore? Either you (or your staff) are technical enough to manage installing a web framework on a server, or you use any of the numerous managed sites instead. (Squarespace, Wix, Webflow, Wordpress.com, Shopify, Facebook, etc)

The last thing a non-techie business owner needs is to worry about setting up a random server with bad PHP code.

Re: A look at modern PHP

#57
Never worked in PHP, but I watched this talk, "Let's program like it's 1999", about PHP's influence on JSX and React. I quite enjoyed the talk.

Re: A look at modern PHP

#58
post #47

If you're starting with WebDev in 2020, choose Go or Rust. Concurrency & safety + simple deployable static ELF binaries > weak typing and legacy bloat.

rust has huge mental overhead for most webdev work

go is incredibly weak language in some regards (error handling?)

From these 3 I would still pick PHP for webdev.

Re: A look at modern PHP

#59
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…

Most of the time you do not chose a language or ecosystem because it has some cool syntax or some new feature. As an example if you need to do X you look at what solves X the best, if I can do X by installing say ffmpeg and write a bash script I will do that and not cry that bash does not have some cool feature. I think languages like PHP, Java, C++ appeal for people that solve hard problem where the fact that you ha…

[deleted]

Re: A look at modern PHP

#60

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.

But in the overall scheme of things it's order of magnitudes more difficult to deploy. PHP is upload a file whereas docker requires many more steps (for example: https://kb.sloppy.io/en/collections/156106-getting-started )
Post reply on HN