Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

311–320 of 468 posts

Re: PHP is worth learning and using

#311
post #141

Earlier quoted context omitted.

Why would you pick any other language instead of PHP for web dev?

Is there now a reliable non-hacky way to do threads or async, to run queries to multiple dbs or backend systems simultaneously in PHP?

Other than the semi-hacky pclose(popen(call to db))? Not really.

Re: PHP is worth learning and using

#312

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…

> 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 status are one thing (of the dev and the client). Another thing that comes to mind is the client's (or sometimes even dev's) location/jurisdiction (or the website's audience).

The availability/locality plays a giant role in selection in non-western countries. For example, some European countries/ISPS have super-fast internet within them or up to the closest IX (internet exchange), but horrendous speeds towards anything beyond the IX; sometimes these are intentional (alas, curse politics) sometimes they're not.

We had many clients that would migrate to us because they had these issues with previous providers because we were different from other hosting providers.

Disclaimer: I used to work for a hosting company

Re: PHP is worth learning and using

#313
post #258

You guys think a hell of a lot about your hammers It's a tool, use it or don't. Why do we have this weird slap fight every 2 months? It's so weird

I haven't commented on this thread until now (I left PHP so many years ago, I have nothing to add) but are you suggesting to never discuss with other peers about the available tools for the job? Could you be more specific on your proposal?

Re: PHP is worth learning and using

#314

PHP is a lot better. But it still has a lot of the same old issues when you look beneath the service. Good luck remembering what all the str* functions they invented do and what order their arguments are in. Same for the array functions (don't get me started on implode's three signatures - but that's mostly fixed in 8!). And may His Noodly Appendages help you if you come across a function being used which has no docu…

The argument order flaw is never going away. BC. It's a super minor thing.

The non-documented functions are often rare and very minor and obivous functions.

This layering framework on top of frameworks sounds made up. Mostly people either use Symfony or Laravel. There aren't layers of frameworks. Your example is nonsensical. Frameworks are slower than simple code, this is true for every language.

And Symfony and Laravel are both well documented.

This comment overall seems to be written by someone who has come in with very little knowledge on PHP worked on a project for 3-4 months. When you work those style projects you're often working on poorly constructed projects. I'm pretty sure I can jump in on a project written in any language that has been poorly constructed and I will end up going wtf.

Re: PHP is worth learning and using

#315
post #236

Earlier quoted context omitted.

When you start on a minimal server installation setting up LAMP to the point that wordpress doesn't complain is just as much work as setting up RVM/Node and Passenger to run whatever language you want.

All shared hosts already come with LAMP pre-configured. You just plug already supplied credentials into the WordPress setup page and that's it.

So does ex. heroku for all the other languages, and that actually scales. As well as most shared hosters offering node and rails.

Don't get me wrong, my whole point is that this 'simplicity' is given in any ecosystem these days.

Except live coding via FTP is something you consider part of the simplicity, then you are stuck with PHP :)

Re: PHP is worth learning and using

#316
post #63

Earlier quoted context omitted.

Ya, but PHP is actually still being used in a lot of agencies and in certain types of work. Far more than elixer and rust, probably just below ruby. Also I wasn't pointing out what you say, you're reading into it a bit. I haven't used PHP in a long ass time. But it seems like not a bad choice for certain markets, at least as much as Python and Ruby imo

Compare what the PHP jobs pay or the career path they put you on compared to elixir or ruby. Not even the same ball park. Not even the same sport.

I bill £650 a day for 'PHP development'.

What is this out of the park career path I'd have had choosing ruby? Can you share some more details?

Almost the best advice I can give to a developer is stop being fixated on language, and start being fixated on how to solve business problems, on communicating coherently (and like a human being), and being able to quickly grok complexity. The language you program in is almost the least important part of the offer (as long as you're competent in it)

Re: PHP is worth learning and using

#317

Earlier quoted context omitted.

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 can't think of a single in-use tech/language that does not have a lot of complexities. And by definition, these will almost certainly be 'hidden complexities' for someone coming in to that ecosystem. What's been useful about PHP (and many other stacks) is that the good ideas from other worlds usually get assimilated in over time. PHP is not always at the bleeding edge with respect to language development, but that'…

> I can't think of a single in-use tech/language that does not have a lot of complexities. And by definition, these will almost certainly be 'hidden complexities' for someone coming in to that ecosystem.

You're 100% right.

My original comment focuses on PHP because I was specifically addressing the "PHP is the easiest to develop in" idea.

I realise that it might seem a bit too critical maybe because PHP was the only topic in it, but I didn't mean it to come off like that. Hopefully I redeemed PHP a little bit in the follow-up comment! :D

At the end of the day: every ecosystem/language has its own "that shadowy place over there" :P

Re: PHP is worth learning and using

#318

Hmmm... Most points in this article are shouting "yeah we have those too!!" but it didn't give any convincing arguments why I (or anybody who doesn't already know PHP) would like to learn and use PHP over other decent modern languages and ecosystems, which happen to have those points as well.

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)

That's not quite a language feature though: one can write (Fast)CGI or similar programs in any common language.

Re: PHP is worth learning and using

#319
The only argument is: you can deploy your PHP app on any 1$ shared hosting plan. Just copy the files and you’re done.

And yes, PHP is not as bad as it used to be anymore.

Apart from that, I don’t see a lot of benefits.

Re: PHP is worth learning and using

#320
post #242

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.

Oh well we are about to break most of said 10 year old web sites. Particularly, PHP 8.1 has some changes that low key force people to update, such as the use of return types when extending a built-in classes ( https://php.watch/versions/8.1/internal-method-return-types ).

Yeah, the area between "backwards compatibility at all costs" and "progress" is full of potholes. I think PHP was to mach on the "backwards compat." site of that gradient, I think that some bc breaks are onavoidable when improving the language itself and its standard library. Sure, it would be nice to have something like rusts "editions" (and I am sure other languages share that concept to some degree) where we could have the runtime support all code that was valid before, but that comes with its own complexity.

As someone who still owns their rent coding PHP, I really enjoy the development of the language from php 7 onwards. It certainly feels better in any way compared to the 5.x or even 4.x days.

As long as we do not get another python 2 vs 3 disaster, I am happy.

Post reply on HN