Live data from Hacker News

PHP in 2022

stitcher.io

131–140 of 318 posts

Re: PHP in 2022

#131
post #74

I learned to use php when I was like 14. I’m 27 now and still derive such joy when making my own little projects that will never see the light of day. I try to be humble as far as just being a php trash coder, but I don’t feel too ashamed honestly, as it is the most mainstream thing really. I will always be grateful to php for being accessible and yeah, I guess easy. I don’t know why php is the only one I really stuc…

I started at 16 and I'm 34. Went from working on gaming websites to running giant ERP backends for mobile apps, web apps, and api users in high throughput environments. All I need to get to work is VSCode and some linux VM or container. PHP has an obnoxious amount of depth. You can become an expert on just ORMs or just SSO or just Collections or just routing and still be learning something new everyday. I am actually…

> I am actually "self tought". Whatever that means.

What does that mean? I know what taught means, but tought? No idea.

Re: PHP in 2022

#132

I started my career in PHP ~15 years ago trying to do OOP in PHP 4.x. That was "fun". In the meantime I switched to other stacks but I've been keeping a distant eye on how PHP was evolving and I still am involved with PHP projects to a certain degree, though rarely at code level. I really appreciate the effort put into fixing most of the things I hated about the language, though at times it felt like the language and…

> Why would I choose PHP when starting a greenfield project? For me, the answer is Laravel.

For someone who has never used PHP: what is so good about it?

Re: PHP in 2022

#133

I started my career in PHP ~15 years ago trying to do OOP in PHP 4.x. That was "fun". In the meantime I switched to other stacks but I've been keeping a distant eye on how PHP was evolving and I still am involved with PHP projects to a certain degree, though rarely at code level. I really appreciate the effort put into fixing most of the things I hated about the language, though at times it felt like the language and…

> Why would I choose PHP when starting a greenfield project?

LAMP stacks are super ubiquitous, open source, cross-platform, and in many cases to deploy your app you don't need to configure anything, add any modules or dependencies... just copy your files in place. A small project (e.g. contact form with a CAPTCHA) could be just a small file named whatever you want, which you can place anywhere in the public directory, and it'll work.

If you don't want to maintain the server you can get a managed VPS and things will probably run and continue to run for years without any intervention on your part, even through software updates.

... The exception is that PHP breaks backwards compatibility often, but even then most hosting services let you choose between different PHP versions which they'll maintain for a while. Installing older versions from package managers is very easy as well.

That said, I don't think this is a strong reason to use PHP in most projects. I do think it could be one of the strongest ones to justify its use in some specific projects.

Re: PHP in 2022

#134
post #48

Earlier quoted context omitted.

Not sure about Ruby, but Python is a pretty popular choice. There are tons of open source projects that are used by big players for data processing and complex backends.

Might be used for that, but Python certainly wasn't "designed for long-running processes or data processing at first" which was your original argument. These 3 languages are pretty comparable in many ways.

Unless you're doing matrix multiplications, PHP will work reasonably well. It's probably not the right tool for the job (because python's data ecosystem is too deeply entrenched in the ecosystem), but if your codebase is already in PHP, you can easily do long running processes in PHP (similar to how you'd write Rails jobs with ActiveRecord queries in Ruby).

Re: PHP in 2022

#135

PHP is my go to language for building simple backends that store data as json in a file and synchronize access using flock(...). There are a ton of cheap hosting providers that support PHP and all you have do to is copy your files over and everything works. I love to focus my energy on building a great frontend with React or Vue.

I've wondered why there's no JSON-based equivalent of SQLite, like "MongoDB but it's just a file and a library."

Re: PHP in 2022

#136

Earlier quoted context omitted.

Isn't ARC over a GC evident in PHP with its opcode cache? I don't think I have run into a PHP dev who thinks PHP has a GC

the very fact that you don't have to think about memory management it means that there is something else taking care of it. Call it GC or otherwise, no PHP dev will be think about memory management at all, unless they are building some long-lived, large data processing

> no PHP dev will be think about memory management at all

Not nowadays, for sure. In 2009-2010 it was still something to keep in mind, and careful array handling was common so the it wouldn't baloon hundreds of megabytes for not so large data structures. I wasn't working on big data (tm) at that time, but running database imports via ETL processes in PHP required a few optimization passes.

I really can appreciate nowadays the huge memory and performance improvements that PHP went through from the 5.x days to the recent 8.1 release.

Sidenote: Shout outs to Nikita Popov who came to the scene and revitalized the language for me back then, for his proposals and features implemented in a time when PHP felt stagnant language wise https://www.npopov.com/aboutMe.html#accepted-php-proposals

Re: PHP in 2022

#137

Earlier quoted context omitted.

No, just in terms of features and syntax. Too bad you can't remove all the bad stuff from php, or any old tech. This was one of my requests to that new search engine posted here a few days ago.. Filter on minimum version of technology. Should actually just be a field in stackexchange.. packages/languages references + version. And a marker to set if the information is obsolete.

PHP and Java are indeed superficially similar (this was claimed 20 years ago, too). You can't get rid of old stuff in the name of BC, but you often simply don't have to use that old stuff. For example, people hate on JavaScript (and PHP too I believe) for the semantics of their "==" operator, but it's a moot point since these languages have had "===" since many years.

If you are enough aware of the differences that you know you should use `===`, the difference becomes moot, because this is not the only unityped footgun on the language, and one of the easiest ones to deal with. The practical problem with `==` is for beginners, and the reason most people refer to it is because it showcases a very large and deep flaw of the language, not because of itself.

Re: PHP in 2022

#138
post #74

I learned to use php when I was like 14. I’m 27 now and still derive such joy when making my own little projects that will never see the light of day. I try to be humble as far as just being a php trash coder, but I don’t feel too ashamed honestly, as it is the most mainstream thing really. I will always be grateful to php for being accessible and yeah, I guess easy. I don’t know why php is the only one I really stuc…

In a world where everything is fast becoming a JavaScript front end with “some” backend and with the improvements PHP has seen in recent years I don’t see why you’d consider yourself a “lowly” php developer.

I’m mainly a C# guy myself as far as the backend goes, but I don’t view PHP as being bad in 2022. I think people who do are stuck in the past to be perfectly honest.

It’s sort of like disliking JavaScript because it really sucked the soul out of you before typescript eventually made it nice to work with.

But being mad at any programming language is sort of silly isn’t it? If it works it works.

Re: PHP in 2022

#139
post #59

Earlier quoted context omitted.

Share-nothing architecture, good, stable ecosystem build around Composer, Laravel and Symfony and as you said a lot of devs. Otherwise, I think differences in syntax etc. are rather subjective and everyone has their preferences. For example, I really like PHP "arrays" because it removes cognitive load of choosing between different data structures. When writing business rules 90% of time I don't really care about opti…

I seems to me that php/js/python will have a large consolidation in the next decade.

What do you mean by a large consolidation? As in users will coalesce around one of these ecosystems, or something else?

Re: PHP in 2022

#140
post #9

Is it just me or PHP's evolution is a bit "too little, too late" for an almost 30-years old language? PHP is not a likable language but it's probably not going away any time soon. Its concept of "one endpoint is one script" is one of its biggest killer features that no other language has been able to deploy in such an accessible manner. Well, Perl and old-style CGI aside, of course. That, and also the fact that it ma…

I think that’s my biggest problem having moved from PHP to Typescript. I just expect my language to have certain features now, and while PHP is catching up, it still isn’t there yet.

And even if they do, what then? It’ll just be feature parity, so there’s no need to switch back either way.

Post reply on HN