Live data from Hacker News

PHP in 2019

stitcher.io

311–320 of 489 posts

Re: PHP in 2019

#311

Earlier quoted context omitted.

My issue with modern PHP is that it's essentially becoming Java. And with the JVM and the Java ecosystem, what is the compelling reason to not just pick Java at this point? With Java you are basically writing exactly what you would be writing with PHP, except with more language features and the ability to opt into other languages on the JVM like Kotlin and Scala. The modern additions are fantastic for projects and te…

Have you ever tried building, deploying and maintaining Java? There is more to a language than the syntax

I'm not one to proselytize since I use a handful of languages every day, but when my Java hat is on, I double click a build target, my software is tested, built, deployed side-by-side with my current production build.

New users are automatically pushed to the new build, and users with existing sessions remain on the previous build. When I undeploy the previous build, the rest of the users start seeing the new build as well.

That's all out of the box with small config tweaks for our environment. It is truly torturous.

Re: PHP in 2019

#312
post #127

Earlier quoted context omitted.

Django abstracts away a bit too much, if you ask me. For a simple REST API it's complete overkill. I prefer Flask or Falcon[0], in which you don't just get better performance[1] but also a lower level of control. [0] https://falconframework.org/ [1] https://klen.github.io/py-frameworks-bench/ or https://github.com/the-benchmarker/web-frameworks

I agree with your parent. When I started with (Python) webdev some years ago I picked Flask, but nowadays I use Django, as it has superb documentation and useful things built-in. In particular I miss the user-management, authentication and authorization in Flask. Personally I consider Django without any additional apps less complex than Flask with apps (or "plugins" in Flask jargon) to handle basic stuff like auth. I…

I started with Flask, moved to Django, and now at work am back on Flask. It all depends on what you are building; if you are going to need some ORM, standard auth, etc, Django is a no brainer. However if you are going to be building out much of your own idiosyncratic architecture, Flask gets out of your way and avoids including lots of things you don't need.

For performance, we are building some parts of our system with Clojure. It feels extremely well suited, albeit with some initial learning curve.

Re: PHP in 2019

#314
post #174

Earlier quoted context omitted.

Exactly. See: Wikipedia, Facebook, WordPress, etc. People talk crap about PHP but it is a workhorse of the web.

indeed. this is largely legacy, but good luck changing that. I can't say that i miss it much, but then I don't work for either of these 2 entities. I'm familiar with what you are speaking about, so I don't think the lack of respect stems from a general ignorance of what you are referring to. It's rather people who have interacted with PHP in the past and didn't enjoy the experience.

That's a fair point.

Re: PHP in 2019

#315

On one hand, I do see that HN (and probably Reddit) live in a bubble. Where most of the darling languages and tools have very low use in the real-world. And where most of the languages and tooling that actually run the real-world go un-discussed, or simply dismissed, because they're boring and don't appeal to students and entry-level devs working on side projects. I realize that the perspective most rookies get from…

Often when there is a post about PHP I read over these treads sort of subtly trying to figure out how a language with such a large user base has remained basically invisible to me. And I don't think I live in the HN bubble, though I do use a lot of Python, in my consulting work I've also done plenty of work with .NET, JVM to a lesser extent and other "boring" tech. But PHP has literally never come up, even as a sugge…

Right here! PHP and JS/TS is what I do every day.

PHP has its tentacles all over the web: WordPress and Drupal are immensely popular for simplistic sites and short-lived promotionals, Magento and WooCommerce attract many e-commerce users, and Symfony/Laravel handle the custom stuff. I've worked with all of these and have the scars to show for it.

All popular projects have swarms of consultants offering advice, prebuilt additions, and custom development. (E.g. WordPress plugins and themes are everywhere.) This is also a significant factor for the penny-pinching customer — from their point of view, they avoid vendor lock-in and expensive development this way. (Spoiler: it rarely works out, in the end. "Tower of Babylon" and "shallow learning curve" mix in very exciting ways.) So there are masses of people who know the basics of PHP and call themselves "PHP developers". In my opinion, just a fraction of them actually deserves that title.

Re: PHP in 2019

#316

Writing with PHP is better than ever... and getting better and better. And... you don't need too worry too much about the server, or the request lifecycle, or networking... you just write your app, in a language which is, in my opinion , going in the right direction with a stronger slant towards OOP and types. Of course it's still entirely possible to write garbage PHP code... but it's possible to write garbage in an…

My issue with modern PHP is that it's essentially becoming Java. And with the JVM and the Java ecosystem, what is the compelling reason to not just pick Java at this point? With Java you are basically writing exactly what you would be writing with PHP, except with more language features and the ability to opt into other languages on the JVM like Kotlin and Scala. The modern additions are fantastic for projects and te…

Interesting analogy, performance wise PHP has made impressive progress. On par with node and the JVM. But Java code specifically is just so bloated. And then there is the worker-per-request model in PHP - All resources isolated to a worker and cleanup on exit. This avoids global garbage collection freezes by design. Something you would get otherwise only from Elixir/Erlang natively. Compared to the JVM that allows PHP applications to scale vertically to any amount of RAM/CPU, and horizontally to any amount of machines. If you let me free choices I'll do Elixir all day long. But pressed on Java vs. PHP for a web app it's PHP for sure.

Re: PHP in 2019

#317

On one hand, I do see that HN (and probably Reddit) live in a bubble. Where most of the darling languages and tools have very low use in the real-world. And where most of the languages and tooling that actually run the real-world go un-discussed, or simply dismissed, because they're boring and don't appeal to students and entry-level devs working on side projects. I realize that the perspective most rookies get from…

Often when there is a post about PHP I read over these treads sort of subtly trying to figure out how a language with such a large user base has remained basically invisible to me. And I don't think I live in the HN bubble, though I do use a lot of Python, in my consulting work I've also done plenty of work with .NET, JVM to a lesser extent and other "boring" tech. But PHP has literally never come up, even as a sugge…

ever heard of Facebook? Slack? Etsy? WeWork? Box? Yelp? just to name a few.

Re: PHP in 2019

#318
> Back in the 5.* days, PHP's performance was… average at best.

Even with 5.* it very much depended how you used it. The real world scenario's. PHP functions are written in C. You could make great gains by leveraging on them. Using PHP as just the "glue" for a blazingly fast library (and templating engine) written in C.

Re: PHP in 2019

#319

On one hand, I do see that HN (and probably Reddit) live in a bubble. Where most of the darling languages and tools have very low use in the real-world. And where most of the languages and tooling that actually run the real-world go un-discussed, or simply dismissed, because they're boring and don't appeal to students and entry-level devs working on side projects. I realize that the perspective most rookies get from…

You make a sweeping statement about a bubble and then demonstrate the edge of yours: > The business world runs on Java, and .NET to a lesser extent. Flip those. > I just don't see any recruiter activity around PHP at all. This is probably true. My own anecdote: I'm at a primarily-PHP SaaS provider in a major tech hub, and for the couple hires we've made in the last year all of our applicants with extensive PHP experi…

> Flip those.

Nope. That's just incorrect. From Experian to JPMorgan Chase to Cambia Health to Amazon, Java is the typical case for every project. Look at stream processing tools at netflix via any given youtube presentation about stream processing. There are entire tooling segments where .NET is absent, despite their quality tools that run on Windows. Nobody trusts Windows by default and this has mortally wounded .NET

Re: PHP in 2019

#320
post #6

One of the main takeaways I got from the original Fractal of Bad Design post was the myriad of inconsistencies in both representation and execution of code. This was barely touched upon, mostly this post focused on how PHP has added features and ecosystem. But then so has Javascript.

Unfortunately this is true and it can't be changed, the functions are named and parameters are soemtimes inconsistent like strpos and str_replace, I would have to use the docs all the time if my IDE wouldn't show me the param names. But after you get productive with PHP there is no feature that I think I am missing from other similar languages.

Features that I miss in PHP:

- expressive type system with generics, union types, literal types, basically TypeScript. I can say "this function returns a string" or "this function returns an array", but not "this function returns an array of strings".

- specialized collection/hashmap data structures with good support across third-party libraries. Having one array() structure acting as both a sequence and an associative array at the same time is awful.

- a templating solution similar to JSX. I am spoiled by TypeScript's ability to typecheck my HTML views along with other code.

Post reply on HN