5 ms·
The best part of PHP is the development model. You copy some files to a server, and load the page. That's it. It is really hard to beat how easy it is to iterat
by nick0garvey 5y ago
The best part of PHP is the development model. You copy some files to a server, and load the page. That's it. It is really hard to beat how easy it is to iterate, even if the language is truly terrible.
- spoiler 5y agoI don't see how that makes the development cycle any better. I can just edit a file, press save, and it compiles and tests run automatically. If I'm doing something in interpreted languages, the code updates in memory. Furthermore if I'm working with JS/TS, hot reloading even makes it so I don't even need to refresh the page. I can even inject code into arbitrary places with the debugger (as if I'm editing the source)! So, all these other ecosystems are on par with the PHP... I'm glad PHP adopting ideas from other communities, and that the community is becoming more cohesive, though. Aside: I used to write PHP before (back in the 3 to 5 days), and worked for a big web hosting provider that had a big shared hosting customer base; PHP was by far the most popular technology in that space.So, I'm not trying to bash on PHP.
- deleted 5y ago[deleted]
- jeroenhd 5y agoJavascript has come a long way, but I think there's still a different. With PHP, you install the toolchain, save a file and the page becomes available. With JS/TS, you install the toolchain, and then enter a complicated process of yarn/npm incantations in the command line to get the project working right. The manual may say "yarn add typescript" but in practice there's always more setup and configuration to be done before it works well. For "real" projects, there's not that much of a difference between yarn and composer. For getting started, though, the process is a lot more involved. Another problem is that running Javascript on the backend is almost completely different from normal frontend development. If you want to store state, you end up using the same (or even worse, a similar) programming language with completely different contexts and available libraries and methods. You can't document.createElement in the backend to tell the user that an operation succeeded or failed, even though that's what you'd do if you were working on a frontend file. With PHP, you can't do frontend, so whenever you write frontend code, you can't get confused. In my opinion, this makes learning PHP backend dev a lot easier. It's only natural that you choose to continue working in the language you've started you development career in. You can see that by the fact that there are still people who swear by VB.NET, despite everything. The JS ecosystem does have the advantage of coming with a debugger, but PHP users can get the same by hooking their PHP install into the PHPStorm debugger. I think it doesn't matter much which language you use at that point, it's just a tooling preference. All in all, I think both languages have their uses. If PHP really was as bad as people say it is, it would've died out already.
- skinkestek 5y agoI have seen people deploy php this way but I'm not aware of anyone who'd do it today. Locally however it is save, alt-tab, ctrl-r and immediately you see the result. Absolutely no waiting. These days I rather use Quarkus for this but until Quarkus arrived this was a huge advantage that PHP had over every other language and framework I was aware of. Also the documentation was fantastic compared to most of the stuff I have had to suffer through on Java, .Net and even React and Angular. Every thing you may reasonably wonder about was described in a clear, straight forward way and included examples.
- jonwinstanley 5y agoI deploy with a git pull Which I suppose is just a fancy way of a copying files to the server.
- herbst 5y agoSame. And git doesn't care if I add a build process or not, or which language I am pushing.
- motogpjimbo 5y agoSame. Our Node applications can take up to 10 minutes to build and deploy from a pipeline, but our PHP applications are deployed in <2 seconds by executing `git pull` on a VM.
- skinkestek 5y agoIt is kind of just a fancy way to copy but at the same time gives you versioned deployments, rollbacks etc.
- theov 5y agoI use PHP this way and I think it's great :)
- makeitdouble 5y agoThat ship has sailed a long time ago (or you're just playing around and most languages will have a REPL nowadays) Modern PHP wears a business suit and wants to buddy the "big boys" (Java/C#) of the world. You'll have deployment pipelines, strong push towards classic OOP, strict type checking etc. I personally think ruby for instance is leaner in its dev process in most real world projects.
- chinathrow 5y agoOP is correct, you still can develop like this with PHP, and no the ship has not sailed for many. You can have deployment pipelines etc, but if you like, you can still develop the ancient way - it still works.
- makeitdouble 5y agoSure, but would you have that in production for the company you work for? One can also use old school CGI to serve their site, it’s super lightweight and you just upload the file at the right place, for almost any language. But that has been deprecated for the last 2 decades now.
- djbusby 5y agoOdd, I'm getting Perl/CGI gigs still. I should tell them to rewrite to...what's cool now?
- makeitdouble 5y agoI see a number artisans managing their business on pen and paper, and handwrite receipts. It works for them, but I wont tell random people starting a business now to go with pen and paper, 99% of the time that would be a bad advice when there are much much better alternatives now.
- datenarsch 5y agoWell I can still develop like this in ASP.NET if I wanted to and probably and many other languages/frameworks too, so it's not exactly unique.
- mschuster91 5y ago> even if the language is truly terrible. PHP already has caught up to others with 5.6, these days PHP 8 doesn't lack anything found in other major languages. What is still confusing is the standard library, but only for people who never worked with C/C++ before - as most of the native PHP standard library actually originates as a verbatim copy of the C/C++ libraries.