Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

321–330 of 468 posts

Re: PHP is worth learning and using

#321

Earlier quoted context omitted.

I used to believe this, but... But that's just not true. All the things you mentioned are a yum/apt/nix/pacman/ install away on Linux, and probably as simple to install on macOS. I'm sure Windows has installers for these, too. So, it's no harder to develop in them than it is in PHP. You could argue it's cheaper because you don't have to pay for a shared hosting provider to host your files. However that's a bit moot s…

I went on a rant, but didn't mean to. I don't have anything against PHP, it's got a valuable and relevant place on the the web. It's important to many people, and like you said you find it fun, which I think is important for our productivity as devs. However, I think this recurring misconceptions how easy PHP is to develop in needs to stop. PHP comes with a lot of complexities. Worst kind of complexity to learn: hidd…

I think fun is important but I see nodejs and rails as equal to php in the easy and fun part. Maybe python too, have not used it enough.

If we are talking about building large web applications then performance, maintainability and other things may start to be more important than fun and then c#, java, go and others can be really good solutions.

Re: PHP is worth learning and using

#322

Earlier quoted context omitted.

My favorite thing about PHP is the execution model. Every single request is brand new and runs the whole program start to finish. IMO that's extremely powerful in its simplicity and while you can get it in other languages, it feels like like a "core competency" for PHP (just like how async code is easier in javascript than in python, because JS kind of had it from day 1)

Forgive me for going a little off topic here but is it really true that JS was async-friendly from day 1? When I started using JS seriously 8 years ago, async code was horrible (callback hell, etc.) The web standards guys retrofitted native async way after the matter.

Doesn‘t this more or less mean "the only execution environment is event based, has a run loop outside of your control and calls your code whenever it wants" and "there is no busy sleep". So it was callback based from day one. Is that the same as async? I think it is?

Re: PHP is worth learning and using

#323
post #43

Earlier quoted context omitted.

I haven’t used PHP in over a decade. I can never forgot how much PHP got wrong in terms of how application development on the internet would happen. The ergonomics of using it were just… bad compared to other frameworks that came on the market. I remember when rails came out and it was so mind blowing compared to PHP. The language was certainly useful for a time, and I’m sure the language has progressed since, but sw…

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.

Re: PHP is worth learning and using

#324

Hey if you don't like PHP please don't use it. I 'd hate to bring the culture of tiny packages, fake compilers, transpilers and weekly trends to PHP. Personally I use php because it works well and fast and still supports my 10 year old websites, not because it's cool.

Php change from 4.x to 5.x broke my web sites and I still don't trust php after that. I guess they might do it again from 7.x to 8.x, we'll see.

If having the same code working for a long time is the most important for you then you should probably use java or .net. Maybe c++ also but that is not as popular for building web apps.

Re: PHP is worth learning and using

#325

Earlier quoted context omitted.

Good jobs though? Lots of PHP jobs in Canada, but the salary is nearly universally always laughably low.

IDK what is a good salary in US/Canada, I live in European Union. My salary as WordPress developer is more than 4,5k USD/month and I see job offers with 8k USD as well (still for WP developers, this is my specialization and I know this field the most; I expect for better recognized PHP fields like modern frameworks like Laravel it could be more) And yes, 4,5k USD/month is massively good salary for Europe. On the othe…

I don't think salaries across Europe are comparable. There are huge discrepancies between locations.

For example, in Berlin it seems to me that average salaries are around 70k EUR/year (6.6k USD/month) and really good salaries are well above 90k EUR/year (8.5k USD/month).

You can see more data in https://www.levels.fyi, which it is skewed to the high side, but gives you an idea about what good offers are nowadays.

Re: PHP is worth learning and using

#326
post #287

Earlier quoted context omitted.

My favorite thing about PHP is the execution model. Every single request is brand new and runs the whole program start to finish. IMO that's extremely powerful in its simplicity and while you can get it in other languages, it feels like like a "core competency" for PHP (just like how async code is easier in javascript than in python, because JS kind of had it from day 1)

I see this as the opposite and find it adds quite a load of complexity and prevent to do some form of optimization in an app that has its own server. It adds its load of complexity on how to run the apps itself, you need an external server, apps often requiring some customization of the server that will run it (either mod-php or php-fpm). It means that parts of our app settings lives outside of the app, it also make…

I don't find this to be true at all.

> you need an external server

Spoiler, you need an external server for everything on the web; you've just been brainwashed to think serverless is actually that.

Re: PHP is worth learning and using

#327

Earlier quoted context omitted.

I used to believe this, but... But that's just not true. All the things you mentioned are a yum/apt/nix/pacman/ install away on Linux, and probably as simple to install on macOS. I'm sure Windows has installers for these, too. So, it's no harder to develop in them than it is in PHP. You could argue it's cheaper because you don't have to pay for a shared hosting provider to host your files. However that's a bit moot s…

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.

Re: PHP is worth learning and using

#328
This actually convinced me that PHP isn't as bad as it used to be. Though it's still not all that inviting, knowing Python, Typescript, F# etc...

From Pyjokes: Coding in PHP is like peeing in a swimming pool. Everybody has done it, but it's best not to talk about it.

Re: PHP is worth learning and using

#330
I learned web programming on PHP, and a ton of anti-patterns well. Making a single script with a very rich stdlib is quite handy, as well as "just running it" on your desktop instantly. However scaling out large projects in a performant way, doing big refactors, or mature server programming, I'd pick nearly any other tool today.

Disclaimer: I still maintain my PHP site from '08, so I'm current on trends.

Post reply on HN