Live data from Hacker News

PHP in 2022

stitcher.io

121–130 of 318 posts

Re: PHP in 2022

#121
post #30
post #16

Earlier quoted context omitted.

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.

It's a shame companies, especially large ones with strategic architecture teams who should know better, haven't identified the short term cost savings of using cloud provider specific services is not worth the long term cost of vendor lock in.

And for startups their recently minted MBA CEOs are too willing to load up on "tech debt" on the race to revenue.

And really, it's not a bad trade - financially. But it will frustrate your eng team, for a bit - especially if you don't actually get the revenue stream going.

Re: PHP in 2022

#122

Hating on PHP almost feels like racism. All the arguments are biased or false. I always get sad after clicking on PHP articles on HN.

I feel it's the opposite. Always a lot of people defending PHP in these threads, no criticism allowed. Gives a very misleading picture of the industry - in reality, PHP is not a loved language, it's below Powershell and just over C in the latest ranking[0] with 40% love / 60% dread. [0]: https://insights.stackoverflow.com/survey/2021#technology-mo...

This only adds fuel to my argument. Yeah let's post a results on how people FEEL about a language. How is that objective?

I could argue 100% of the 40% of the people actually uses PHP and 100% of the 60% people don't even use it.

Re: PHP in 2022

#123
post #5

Enums with functions. WTF

Java enums also have functions. If they didn't we would need to write separate helper classes. Can you give a reason why we should not have them?

Java enums are essentially an in-built singleton pattern where only the given entries can exist. They are not necessarily analogous with sum types, even though rust sort of washes the two together.

Re: PHP in 2022

#124
Maybe I am just too old and tired, but current PHP has nothing to do with original PHP, version by version it changed direction and the last versions are just yak shaving.

I strongly believe that a programming language should be stable over a longer period of time while bug fixes and behind the scene improvements are fine, but for the developer it should not be a moving target, the manual should not triple in size and developers that know very well version x-1 should have zero problems with version x. There is a huge cost of change and if some people don't care, real life does.

Re: PHP in 2022

#125
post #53
post #23

Earlier quoted context omitted.

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

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

How many GCs are we at with Java?

Re: PHP in 2022

#126
post #114

Earlier quoted context omitted.

How is it more performant? If you have multiple threads than you will get serious atomic operation or other synchronization overhead.

PHP is share-nothing architecture. Nobody really uses threads in mainline PHP. Whole class of problems around multi-threading, mutexes, dead locks etc. are really foreign to PHP developers.

Yeah, I should have mentioned that in the general case RC is not more performant (otherwise threaded managed languages would use it).

Re: PHP in 2022

#127
post #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 opti…

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

Re: PHP in 2022

#128
post #40

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

> PHP and JavaScript are not languages that help you become a better programmer.

One can do some really beautiful programming in both modern JavaScript and modern PHP. Both these languages can and have helped millions of programmers become better programmers. Today's JavaScript and PHP are no longer the hacked up languages they once were.

Re: PHP in 2022

#129
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 doing my first web development with PHP (4 & later 5) around the same time! Actually ended up learning a lot about how the entire LAMP stack worked + a lot of tricks and theory behind how to make things secure (PHP had very few safeguards back then). I'm still reaping the benefits of a lot of this knowledge to this day.

I have moved on to other languages like JS and Python since ~2012. Looking at the article, I feel like modern PHP is almost a completely different beast compared to when I used it back then >_<

Re: PHP in 2022

#130
post #51

Earlier quoted context omitted.

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.

Which is perfect for a HTTP request.
Post reply on HN