Live data from Hacker News

PHP 8.1.0

php.net

121–130 of 286 posts

Re: PHP 8.1.0

#121
post #83

Earlier quoted context omitted.

Iterating on ideas is much quicker when the compiler tells you when you made a mistake or failed to change your code after changing your mind.

Honestly, I don't see much difference. You learn either way. People may have preferences, that's fine. A compiler isn't a magical tool that creates bug free code.

The difference is massive. Computers are many orders of magnitude better at this kind of thing than humans, especially in a large application where changing the shape of a single data structure can have cascading effects throughout the entire code base; you simply will not catch things a typechecker will.

Re: PHP 8.1.0

#122

Earlier quoted context omitted.

One comment I heard at a programming meetup recently was "I hate how frameworks like laravel have brought PHP back in to popularity when we had the chance to finally kill it off". I do wonder if there really was value in salvaging PHP when we have a wealth of other languages and frameworks that do a perfectly fine job without any of the legacy mistakes sitting around.

Doubt there was a chance to “kill it off”, doesn’t it run over 50% of all websites?

It's a CRUD staple. There's no other language so well suited to easily building CRUD services (of which WordPress is one). It's a big cherry on top that the language has gotten better and dramatically faster over the last several years.

There was no chance of it being killed off rapidly as the author was perhaps implying. It might have slowly rotted away, had the maintainers not stepped up with v7 and hit a home run.

Re: PHP 8.1.0

#123

Earlier quoted context omitted.

There's also Moodle which got extremely more important because of the pandemic. Nothing that ever becomes as popular as PHP and continues evolving for 2+ decades disappears quickly. I think 10+15 years... I don't know... I think it will last longer. COBOL and FORTRAN are still alive, there was more heavy money into both but there are more minds in PHP.

Ah, yes - Moodle. My 6th Form experimented with Moodle when I was a student there - that was a loooooong time ago (2004? 2006?). I remember the staff weren't happy that Moodle allowed students to set their own avatars because too many kids figured out you could use animated GIFs as avatars, probably copied from eBaums or deviantArt; while others uploaded shock-images or just controversial content because I guess that…

My university is currently using moodle, as far as I can see it's working fine.

It's replacing and older custom application, built on liferay (or alfresco? can't really remember).

However, it's doing okay. And it's scaling fairly big (~40-45k users).

Re: PHP 8.1.0

#124
post #108

Earlier quoted context omitted.

One comment I heard at a programming meetup recently was "I hate how frameworks like laravel have brought PHP back in to popularity when we had the chance to finally kill it off". I do wonder if there really was value in salvaging PHP when we have a wealth of other languages and frameworks that do a perfectly fine job without any of the legacy mistakes sitting around.

There isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with? The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering? Whe…

I've been working with php since 2001 and that whole time I've been cleaning up bad ruby and nodejs and PHP implementations and knowing JavaScript well enough to code in whatever front end nonsense comes out from PrototypeJS to jQuery to ExtJs to angular to react on and on ad nauseaum. Throughout PHP was my actual workhouse. It's kinda frustrating when I meet someone super into JavaScript as a backend because I still choose PHP even though I have 20 years of JavaScript under my belt and love Es2015+ promisable JavaScript.

I'm not even really sure why python is so popular for DevOps cause I do everything in php and it's unit tested and works well with reproducible results.

Re: PHP 8.1.0

#125
post #67

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

You can use a live reload tool, e.g. BrowserSync, to automatically refresh webpage after source file change. Put your browser on half of screen if you have big enough monitor, or even better - use dual screen setup. And if your IDE supports automatic saving, you are down to single step: "Edit file".

That's still much slower with JavaScript. We use both in php land.

Re: PHP 8.1.0

#126
post #32
post #18

Everyone laughing at PHP hasn't tried it for years, I'd bet. It started clumsy, true, but it became a solid and quite elegant way of doing things. And by things I don't mean just web development. The current limitations I see in PHP is that there is not an official multi-core coroutines solution.

Elegant is not the word I'd use to describe PHP. Solid, perhaps. Undoubtedly useful. But if there is elegant PHP, I haven't seen it.

I see php sort of like a trusty hammer. It's a hammer. Doesn't have to be elegant. It's a hammer.

The nails are http requests and PHP is a damn good hammer.

Re: PHP 8.1.0

#127

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

Is oopsing 50 times per minute a good thing?

Less oops and more "let me try this out"

Re: PHP 8.1.0

#129

Still holding the web. Happy to see it is continually evolving.

What's your estimate for PHP's long-term viability? I'm asking, because it was the hobbyists and kids who got started in PHP mucking around in their everyday white-label cPanel/Plesk-based web-hosting accounts in the very early 2000s that really gave PHP the mindshare of enthusiastic users and thus its staying power. But it's 2021 now: all the kids are getting started with NodeJS for server-side web-applications, not…

[deleted]

Re: PHP 8.1.0

#130

I've been using PHP since 5.x. Often had to work on older 4.x web apps. I find it interesting when I read people saying "PHP has come a long way. It's a proper language now, etc." If you work long enough with a language and figure out most its quirks, it's a breeze. It's nice that they are adding all these new features, but they are hardly what makes it or break it for me. Here is the one features that is taken for g…

I worked with PHP solely for years and always thought the language was good for me but that it made it easy for codebases to go to shit. I’ve worked with half a dozen other languages now and have realized all codebases just suck for the individual because like all things people are heavily opinionated about how the code should be organized.

As for react, I work with a medium sized code base in the hundreds of thousands of lines and all I have to do is alt tab since it hot reloads for me. Don’t see how PHP is any better since it isn’t even hot reloading. Also with react I can update css and it doesn’t lose the state which is nice for debugging style changes.

Post reply on HN