Live data from Hacker News

PHP in 2022

stitcher.io

91–100 of 318 posts

Re: PHP in 2022

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

In its early years up until around 2006, PHP was mostly "HTML on steroids", that is, an HTML preprocessor with lots of goodies like "batteries-included" DB access, form handling, image processing, text processing, all accessed via a single Apache module. You simply rename your .html file to .php, and put some magic between " ". Then came along templating engines like Smarty, and they introduced a new templating langu…

It was one of the first freely available languages that allowed you to do image manipulation so sites like DeviantArt would use it.

Re: PHP in 2022

#93
post #90

Earlier quoted context omitted.

Ruby + Rails is miles ahead of PHP + Laravel. Wtf are you saying Willis.. but i guess it's a matter of preference, also consider that in PHP you can also use symfony which is my preference, but regardless of everything, you either come here with a list of things that make ruby on rails miles ahead or people is just going to classify your ideas as worthless

> Wtf are you saying Willis.. Is that a metaquote or something? Mr. Belvedere doing an impression of "the children's favorite programme?"

Yeah it was a quote but i translated literally from Italian 1:1 and i guess it was hard to catch in English https://youtu.be/bJd1RktjYTU

Re: PHP in 2022

#94
post #40

Earlier quoted context omitted.

> Why would I choose PHP when starting a greenfield project? Because you don't know better. If all you have is a hammer, everything looks like a nail. Ruby + Rails is miles ahead of PHP + Laravel. If you want more static typing (which I currently believe is a good thing) I really like Kotlin (+ KTor or + Javalin). If you are okay without OO and like static typing Haskell + IHP is pretty complete. If you are okay with…

You can write JavaScript via Typescript, and you now have one of the best and most popular languages there is (including sum types). There are still a lot of warts, but it’s actually a really nice language IMO.

No good backend frameworks comparable to Rails/Laravel/Django in JavaScript though (and I say this as someone who works with JS backends in my day job).

Re: PHP in 2022

#95
post #87
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…

More funny is how developers keep being unware that ARC is a GC algorithm implementation. Then they tell learning CS theory is not required.

I do know ARC is also a garbage collector, but is there an agreed name for the other GC's? There is a significant difference and performance implications with ARC vs. the other ones, that's what I meant.

Re: PHP in 2022

#96
post #51
post #29

Earlier quoted context omitted.

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.

Sounds optimal for PHP where 99% of scripts are short lived.

Re: PHP in 2022

#97

Wow, Php almost catches up with majority of programming languages!

Can't wait for:

  - Pattern matching in switch statements (done horribly wrong)
  - If, while, and switch expressions
  - Inferred type system
  - Consistent array method argument order
  - Actually usable higher order functions and reflection

Big reminder: Php is a fractal of bad design, and I intensely hated using it at work for many years. The only good thing in Php is Symfony2 framework.

https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

Re: PHP in 2022

#98
post #20

I'm a fan of PHP and have been for years for several reasons: 1. Low barrier to entry; 2. Hard to leak resources since the model is to tear down everything after a request finishes; 3. Stateless API core which means the efforts of creating an environment for a request for (2) is extremely low. Compare this to, say, the bootstrap time for Python or Java (which is why those generally don't follow the request teardown m…

It seems that PHP (or at least the community) is taking a lot of inspiration from hack for its newer additions, and giving very little in the way of credit or comparisons.

It is weird than an article like this shows nothing for ctrl+f "hack"

Re: PHP in 2022

#99

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 proc…

> PHP is C-like and written in C so the hate is funny to me. You didn't realize how many people hate C? (Like any other popular language, yes)

I've being used PHP since it was Personal Home Page (3.x or something). The reason I moved away from it, is it is language make up. Some point around 4 it try to become Java OO style (ok ES6 is trying to do that too). The main reason moving away from it is because would like to have language that has function as a first class citizen, and JS seems to fit the bill. Once I found the joy of developing with proper closure and using function as a first class citizen PHP just doesn't appeal to me. The best things about PHP is it's templating system. And with EJS or similar there is really no reason to use PHP anymore.

Re: PHP in 2022

#100
post #16

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.

In the past I built a few things on Google App Engine. Honestly one of my greatest regrets in life. I ported a few to PHP so I won't get screwed again when I need to change hosting provider. Still need to port some and am dreading doing it but it will be for the better.

Huh. I deploy a lot of stuff to GAE and love it. But my approach is to just write regular Django apps, add a half dozen lines of GAE-specific stuff to the settings and that's it. No trouble at all running the same apps somewhere else with only trivial changes. That's worked really well for me for work where we're already on GCP and GAE lets us run our lower traffic services reliably for very little money.
Post reply on HN