Комментарии:
Honestly, I decided to try Symfony and... it was a text wall just for some basic posting... meanwhile in Django it was like 9 lines. Not worth it.
ОтветитьI hate php because it cant be compiled to vanilla js
ОтветитьYou clone the const to a new instance, change its value and then it is locked as the const that it is? You get one free change of value at time of cloning, and then that's it, locked?
ОтветитьI like how this video started with "I think PHP is trying to become a real language now" and the whole video is "what the hell is this garbage?" 😂
Ответитьthis looks messier than rust code
ОтветитьEveryone hating on PHP has obviously never built anything with Laravel and they don’t know what they’re missing out on 😔 best developer experience and community I’ve ever experienced.
ОтветитьPHP was never backward compatible and that's why it's a pain in the ass to update Laravel projects, which in itself isn't 100% backward compatible either lol.
ОтветитьPHP has come a long way in the last fifteen years.
ОтветитьPHP has always been the best language. Change my mind.
ОтветитьLaravel is GOOD.
ОтветитьPHP is really great for small to medium projects...even big projects if you configure it well...Also Laravel + InertiaJS is a gamechanger...And for those who say PHP is slow, how many users do you have?
ОтветитьYou should do Advent of Code in PHP hahaha
I think that has been more than 3 years working with PHP, and it isn't so bad like I did think
You say you wouldn't hate Laravel, I say you'd like it.
ОтветитьGroovy, now all I have to do is make sure that my WordPress clients that I'm unable to manually adjust server settings of due to hosting restrictions that have had their sites working for years don't break due to plugins auto-updating without my knowledge before I get a chance to vet them, or worse - plugins that haven't been updated for a while but are still useful suddenly being considered unusable due to newly deprecated PHP functionality that either I'll have to wait for updates, find alternatives for, or hack in the updates myself.
ОтветитьDeep cloning works great for date classes
ОтветитьI don't know if it applies to php as well but in c++ you might want to deep copy a const ref if you want to ensure your copy isn't changed by the source since it might be a non const passed as a const. It could also be the you want to store it in a specific location
ОтветитьThe short-term mutability of a deep-cloned, readonly object seems really nice. In JS you'd have to do something like
> const x = { ...data, nested: { ...data.nested, foo: 123 } };
whereas Elixir would have something like
> x = put_in(data, [:nested, :foo], 123)
So this seems pretty similar to the latter. Looks neat.
The deep clone of read only seems like a way to ensure that your clone does not reference a read only property. It makes a whole new one, and since it's wholly new you can alter the field before it's actually instantiated with read only.
If you deep cloned an object with 12 properties, 3 of them are nested read only objects, and one of those read only objects has a value that needs to change—that's where the new feature helps. Since you're only altering one of the nested objects, it can reference the ones that aren't changed and make a new object for the ones that do change.
I imagine having a user update their information, but wanting to ensure that it doesn't accidentally get updated elsewhere, is a use case. But I'm a noob and have no idea.
I've understood the example for deep cloning magic properties now. Yes the final line on the 8.3 side is outside the magic clone method. But that's not where the fatal error is. The fatal error in 8.2 happens on the last line on the left, where `clone` invokes the Foo::__clone method.
And clone is needed because although Foo is readonly, the PHP class is not readonly, and has a mutable property. So when making a clone of the Foo object we want a deep clone, that has its own instance of PHP, instead of sharing the instance with the original object.
It's a confusing example with an immutable object that contains a reference to a mutable object.
finally one video about not hating php
ОтветитьI work with PHP regularly, it's usually a pretty nice experience as long as I'm just building new stuff. Delving into the old stuff is usually painful, but that has more to do with the overall architecture and loads of ugly fixes that you need to keep in mind 10 files away in order to not break shit. That along with an overall reluctance of using classes for loads of things, meaning you have documentation which says "returned array has these keys" but does in fact not have those keys.
ОтветитьHave they fixed the docs yet so you don't have to read comment 15 to find out the function does something random you need to be aware of.
ОтветитьI haven’t touched PHP in about 10 years, how do you guys handle JS nowadays?
Ответитьthe \ is for namespaces
Ответитьstream an episode on why you hate Javascript lol
ОтветитьStill waiting for that big major update that reduces the set of features
ОтветитьWill you give a chance to C# 12 with .NET 8 and AOT? (F# is still ahead on features)
ОтветитьPHP uses '\' (backspace) as namespace delimiter because '.' (dot) is already used for string concatenation..
I remember this clearly when it got introduced, because that was the drop that filled my bucket and made me abandon PHP. But traits and the new stuff looks damn tempting...
I really do wonder whether Prime would like Laravel or not. IMO Laravel is an antithesis to anyone who likes Go. Go is all about simplicity while Laravel is all magic and abstractions upon abstractions. I would say Laravel is more akin to React or Next.js specifically in that in React/Next.js you are not writing just plain JS, but the React way of writing JS. Similarly, Laravel is not really PHP at this point, but almost like its own language built on top of PHP. Also, just as there are many people who learn React before they learn vanilla JS, there are also many people who jump straight into Laravel without bothering to master PHP and I don't think that is a good thing in either case
Ответитьphp is a must for web
ОтветитьI'm not a PHP man but I would definitely pick a Laravel project over a React project (actually there isn't much I wouldn't pick over a React project).
ОтветитьPHP didn't used to break backwards, which was the problem with the language for a long time. There'd be old stuff they'd mark as "deprecated" but people would still use it.
Now they brokeback... 😏
WEN LARAGEN
Ответитьwhy your videos are not 4k ?
ОтветитьPHP still has the most potential in its Foreign Function Interface, as the language was designed with that in mind in the first place. It’s a shame they do not focus more on making that part of the language more user friendly.
ОтветитьPHP is great, old projects that you get assignrd to, is not 🥴
ОтветитьI think they put too much emphasis on being able to deep clone readonly properties with that explanation. I think the bigger deal is being able to modify cloned, readonly properties period, not necessarily for the purpose of deep cloning them. Otherwise the cloned object can never have different values for the readonly properties. I think this is a good stepping stone to further improvements in the future if they add something like `clone with` where you specify which properties of the clone should have new/different values. You can do something similar in Kotlin and Scala 3. It's great for making immutable classes because if everything is immutable, how do you change anything? Well you don't change the object, you clone it with differences. Currently you basically have to duplicate the constructor in a hand rolled cloneWith() method for every single class you make.
ОтветитьBackslashes for namespace separators 🤮
ОтветитьPHP looks like java now
ОтветитьBro, php has match operators and js still don't
ОтветитьIn my test php swoole was faster then go in typical microservices scenario, surprise
ОтветитьWould be nice to see you go through Laravel :)
ОтветитьPhp is getting better. For people already using php, all these improvements are very nice to get. But php will always be worse than a nice, well designed, statically typed, compiled language. Comparing PHPStan or Psalm to a real compiler and the way it reports issues is night and day. Php static analyzers are not part of the language, they are these tacked on things made by the community, and therefore will never be as nice as a compiler that is required and part of the language. Also, php is overly verbose. `readonly`, arrows just to call a method, a dollar sign before every variable. Those might seem like small things, but it all adds up. Compare it to a language like Scala 3 where it is both terse and expressive/readable at the same time.
Ответитьnah, thanks I'll stick with Go.
Ответить