Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

371–380 of 468 posts

Re: PHP is worth learning and using

#371

Earlier quoted context omitted.

OP 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.

Sure, 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.

Odd, I'm getting Perl/CGI gigs still. I should tell them to rewrite to...what's cool now?

Re: PHP is worth learning and using

#372

PHP is great as long as you accept it 100% for what it is - a shitty language.

Have you used a version of php from the past decade? Or are you conflating a bad framework or codebase with a bad language?

Yes, it's like an old Model T Ford from the early 1900s that has had a turbocharger, air conditioning, a new stereo, a subwoofer, roof rack for a bike, roof rack for a tent, grounding straps, trailer hookup, clean water system, etc.. bolted onto it.

At some point you ask yourself - why did I do all of this to a Model T? Sure, it has some modern facilities but the language itself was never designed and so none of it feels cohesive. The syntax is off-putting. It's just a ton of nightmare for what reason? Why? There are so many other languages to choose from and PHP has no competitive advantage other than $3/mo GoDaddy hosting.

Re: PHP is worth learning and using

#373
I've never regretted the time I took to learn PHP. No matter how bad the language may seem, it paid my bills for a long while. It's one those tools that to keep in your back pocket until you need. Keep in mind what it's good for and what it doesn't do so well.

That said, php's online documentation is one of my "gold standards" for what good language documentation should provide. (At least it was the last time I had to reference it.)

Re: PHP is worth learning and using

#374
post #287

Earlier quoted context omitted.

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.

Good point, but just to nitpick: I think that ipfs-js let's your external server be a process in someone else's browser, which is about as unserverlike as servers get.

Re: PHP is worth learning and using

#375

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.

I've used php extensively in the past decade. You could kinda of say your argument about any modern web language. If I'm already comfortable in php, .net, node, ruby, or heck even java, for making a web app, do I really "need" to learn another? Not really. Every one has a different way of doing things, sure, not every different thing is better, but it is different. I think just people like to learn about multiple, but sure, you can always be stubborn and stick with your single hammer.

The two things I can think of quickly, that I like about php, over another, is the ease of code->browser. You have to manage 0 build configurations or pipelines to get what you want working. Just download the files and open a browser. The second, is 100% transparency with third party libraries. Because of the lack of ability to compile, when I download a third party library, I'm getting their actual true source, and can much easier, navigate and understand the library right through the ide, without having to read a bunch of docs online and that it's true to source. Being able to control click into third party libraries is quite liberating.

Re: PHP is worth learning and using

#376

Earlier quoted context omitted.

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.

That 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.

Having a ci/cd pipeline is much different than having to setup and maintain local environment build pipelines.

Re: PHP is worth learning and using

#377

I've never regretted the time I took to learn PHP. No matter how bad the language may seem, it paid my bills for a long while. It's one those tools that to keep in your back pocket until you need. Keep in mind what it's good for and what it doesn't do so well. That said, php's online documentation is one of my "gold standards" for what good language documentation should provide. (At least it was the last time I had t…

I really like how the documentation also includes a huge amount of user contributed notes that demonstrate various alternate examples as pointing out certain caveats/nuances.

Re: PHP is worth learning and using

#378

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.

1. The develop-try cycle is fast: In PHP if you change some code it will be immediately visible - no server reload needed. That's because the "application" is reloaded at every web request. There is no application server.

2. The PHP ecosystem is quite mature, and packages are of good quality in general

3. Dependency management works well. You will rarely end up in a state where your dependencies are incompatible between each other (something that happen often with npm for instance)

4. It's faster than python/perl/ruby

Re: PHP is worth learning and using

#379
I am surprised when [1] Python or [2] Ruby is recommended over PHP at the very least from a performance standpoint. PHP has a lot of built in standard library utilities and it's execution model is so simple for both web applications and scripting system automation jobs.

[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

[2] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re: PHP is worth learning and using

#380
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…

The kind of optimizations you would do in an application server would prevent you from scaling pass a single server
Post reply on HN