Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

431–440 of 468 posts

Re: PHP is worth learning and using

#431
post #323

Earlier quoted context omitted.

I'd be interested to know what you think PHP got wrong with respect to web development? The majority of the web is running on PHP to this day, so at least in terms of popularity it seems people don't feel this way generally. Furthermore, if one were philosophically-minded, it could be argued that PHP's "shared nothing/one thread per page" execution model is the very quintessence of HTTP.

It‘s also the essence of "serverless" so that model seems almost prescient.

Except Erlang (and nowadays Elixir as well) has that for 30+ years already and it's done much better -- one green thread per request, and you can have 200,000+ of them at the same time on some fairly modest hosts, without any of them stealing run time from the others (as much as the hardware allows, of course).

PHP's "prescient" model demanded one OS process per request which is frankly absurd and I don't get how anyone views PHP in serious light because of this single fact alone.

Re: PHP is worth learning and using

#432
post #162

Earlier quoted context omitted.

I'm not sure I'd build a website or something with R Have you played with Shiny (shiny.rstudio.com). If you're building a website for interactive data exploration and analysis, it is very hard to beat.

I have. Guess I haven't tried to build something bigger with it. Seemed to me to be mostly something to share visualisations, not for building say, a whole CRUD site Rails or Django-style.

You're right - in my experience it's great for, say, creating an online calculator/simulator for something specific but it too fast becomes difficult when you started trying to add features like SSO, persistence etc.

Re: PHP is worth learning and using

#433
post #12
post #3

This seems like a desperate attempt to justify not moving on from a language whose death knell rang a long time ago. You might as well try to convince me I should start my next business with cutting edge software written in Fortran or COBOL.

Here’s something to think about: You and some buddies start a startup whose product is a complicated piece of medical software that uses Tensorflow’s inference but most of it is written in Go. Cool stuff, you’d never do that in PHP. You’re getting ready to launch, and you’re going to need a marketing site and a site with documentation and help articles for users. Do you write that site in Go? Hell no. You hire someon…

There must be a reason why most languages don't have single good self-hosted CMS and PHP has like 8 really good ones with thriving markets behind them.

I mean most of the marketing websites are build with such PHP tools.

Re: PHP is worth learning and using

#434
post #327

Earlier quoted context omitted.

If you don’t manage your own servers I don’t think you can call yourself a professional developer. “My hosting provider doesn’t let me do X” is a lame excuse with cloud servers in the $10/mo range. I do a lot of work with PHP, both legacy and new code. The number one mistake I see with PHP sites set up by amateurs or cheap hosting services is running Apache+PHP on the same server as MySQL or Postgres. Separate those…

That sounds about as nonsensical as saying "If you don‘t draw your own icons I don't think you can call yourself a professional developer". Very few developers actually do both of those things. If you said "If you couldn‘t learn how to run your own servers…" I could possibly see that.

The distinction I was making was between companies, teams, developers who use cheap hosting services and then bash PHP when the problem is they don’t control the hosting environment. “I can’t change my PHP or Apache config because I pay $5/mo to HostGator” is not a good reason to complain about PHP.

Re: PHP is worth learning and using

#435

Earlier quoted context omitted.

If you don’t manage your own servers I don’t think you can call yourself a professional developer. “My hosting provider doesn’t let me do X” is a lame excuse with cloud servers in the $10/mo range. I do a lot of work with PHP, both legacy and new code. The number one mistake I see with PHP sites set up by amateurs or cheap hosting services is running Apache+PHP on the same server as MySQL or Postgres. Separate those…

> If you don’t manage your own servers I don’t think you can call yourself a professional developer. “My hosting provider doesn’t let me do X” is a lame excuse with cloud servers in the $10/mo range. Hosting (as a service, and shared hosting) is a very complicated business if you want to do it right. Also, when picking hosting providers, there are many things that factor into this. Social, political, and economic sta…

Yes, hosting can get complicated. A production web site should run in a production-quality environment, not on some $5/mo shared setup that doesn’t let you control the PHP/Apache/nginx environment. If that’s your setup you will run into issues eventually, just like you would if you couldn’t change the settings on your work computer.

Re: PHP is worth learning and using

#437

I have used PHP for years. Like it. Have accomplished some nice things with it. Think it's evolved nicely in recent years. Feel it's a great tool for particular problems. Will continue to use it. Will always be open to alternatives. Will never understand why some people find that so offensive and will tell you that you mustn't use it or imply that you are ignorant or stupid for using it.

Here's a choose your own adventure for people new to the field. Pick something you want to build, then see which languages are the best suited. If you want to build several things, see which languages are the most recurring and versatile: - Web frontend: Javascript/TypeScript - Web backend: Javascript/TypeScript, Python - Performant backend (where you manage threads and queues): Go, Java, Rust - Machine learning: Pyt…

I'll take anything on that list with static typing, and discard the rest. I've certainly enjoyed many of those languages but I wouldn't build anything with dynamically typed language unless I were forced to.

Re: PHP is worth learning and using

#438
post #323

Earlier quoted context omitted.

It‘s also the essence of "serverless" so that model seems almost prescient.

Except Erlang (and nowadays Elixir as well) has that for 30+ years already and it's done much better -- one green thread per request, and you can have 200,000+ of them at the same time on some fairly modest hosts, without any of them stealing run time from the others (as much as the hardware allows, of course). PHP's "prescient" model demanded one OS process per request which is frankly absurd and I don't get how any…

Now think about how many companies/products need the power of Erlang vs PHP where PHP has more tooling, better ecosystem and far more available talent to choose from. Just because Erlang can perform better doesn't mean it is the right tool for the job. Performance is one aspect and PHP is good enough for lot of use cases while it has tons of other advantages that Erlang doesn't.

Re: PHP is worth learning and using

#439

Earlier quoted context omitted.

I like PHP and still use it today. But never in my life heard PHP is cool. Am I missing something?

Well, early 2000s it was definitely cool. Using ASP and want to calculate an MD5? Oh, you need to pay an add-on for that. Want to send an email? Ditto. Then there was PHP, with all included (and cheaper hosting, because Linux). I started working on a web shop and after a month ASP was legacy and PHP the new cool thing, together with MySQL instead of using... Access as "database" in ASP.

"Access as database in ASP"

haha. My first ever project as an intern in 2004 was exactly this.

Re: PHP is worth learning and using

#440

Earlier quoted context omitted.

Except Erlang (and nowadays Elixir as well) has that for 30+ years already and it's done much better -- one green thread per request, and you can have 200,000+ of them at the same time on some fairly modest hosts, without any of them stealing run time from the others (as much as the hardware allows, of course). PHP's "prescient" model demanded one OS process per request which is frankly absurd and I don't get how any…

Now think about how many companies/products need the power of Erlang vs PHP where PHP has more tooling, better ecosystem and far more available talent to choose from. Just because Erlang can perform better doesn't mean it is the right tool for the job. Performance is one aspect and PHP is good enough for lot of use cases while it has tons of other advantages that Erlang doesn't.

Not performance per se. It's a much more robust model of work that in addition is sipping hardware resources more efficiently (so DoS attacks from one user to all others are hard).

"How many companies need X" is not a discussion, it's an exchange of opinions and won't ever go anywhere, so I refuse to start it.

I was merely responding to the claim that PHP had "prescient" ideas. It didn't.

Post reply on HN