Live data from Hacker News

PHP in 2022

stitcher.io

81–90 of 318 posts

Re: PHP in 2022

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

I think the problem of PHP is the amount of old tutorials/solutions/conventions/etc. Maybe this is the direction all languages take. Eventually the only way to separate yourself from the past is to sever the name link so as to remove the confusion when trying to learn the modern way of interfacing with the language.

Having used Laravel I did feel that was the best version of PHP I had ever used, which while great, each time I use it, I still feel encumbered. It could just be the workflows that PHP provides don’t/haven’t meshed well with the type of endeavors I’ve tried to approach. Or maybe the language just carries too much history.

As an undergrad I made the mistake of attempting to use php solve some bioinformatics homework and ended up reimplementing the k-means algorithm. While that example may be more revealing of my ineptitude for data science it broaches the topic of “where does a language provide the right primitives for the work at hand?” And if the web is changing, is it still appropriate to use a language designed around a previous version of the web?

Re: PHP in 2022

#83

Earlier quoted context omitted.

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.

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.

Re: PHP in 2022

#84
post #61

Earlier quoted context omitted.

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.

Have you seen ReScript and/or ReasonML? They are much nicer IHMO, but, yes, not as popular.

Typescript hits that sweet spot of popularity/portability/type-safety, and although ReasonML is superior in nearly any technical criteria imaginable, I still reach to TS when I'm starting new.

Re: PHP in 2022

#85

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)

Re: PHP in 2022

#86
post #32

Earlier quoted context omitted.

Because it wasn't designed for long-running processes or data processing at first. It evolved a lot, but I don't see it outside of simple backends for websites.

> It evolved a lot, but I don't see it outside of simple backends for websites. I'd say that something like MediaWiki, Wordpress or Drupal exceeds the definition of "simple backend". Personally, I even tend to write shell scripts in PHP simply because the language is far more sane than Bash (and god forbid naked old sh) and I don't have to fight whitespace with Python.

Isn't it funny how (ba)sh always gets a pass and PHP is hated even though bash is a complete insanity?

Re: PHP in 2022

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

Re: PHP in 2022

#88
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 "self tought". Whatever that means.

Re: PHP in 2022

#89
post #52

Earlier quoted context omitted.

id this why js devs rewrite everything in typescript now?

Because it's flexible and type-safe. You have both productivity and scalability on both syntax level and infrastructure level. It's suitable for 99% of programmers and the businesses for now.

But now you need a ton of time to type things.

Re: PHP in 2022

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

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

Post reply on HN