Earlier quoted context omitted.
Well php has strong typing built in now and they have been iterating on it every release. It's well ahead of native js. I can't imagine having any real complaints on using 8.x php for a back end these days.
I still dislike the constant $ and ->, today it just feels like extra typing. Otherwise I agree with you.
PHP 8.1.0
211–220 of 286 posts
Re: PHP 8.1.0
#212Fibers!!! 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
#213Fibers!!! 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.
I can see it being a boon for the esoteric stuff like ReactPHP, but for a regular MVC site it just seems like a unnecessary complication?
In JS land, it atleast makes interacting with the event loop and NOT blocking the UI thread easier.
Re: PHP 8.1.0
#214Earlier quoted context omitted.
Internally, Enums inherit a lot from classes. I wrote an indepth article about this: https://php.watch/versions/8.1/enums#enum-exists There is an `enum_exists` function that only returns true for Enums. It's fairly unintuitive to combine class_exists with enum_exists to filter out Enums, I agree.
Isn’t that the same behavior/pattern for traits though? At least it’s consistent.
Re: PHP 8.1.0
#215I'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…
It's probably part of the reason for the success of PHP and similar.
However, being able to have a "compile" step that does a lot of work to make things faster is also very useful. The key is being able to switch between them easily.
In PHP for example there is the code cache (added later but basically standard now), and assuming it's a web app you probably want to crunch the images and CSS in production.
Re: PHP 8.1.0
#216Re: PHP 8.1.0
#217I'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 oversta…
With PHP, you're not limited to web apps as well. The same rapid-fire style development can be applied when building CLI applications.
Re: PHP 8.1.0
#218Earlier quoted context omitted.
Do you debug your apps in a K8s environment? Why?
To be clear, I’m not saying this is a good reason , but I’ve been doing it lately because otherwise the browser security features prevent a local auth service from passing tokens to the backend app via the browser. I need to figure out a way around this because the iteration loop sucks; probably I’ll add a flag to disable auth on the backend app so I can test non-auth-things locally.
Re: PHP 8.1.0
#219Earlier quoted context omitted.
If by "kinds" you mean abstract classes, yeah. I just checked, there's no special handling for those since requesting them from the container makes no sense. I suppose a constructor could depend on an abstract type and expect an actual implementation, though. I haven't thought about that use case actually, but it's possible to configure a substitute for this case. Other IoC containers may handle this one better, sinc…
I can't think of any situation you'd put an enum in the container though. Maybe I'm just too tired to think of a situation where that would be helpful. Can you think of one?
* A hydrator/extractor that changes the type of the value it handles
* A task or job that has a certain priority to it
Re: PHP 8.1.0
#220I'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…
Tight feedback loops are a very good thing. It's probably part of the reason for the success of PHP and similar. However, being able to have a "compile" step that does a lot of work to make things faster is also very useful. The key is being able to switch between them easily. In PHP for example there is the code cache (added later but basically standard now), and assuming it's a web app you probably want to crunch t…
One of the reasons I use golang where possible, I feel more productive in golang because any mistakes you are make are almost always logical issues with the code, rather than language error and usually works first time.