Live data from Hacker News

PHP 8.1.0

php.net

181–190 of 286 posts

Re: PHP 8.1.0

#181
post #57

Fibers!!! Who wants to bet we are a few releases away from async/await syntax now. Giving credit where it’s due Microsoft with C# pioneered the syntax and every classic (including a few modern) language has adopted the syntax. I believe we are a few steps away from a fully builtin production ready server and db connection support.

Async/await isn’t something to hope for. It’s a terrible pattern languages should work hard to avoid.

Re: PHP 8.1.0

#182
post #65

Earlier quoted context omitted.

What monsterous golang app are you running that takes 30 seconds to compile?

More interested in what meaningful fixes can be done in some fraction of the 1.2s RTT of this rapid-fire style PHP development.

Output to html, meta refresh page every second. Pretty much real-time results.

Re: PHP 8.1.0

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

Hello World in PHP is literally

    Hello World
I know no other language that elegant.

Re: PHP 8.1.0

#184

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…

> When debugging I can do that 50 times a minute.

In interviewing, I've seen a few candidates re-run their application after making single statement changes. They'll rename a variable, re-run. Change a conditional, re-run. Introduce whitespace, re-run.

These people aren't even confident in renaming variables!

PHP enables this type of underestimation in your own abilities. You don't need to distrust yourself so much.

Don't think you have to do this.

Re: PHP 8.1.0

#185
post #168

Earlier quoted context omitted.

This example seems to be a great demo of why people do not like working with PHP. PHP makes the shit method the massively simpler way and the good method much harder. Now you open yourself up to risks like what happens if we accidentally let some user input change the file opened as well as the content written. While with rails, to do basically anything, you already have a full db ready and incrementing a counter usi…

I don't find these kinds of what-ifs very useful. I haven't used Rails, but does it somehow prevent you from accepting user input and programming it to go where you say you want it to go? Isn't there an element of "holding it wrong" with any language or framework?

Rails actually does do a good job of treating user input as dangerous and it can often detect when user input is being used in the wrong places like directly in to sql. And with industry standard tools like brakeman, you can have CI alert you of most cases where user input is not safely handled.

Re: PHP 8.1.0

#187

Earlier quoted context omitted.

I would say that Ruby on Rails is a pretty good candidate to completely replace PHP with.

does rails come with a generator to create a teams based multi tenant SaaS app with authorization and authentication and job queues without extra setup? (ie without decide and sidekick?)... can rails compete with the performance of octane using swoole with 8k reqs per sec? rails is the first framework I ever learned in 2012 but I kept jumping back and forth until laravel basically started lapping rails in terms of ba…

I’m not sure why this really matters. You can set all of that up in rails in under an hour. And almost every company uses exactly the same libraries for it all. It’s been so long since I even created a rails app because it’s almost always already created when you start the job.

Re: PHP 8.1.0

#188

Earlier quoted context omitted.

I think you (and to be fair, many people) are missing a huge part of why PHP is still popular. Saying Ruby can replace PHP sounds to me like saying that Ruby can replace Excel. It's fundamentally misunderstanding _why_ it's popular in the first place. I have a HTML page. How do I add a hit counter to it with Ruby? I can do it right now in PHP with zero dependencies and it'll fit in this comment: You are visitor numbe…

This example seems to be a great demo of why people do not like working with PHP. PHP makes the shit method the massively simpler way and the good method much harder. Now you open yourself up to risks like what happens if we accidentally let some user input change the file opened as well as the content written. While with rails, to do basically anything, you already have a full db ready and incrementing a counter usi…

>PHP makes the shit method the massively simpler way and the good method much harder.

How it makes it harder? Or you compare PHP a language with Rails a framework? Maybe shut up if you have no idea or show us a pure Ruby code that does the same thing. Or install the most popular PHP framework, really learn that and then tell us that PHP made things harder. I don't know Ruby or rails so I can't shit on that like an idiot.

Re: PHP 8.1.0

#189

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…

>Here is the one features that is taken for granted in "modern stacks":

>Edit file -> Alt+tab ctrl+R. Oops, Alt+tab fix -> Alt+tab ctrl+R.

Yeah, this is pretty much what the Common Lisp and Smalltalk people have been doing since mid 1980s. Except that they're not limited to web applications. And also python people to some extent, with ipython. And Haskell people with ghci.

The value of less friction cannot be overstated in coding work.

Re: PHP 8.1.0

#190

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…

> When debugging I can do that 50 times a minute. In interviewing, I've seen a few candidates re-run their application after making single statement changes. They'll rename a variable, re-run. Change a conditional, re-run. Introduce whitespace, re-run. These people aren't even confident in renaming variables! PHP enables this type of underestimation in your own abilities. You don't need to distrust yourself so much.…

>PHP enables this type of underestimation in your own abilities. You don't need to distrust yourself so much.

That might be true, but sometimes it happens that you overestimated and introduced a breaking change 20 changes ago and now you have to rewind your steps back to find the exact place. If an iteration can be done in less than a second, it's probably cheaper (and less stressing) to just check every single change like this. This is what many coding editor integrations actually do for you.

Post reply on HN