4 ms·
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
by spoiler 5y ago
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 since even back in the day there were LAMP stack Vagrantfiles that would automate this local setup.
Also, when speaking about dev velocity or time-to-start: you forgot JavaScript, which probably has much greater development velocity than anything else.
Furthermore, PHP is rarely just PHP in production. PHP also comes with various runtime modes (CGI, FPM, etc), .htaccess rules (or nginx equivalents), a bunch of runtime language and feature toggles that are partially controlled by the system (ie your hosting provider), and some can be controlled by the application.
The ephemeral process nature of the language makes some tasks very difficult to do in a performant way (but there's caching, so that's at least mitigated).
I've seen so many developers (worked for a hosting company) come complain to us about slow servers when in fact they'd just be doing silly stuff. And it was hard to blame them, because the language encourages that model, and the "performant" was was usually orders of magnitude more difficult to implement (ie indexing, image resizing, or most types of batch processing).
I'll not go into the horrors of how easy it is to mishandle file uploads in PHP (there's plenty of those around) and how many times people got easily hacked this way.
- spoiler 5y agoI 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: hidden complexity.
- gregjor 5y agoOne person’s complexity is another person’s valuable job skill. PHP and Apache aren’t hard to setup and configure if you know how it works.
- spoiler 5y agoI completely agree that being able to navigate an ecosystem's complexity is a skill. I didn't mean to imply that other languages don't have complexities. All ecosystems come with their own boons and complexity issues (hidden or upfront). The thing I wanted to address is the general idea of "PHP is the simplest to develop in, it's just uploading a file" (paraphrasing) shouldn't be taken at face value, and that's why I pointed out some of the complexities when working with PHP that PHP developers tend to forget (or some ignore). But, because PHP is so easy to get started with, a lot of the complexity initially gets hidden away, and sometimes people learn about it the hard way. JavaScript used to be much the same, but it has gotten better in the recent years. Maybe PHP has gotten better in this aspect too, but I could be ignorant because I've not been keeping up with PHP as much
- gregjor 5y agoWith a hosting provider that already has PHP installed, you can simply upload a file to a folder and serve it over the web with no special expertise. PHP makes it easy for beginners and amateur programmers to get something working without knowing much. Because of the low-barrier to entry and simple hosting setup people have written a lot of crap PHP code over the years. I know, I see it and work with it. Amateurs and well-meaning power-users can get some web pages up and running easier with PHP than with almost anything else, so while inexperienced programmers can write bad code in any language a large number of them choose PHP. None of those facts mean PHP is not suitable for "real" development and "real" programmers. It is not obsolete or dying. A professional programmer who knows how to build production-quality web sites can get great results from PHP. That requires putting in the same time and effort needed to learn any other language and set of tools.
- mgkimsal 5y agoI 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's just fine. The PHP ecosystems often adopt/adapt useful ideas/techniques from other ecosystems relatively rapidly, and that's just fine too.
- spoiler 5y ago> 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
- jbergens 5y agoI 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.
- Ayesh 5y ago> The ephemeral process nature of the language makes some tasks very difficult to do in a performant way (but there's caching, so that's at least mitigated). I'd rather say that this is actually one of the biggest selling points for PHP. Opcache and JIT works great, and reduces the overhead, but ironically, PHP is great for serverless applications.
- zzt123 5y agoYour comment on file uploads in PHP reminded me of the remote code execution via automatic file metadata parsing vulnerability built into PHP that happened a couple years ago.
- gregjor 5y agoIf 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 and performance and stability problems go away. That’s because relational databases consume as much memory as they can get, not because PHP is inherently slow or unstable.
- deleted 5y ago[deleted]
- blackbrokkoli 5y agoThis is the classic "everyone who does not know how to X is not a real Y". Every single software dev can make such a list. Very few reflect on the fact that no two of those lists look the same. You can't know everything. Programming is about abstraction; so abstracting away devops is a feature (in some contexts), lack of that is a downside (in some contexts).
- gregjor 5y agoNo one can know everything. We can all learn things we need to know. Or we can post about how something we don’t know is gross, complicated, broken.
- spoiler 5y ago> 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