Live data from Hacker News

PHP in 2022

stitcher.io

51–60 of 318 posts

Re: PHP in 2022

#51
post #29
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…

There is a garbage collection: https://www.php.net/manual/en/features.gc.php > This section explains the merits of the new Garbage Collection (also known as GC) mechanism that is part of PHP 5.3. > First of all, the whole reason for implementing the garbage collection mechanism is to reduce memory usage by cleaning up circular-referenced variables as soon as the prerequisites are fulfilled. In PHP's implementation, t…

PHP's garbage collector is ARC, unlike any other dynamic language that I know of.

ARC is more performant but can introduce memory leaks via circular references, which is probably not a big problem for short-lived scripts anyway.

Re: PHP in 2022

#53
post #23
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…

PHP uses a garbage collector since version 5.3 that was released around 2009/2010.

(Repeating myself) PHP's garbage collector is ARC.

Re: PHP in 2022

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

> 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. I don't see that as its biggest killer feature. In fact most projects built on PHP using a framework won't use the feature, as every request will be routed through a front controller. This has been true for at least a decade. I think the killer feature of PHP…

It's a blessing and a curse. Makes it amazingly easy to start with, which is how many PHP developers started (with perhaps folder root index.php rewrites and that's it), but later it makes it confusing, especially if "it always worked" for you, when you want to do dynamic routing.

I see the same pain for some next.js devs these days, even though it does allow parameters in roues in [name].js file form, I saw some people generating routers from file trees and finding it an acceptable compromise. Well, each to their own, I guess.

Re: PHP in 2022

#55
post #47

Javascript is what PHP should be since day 1.

> Javascript is what PHP should be since day 1. ReasonML or ReScript is what JS should have been since day 1.

It's not fun sir. What's the point of those $$$ mark for variables ? Make no sense at all.

Easy adoption for all levels of programmers is what make it work for enterprise applications now.

Re: PHP in 2022

#56
post #12

It's still a language that's mainly used for web development, right? Modern websites in big companies require pretty complex backends that require data processing queues and other background activities. Can PHP compete with languages such as Go, Python or Ruby in the future?

> Can PHP compete with languages such as Go, Python or Ruby in the future?

No. I expect no seriously large projects are started in PHP anymore.

Re: PHP in 2022

#57

Won’t be long before php is java

You mean the most successful enterprise language and 2nd/3rd most used language overall? TBH, I don't think PHP is going in that direction.

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.

Re: PHP in 2022

#59

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…

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 optimization or memory, but about readability and communication.

Overall, PHP is rather dumb language and I love it for being dumb.

Python package management currently is a nightmare, but projects like Poetry seem on a good track to make it better. JavaScript is better than Python at package management, but it has issues with many small packages maintained by random people. Java ecosystem also seems quite a lot more complex, especially when you compare Composer and Maven. Compilation aspect also changes the way you work.

I have no experience with Ruby, C#, .NET etc.

Re: PHP in 2022

#60
I'm just leaving my current role, a fast growing start up with a completely custom framework. Currently at half a million active accounts but there's really no bottleneck with the PHP. Can easily keep throwing more boxes and hardware at it and I feel pretty comfy that it will be fine at 20 million active accounts. Also background jobs processing which is sort of async cause it lives on top of SQS and fires a sub process for every new message.

My iteration cycle is very fast. No need to sit there and wait for compiles. PHP is C-like and written in C so the hate is funny to me. Our code is unit tested, documented, and extremely well organized. I even connect to our database on my dev box through an SSH tunnel managed by a tool I made for us in.... PHP which uses AWS IAM to authorize a private key for 60 seconds and then auto connect. That's how I connect to our EC2 instances too.

I'm now jumping to another successful start up with a small team running Laravel. Again super organized and well documented.

Post reply on HN