My most recent experience is with PHP 5, but do you mean the spl_autoload_register? Apparently it is still around. At least I found the __DIR__ construct to be very simple to do relative imports, I wouldn't say Python's import mechanism is any better.
And that's the reason doing PHP means working with a lot of legacy codes that are pretty horrible. That was a reason I left it and it is the reason I am not coming back.
The main problem with PHP is that as a dev, you're constantly fixing 5.6 code made by people who didn't know how to program when they wrote it. Modern PHP is beautiful.
This. We're trying to add types and stuff to everything, but it's such a monumental effort. Tools like Rector can help, but lots still has to be done manually
PHP is very stable these days, I end up spending hours debugging JS projects instead because they move at such a pace, and developers often make breaking changes with no upgrade path. PHP/Laravel doesn’t have these problems.
PHP was always good. PHP, Ruby, Python... work horses that just gets shit done. You can always rebuild in Java or whatever when you actually make it to the scaling issues 99% of all software will never hit.
PHP was pure frustration. Absolutely one of the worst experiences for me as a programmer. Unintuitive execution, weird bugs that developers didn’t want to fix (remember a for loop using references…?). No block scope. Obsolete dollar sign notation. The list goes on. I’m sorry, I totally and completely disagree. Because of that shitty past experience I am actually very reluctant to ever look back.
I started my software engineering journey in Java, moved to Python for a few years, then got a job at a big old financial institution. We're using old LAMP and very old Java. We're finally starting to get into talks of bringing our old LAMP stuff into the modern space with things like Laravel, and Laravel is actually great. Makes it stupid easy to get a website going.
As a PHP developer, I love how far PHP has come in the recent years. What I don't like however is the incredibly slow adoption rate for enterprise businesses.
For me the Array functions are one of the best features. They will be replacing so much functions out there, making the number of lines in each php file go down, and increasing the performance in general terms in old php apps.
But it would be much nicer if PHP supported methods on variables then you could do method chaining with array functions like you can do in other languages such as C#, Java, and Rust.
Hiding logic behind setters and getters is a feature and mainly used to transform data seamlessly on set/get. It's a great feature in other languages and I'm glad that PHP now has proper setters and getters. The magic methods were horrible.
Yes, but he's definitely talking about side-effects. Which again, may not be a problem if that is a common pattern, like in Swift which has dedicated 'didSet' and 'willSet' keywords for intercepting setters for side-effects, be it saving something in a backing store, or triggering view re-layouts. One difference between regular getters and setters is that those will not be called on property initialisation, which is why they have different keywords.
PHP's release cycle has been rock-solid since 2011, and it just got even better with an update this month (after 13 years!) to make the EOL date crystal clear: December 31. PHP follows two structured release cycles: one for regular maintenance and security patches, and another for feature releases. Each version receives security updates for four years after release, with active maintenance for the first two years. If there's one constant in life, it's that PHP will deliver a new version every year without fail.
@@johnwisdomtv Hey man, I totally agree and wasn't suggesting that it was ever inconsistent. I guess what I mean is that the quality of features for each release is slowly going up every time and each new version brings more 'wow' moments for me. They're not playing catch-up to fix bugs anymore and it seems like it's more about making forward progress now.
My Cat was my startup's first employee (other than me). He likes to chase flies around my apartment so he is our debugger according to his FaceBook page. He also like to sleep on top of the fans on some of my computers and let the warm air blow on him and he wakes up if it gets too cool, so he ensures that I keep a high load on my CPU.
Oh yes he is. I have not seen any bugs in my office in quite a while, although he is complaining that we put in a new AIO cooler in my dev box so I’m running my cpu a good 20 degrees cooler but I just give him an extra snack and he’s ok so he’s still employee of the month.
4:16 - it's one of the ways to write string in PHP called nowdoc. It allows you to write text without worrying about escaping characters, so great for embedding HTML or JS. After
Yes it's really nice. You don't need to escape because you can choose whatever you like as the string delimiter, so you choose something that doesn't appear in your literal string. And also if your literal string is another programming language (or even also in PHP) then by convention you use the name of that language as the delimiter. IDEs detect that so they can do the appropriate analysis & highlighting for that language. I use it all the time for SQL snippets, particularly for database schema migrations.
The main problem of developers is developers don't like reading words, developers only like reading code... and that's sad. BcMath is for "working with ARBITRARY PRECISION numbers". It is written just right there. It means you can use it to safely work with very large numbers without losing precision. It operates with strings but not with integers or floats.
Property hooks sucks for those reasons, but asymmetric visibility is a top feature. I really like making readonly classes, but sometimes properties must be initialized late. private setters let me use _almost_ readonly properties without the aggravating getters/setters.
I also tend to avoid adding any additional code to properties in C#. It’s just sugar for a method call, but a method seems more explicit that it may have side effects.
Exactly. PHP arrays are hash tables that maintain the order of inserted items and can mix key types. Most languages with "dictionaries" (aka hash tables) don't maintain insertion order of items. A few years ago, Javascript _finally_ started maintaining order of inserted items (after decades of not bothering) but PHP has always done this and did/does it best.
@@npcemprove6016 Arrays aren't black boxes. The source code to PHP is available for anyone to read. And there's an _excellent_ blog post on how PHP arrays work in both PHP 5 and 7 without having to delve into the source code that one of the core developers of PHP wrote around the time PHP 7 was released. Only minor changes were made for PHP 8. PHP arrays may be less efficient than alternative solutions but they are the most powerful and useful data structure to exist in any language on Earth. I dare you to make an equivalent data structure that outperforms PHP's implementation.
What's the problem with function scoping? If there's too much in scope write smaller functions. And block scoping is annoying in JS when it means you can't declare a variable inside a try clause and then use it after the catch.
@@barneylaurance1865 Function scoping isn't as convenient -- lots more typing, especially when you need access to outside variables. And I often prefer longer functions, so smaller functions is rarely what I like. I can see what you mean with try / catch hassles, though.
Yeah, modern C# is quite nice. I like record types, and the getter/setter for properties. Also lots of other improvements such as implicit usings and nullable reference types.
Only thing I'm missing in PHP these days is typed arrays or lists for improved typing of return values, especially in controllers, etc for improved documentation generation. But getters/setters can just get out of here, but at least it's a good option for those that rely on the magic getters/setters, because those are even worse.
@@SXsoft99yeah, I know. And I use them a lot. The problem is enforcing strict typing on a language level. Specifically for arrays when using reflection and code parsing. But I shouldn't have said generics. I just want a simple "[]Something" syntax, that's all. Bonus points of it can't turn into a Map randomly because a index was deleted, lol.
@@jex8885 i really excited to the collections RFC because of this, i know the PHP team says generics is just impossible without destroying the performance of the language, but i would like at least have some more typed collections and the Collection RFC is perfect to do that.
@@lucasayabe Ooo, that sounds perfect! If we get that in PHP I've got everything I need pretty much. And yeah, I don't think scripting languages need generics even, just having them as part of documentation is sufficient, otherwise you might as well do static compiled languages... But I need typed arrays at least. :D
@@jex8885 its a really cool rfc, they give us a new structure similar to enums and clases, so instead of class IntArray extends Array you could have a collection IntArray
Languages and frameworks are a means to an end, not the end in themselves. Most of the features introduced into the PHP language are to make lives easier for the community that builds solutions in the ecosystem and are really appreciated. Obviously other languages have alternative implementations, but that's not the point really...
For the DOM API Update : before, the request was in XPath format, a query format for XM structures, very useful when you do a lot of XML parsing, like when you do a lot a xslts, and it can be useful for xhtml but it is not really appropriate for HTML imo, as html is not really xml. The new API support CSS selector query which is a bit less complete imo than xpath for selection, but simpler and more common on the web and the DOM API available in browsers.
PHP is awesome, and feels much more robust. Smaller build pipeline, less dependencies, no state hell. React, Vue it was just a big mistake. Don't do client code, fire and forget. PHP is superior, long live PHP, JS is bad, TS is bad, we love PHP ❤
I agree that PHP is getting better and better, and I really like how PHP has evolved. It has evolved greatly! On the other hand, many other languages are also getting better and better. PHP is still terrible when it comes to JSON and doing HTTP requests, and there is no way to generate UUID in the standard library.
Hate maven/gradle/... and the frameworks and libraries seems to be over engineered, overcomplicated . Nevertheless learning java has made me a better PHP developer but still prefer modern PHP with symphony
Java is an absolutely terrible language. Everything is an exception. You'll learn how painful Java is when you start doing anything that, by its nature, is filled with failure states. For example: Networking. DNS queries can fail? Java exception. Transfers can be interrupted midstream? Java exception. The server can be temporarily down? Java exception. A packet is dropped? Java exception. No other language on Earth is filled with terrible decisions like Java has. It's a terrible language, no one should use it, and it was on its way out of existence until Google decided to use the JVM for Android. And that's before you get into the _awful_ tooling for Java.
@ working in the finance infustry. Everything is spring framework. It would be a nightmare having everyone spaghetticode a bunch of php. Couldnt one argue that the tech we build these things on is full of exceptions?
The DOM api is for html parsing and modification. Its useful to modify user generated html, such as on a Wordpress or other CMS site that migth be giving you formatted html, but you want to say, detect all the h2's and make a jump list sidebar out of them, but its all server rendered.
It's not entirely true. Whatever PHP is stateless is determined by how you run it. Using php-fpm makes your app stateless, using swoole makes it stateful (+ you got another features like concurrency, shared cache between workers etc.)
The hiding you are doing is malicious because general intent of $a = 1; is for a to be of value 1, but it won't be with the magical trickery of these new getter/setter features. Next we will encapsulate the entire program into a single function and call it OOP.
going even deeper, if you go back to the core idea that is message passing, you cannot have assumptions about any code in oop, as the messages don't have any meaning, its up to the object interpret that in its own way, so even x + y isn't garanteed to be a sum, because you cannot say if x and y are number objects, they could virtually be any object that support these messages like a string with concatenation, an array with concatenation, and etc.
The ton of array_* functions is actually something I miss in some other languages. There are so many really powerful functions you can just use for pretty much everything array related and know they are optimized in performance and efficiency.
I'm just waiting for PHP that is not a major pain to install, deploy and work around. It's integrated in so many weird places and you have 10 PHP distros that have different workers and stuff. Please PHP, let it be the year of PHP.
@MrMeltdown it does not round by default IIRC, I think it truncates. But the docs are your best bet. It's been a few years since I did any actual accounting with PHP.
PHP 8 is actually huge. They added JIT, match exp. and switch statement, add more places to throw, weakMaps, DateTime, enums and the readonly attribute. If they keep this pace up, they will soon reach 2010! (PHP in the backend is probably still better than JS, F U)
js needs config files over config files to have a stable development experience sgared in your team. PHP just has composer.json. If you are feeling fancy .editorconfig.
They didn't just add a JIT, they added one, realized it wouldn't scale, deleted it, and then rewrote another one from the ground up yet again, all in the span of PHP 8
Setters themselves are evil. Getters are decent in some instances, like getter for list's item count as it removes some obvious clutter. Setters are either a layer of indirection over public fields, or obfuscate important logic. They really should be either a public field, ideally in a struct or struct-like class, or a public method. Of course, some tools and languages have strong opinions about these, so you have to do what you have to do.
You should generally just have validation logic in property setters. Not logic that mutates the value itself, because you want to retrieve it as it was later from the getter. If you want to do complex actions on data use method with a name that tells you what it does.
When i first tried php 5 years ago and saw the function array_chunk, i was so happy. The fact that i can have effortless way to make a grid with bootstrap lol. Only recently i saw proposal for javascript to be included.
@ That sounds relatively autistic… at least on the spectrum but I get you. I have been a one-man-army web dev for 34 years. Maybe that's why I would take those underscores over fragmentation and excessive infrastructure. 🫣
@@greenjello421the current standard is to use camel case. There are some built in functions that use underscore but if you write a function you use camel case
It is very enjoyable when setter is written something like this - `set { _field = flase; }`, it is so fun I cant begin to describe how much joy that brings. But I am not against setters/getters.. they have their place to be..
@ well, it’s a 1+ million LOC 15 yo codebase that has parts written in 3 different frameworks (pure PHP, our own MVC framework and Mezzio). - Code style is nonexistent. There’s been 3 migrations from spaces to tabs and back to spaces. All unfinished. - There’s no unit tests. Somebody was writing unit tests 5 years ago, but since then all code has been untested. - API has no documented specification. Internally, calls to our new API versions are rerouted to old APIs. So changes to the new API break old API. - And of course we use micro services so that now there’s 20 services all tangled up together so much you never know if a change in 1 of them will break the other.
@@evergreen-Ouch. Luckily I can still boot up my 10 year old PHP project without issues, but my 2 year old JS is another story. 90 % of the tooling doesn't exist anymore
I think many people still prefer React and Laravel stack cause you know php servers are way cheap then node so if php 8.4 having this changes it can also change the further version of Laravel too I myself also worked 2 react and Laravel project so it's not bad
i like getters and setters, nice syntax-suggar but what i really really REALLY want are accessors for classes, all classes are public by default and it’s so wrong IMHO
@@XDarkGreyX you like encapsulation for your methods and properties right? It would be really cool if we had this at module level right? Well in PHP all the classes are public, so you couldn't do that.
Im good. Enjoy though lol. Laravel was definitely the best thing that's ever happened to PHP. I don't hate when i have to work on it, but I don't enjoy it.
Yes, all languages are good in small amounts -- the same way people thought New Coke was better, because they only had a small taste. But how much do you like the language when you come in on a project that another dev built in PHP? If you still like the language then it is a great lang, if not...
I
eally\don't\like\the\backslash\in
andom\places.
u can use 'use':
use I
eally\don't\like\the\backslash\in
andom\places;
$someVar = new places();
I don't like it and the dollars either but they have the merit of being different
I don't like them, I have a policy to only use them in the imports, not in the rest of the file
use Oh\You\Mean\This\Namespace? \Or\The\Global\Namespace?
I actually find this a bit easier to read than I/really/don't/like/the/backslash/in/random/places
Watching Prime try and understand the Autoloading mechanism in PHP will be super fun.
My most recent experience is with PHP 5, but do you mean the spl_autoload_register? Apparently it is still around. At least I found the __DIR__ construct to be very simple to do relative imports, I wouldn't say Python's import mechanism is any better.
@@nikonyrh he's talking about the PSR-4 autoloading mechanism
Generally you don't, composer does all that for you. At some point in the past I implemented my own autoloader, that was fun.
@@neonbyte1337PSR-4 still uses spl_autoload_register under the hood. The more things change the more they stay the same
@@elzabethtatcher9570 Everyone implemented their own autoloader back in the day lolol.
Oh boy this new monitor position looks like prime is looking straight to me and im not ready for visual contact.
are you sweating cus i am 😂
just visual basic.
Now you mentioned it, I knew something feels weird and different than the usual lol
point to where he touched you
I wasn't ready for visual contact either but your pfp why, why, why are you looking at me like that
PHP never left
Never will
Pho always right
And that's the reason doing PHP means working with a lot of legacy codes that are pretty horrible. That was a reason I left it and it is the reason I am not coming back.
it was always in the garbage can.
But I leave, when I hear PHP
The inspiring\guy\that\doesnt\even\use\the\language\but\wholesomely\gives\props\to\the\work - agen
Approved
What you're confused about at 4:00 is string HEREDOC syntax. It allows you to put raw string data into a buffer and the
The main problem with PHP is that as a dev, you're constantly fixing 5.6 code made by people who didn't know how to program when they wrote it.
Modern PHP is beautiful.
Yeah but that's the easy money: no shortage of work for all that legacy code = Lambo in no time.
This. We're trying to add types and stuff to everything, but it's such a monumental effort. Tools like Rector can help, but lots still has to be done manually
no such thing as beautiful webcode.
That's why linters exists.
PHP is very stable these days, I end up spending hours debugging JS projects instead because they move at such a pace, and developers often make breaking changes with no upgrade path. PHP/Laravel doesn’t have these problems.
PHP was always good. PHP, Ruby, Python... work horses that just gets shit done. You can always rebuild in Java or whatever when you actually make it to the scaling issues 99% of all software will never hit.
No
@@philipmrch8326 explain
str_contains was introduced only in php8. Just think about that for a moment.
it absolutely not was always good. lol you guys are just falling for the hype now.
PHP was pure frustration. Absolutely one of the worst experiences for me as a programmer. Unintuitive execution, weird bugs that developers didn’t want to fix (remember a for loop using references…?). No block scope. Obsolete dollar sign notation. The list goes on. I’m sorry, I totally and completely disagree. Because of that shitty past experience I am actually very reluctant to ever look back.
I started my software engineering journey in Java, moved to Python for a few years, then got a job at a big old financial institution. We're using old LAMP and very old Java. We're finally starting to get into talks of bringing our old LAMP stuff into the modern space with things like Laravel, and Laravel is actually great. Makes it stupid easy to get a website going.
Yeah. I can get a medium scale web app done in a weekend with Laravel while java/javascript devs are still doing configuration of the project 😅
@@sudeshryan8707 there is nothing that competes with Laravel. Probably rails, but it is disappearing.
As a PHP developer, I love how far PHP has come in the recent years. What I don't like however is the incredibly slow adoption rate for enterprise businesses.
For me the Array functions are one of the best features. They will be replacing so much functions out there, making the number of lines in each php file go down, and increasing the performance in general terms in old php apps.
But it would be much nicer if PHP supported methods on variables then you could do method chaining with array functions like you can do in other languages such as C#, Java, and Rust.
Hiding logic behind setters and getters is a feature and mainly used to transform data seamlessly on set/get. It's a great feature in other languages and I'm glad that PHP now has proper setters and getters. The magic methods were horrible.
Yes, but he's definitely talking about side-effects. Which again, may not be a problem if that is a common pattern, like in Swift which has dedicated 'didSet' and 'willSet' keywords for intercepting setters for side-effects, be it saving something in a backing store, or triggering view re-layouts.
One difference between regular getters and setters is that those will not be called on property initialisation, which is why they have different keywords.
Dang, I'm still getting to grips with 8.3. The PHP devs are on a roll recently.
PHP's release cycle has been rock-solid since 2011, and it just got even better with an update this month (after 13 years!) to make the EOL date crystal clear: December 31. PHP follows two structured release cycles: one for regular maintenance and security patches, and another for feature releases. Each version receives security updates for four years after release, with active maintenance for the first two years. If there's one constant in life, it's that PHP will deliver a new version every year without fail.
@@johnwisdomtv Hey man, I totally agree and wasn't suggesting that it was ever inconsistent. I guess what I mean is that the quality of features for each release is slowly going up every time and each new version brings more 'wow' moments for me. They're not playing catch-up to fix bugs anymore and it seems like it's more about making forward progress now.
The devs have been out of control... Its so nice and speedy.
My Cat was my startup's first employee (other than me). He likes to chase flies around my apartment so he is our debugger according to his FaceBook page. He also like to sleep on top of the fans on some of my computers and let the warm air blow on him and he wakes up if it gets too cool, so he ensures that I keep a high load on my CPU.
I hope he's employee of the month every month
Oh yes he is. I have not seen any bugs in my office in quite a while, although he is complaining that we put in a new AIO cooler in my dev box so I’m running my cpu a good 20 degrees cooler but I just give him an extra snack and he’s ok so he’s still employee of the month.
15:00 missed the chance to say "the PRAGMAgen" there smh
4:16 - it's one of the ways to write string in PHP called nowdoc. It allows you to write text without worrying about escaping characters, so great for embedding HTML or JS. After
Yes it's really nice. You don't need to escape because you can choose whatever you like as the string delimiter, so you choose something that doesn't appear in your literal string.
And also if your literal string is another programming language (or even also in PHP) then by convention you use the name of that language as the delimiter. IDEs detect that so they can do the appropriate analysis & highlighting for that language. I use it all the time for SQL snippets, particularly for database schema migrations.
lol I have been coding PHP for 12 years and did not know this. Good to know. ob_start() and ob_get_clean() fellow here. 🙃
It's HEREDOC dumbass.
NOTE: nowdoc is also available in bash
@@kurku3725yepp, although ive always seen it called heredoc
Can't wait for the PHP website arc
php is now discount C# lol
With weaker types
These getters and setters features are straight from 2010.
Good job PHP always behind the curve
I was thinking this too.
@@scott32874 same.
@@donnacasterr6223declare(strict_types=1); on top of your class and you have type enforcement
The main problem of developers is developers don't like reading words, developers only like reading code... and that's sad.
BcMath is for "working with ARBITRARY PRECISION numbers". It is written just right there. It means you can use it to safely work with very large numbers without losing precision. It operates with strings but not with integers or floats.
PHP has really gotten so much better in the last few years. Love the growth in such a mature language.
3:34 - PHP Attributes are like decorators in TypeScript thus can be reflected.
I don't know why, but Primeagen saying 'PHP' somehow summoned my Samsung Phone's assistant, Bixby... freaked the hell out of me hahah
1:20 Just wait till he sees Swift's didSet which is a common pattern to trigger re-layouts/re-renders on state changes :)
Property hooks sucks for those reasons, but asymmetric visibility is a top feature. I really like making readonly classes, but sometimes properties must be initialized late. private setters let me use _almost_ readonly properties without the aggravating getters/setters.
Nice. Thanks for the rundown.
Even Primegen uses PHP but does not Tell anybody !!
new PHP 9.1 released. you can now compile it to Angular or React
Well you can already compile Laravel to WebAssembly and run PHP in your web browser. I heard Laravel is good.
Agree about setters and getters. Reason why I only use autoproperties in C#, never custom get/set code.
I also tend to avoid adding any additional code to properties in C#. It’s just sugar for a method call, but a method seems more explicit that it may have side effects.
if you don't care about custom logic, just make all public...
PHP, I started learning 7, it was cool. Give me a foreach loop and associative arrays and I can make the world.
Arrays are inefficient black boxes.
@@npcemprove6016 So? I like them.
Nice, I think most Google API used to support PHP. Which you can leverage on your app.
Exactly. PHP arrays are hash tables that maintain the order of inserted items and can mix key types. Most languages with "dictionaries" (aka hash tables) don't maintain insertion order of items. A few years ago, Javascript _finally_ started maintaining order of inserted items (after decades of not bothering) but PHP has always done this and did/does it best.
@@npcemprove6016 Arrays aren't black boxes. The source code to PHP is available for anyone to read. And there's an _excellent_ blog post on how PHP arrays work in both PHP 5 and 7 without having to delve into the source code that one of the core developers of PHP wrote around the time PHP 7 was released. Only minor changes were made for PHP 8. PHP arrays may be less efficient than alternative solutions but they are the most powerful and useful data structure to exist in any language on Earth. I dare you to make an equivalent data structure that outperforms PHP's implementation.
PHP just needs to give us block scoping.
What's the problem with function scoping? If there's too much in scope write smaller functions.
And block scoping is annoying in JS when it means you can't declare a variable inside a try clause and then use it after the catch.
@@barneylaurance1865 Function scoping isn't as convenient -- lots more typing, especially when you need access to outside variables. And I often prefer longer functions, so smaller functions is rarely what I like.
I can see what you mean with try / catch hassles, though.
Then it would be perl.
I'm still waiting for Prime to unironically try (modern) C#, looks like he'll actually like it
Yeah, modern C# is quite nice. I like record types, and the getter/setter for properties. Also lots of other improvements such as implicit usings and nullable reference types.
Only thing I'm missing in PHP these days is typed arrays or lists for improved typing of return values, especially in controllers, etc for improved documentation generation.
But getters/setters can just get out of here, but at least it's a good option for those that rely on the magic getters/setters, because those are even worse.
you do have generics are doc blocks /** @return array{ hand: string, card: CardType | null } */ or /** @return array */
@@SXsoft99yeah, I know. And I use them a lot. The problem is enforcing strict typing on a language level. Specifically for arrays when using reflection and code parsing.
But I shouldn't have said generics.
I just want a simple "[]Something" syntax, that's all. Bonus points of it can't turn into a Map randomly because a index was deleted, lol.
@@jex8885 i really excited to the collections RFC because of this, i know the PHP team says generics is just impossible without destroying the performance of the language, but i would like at least have some more typed collections and the Collection RFC is perfect to do that.
@@lucasayabe Ooo, that sounds perfect! If we get that in PHP I've got everything I need pretty much.
And yeah, I don't think scripting languages need generics even, just having them as part of documentation is sufficient, otherwise you might as well do static compiled languages... But I need typed arrays at least. :D
@@jex8885 its a really cool rfc, they give us a new structure similar to enums and clases, so instead of class IntArray extends Array you could have a collection IntArray
Languages and frameworks are a means to an end, not the end in themselves. Most of the features introduced into the PHP language are to make lives easier for the community that builds solutions in the ecosystem and are really appreciated. Obviously other languages have alternative implementations, but that's not the point really...
I wish Prime could make a video about Angular's latest improvements. I guess that day will never come to reality
he is not a frontend guy
Who cares about Angular
angular is fucking dead
@@hermessantos5258
I am aware, but sometimes, Prime makes videos about something related to React, even for making fun of React Andy's.
@@philipmrch8326 Your mom cares
For the DOM API Update : before, the request was in XPath format, a query format for XM structures, very useful when you do a lot of XML parsing, like when you do a lot a xslts, and it can be useful for xhtml but it is not really appropriate for HTML imo, as html is not really xml.
The new API support CSS selector query which is a bit less complete imo than xpath for selection, but simpler and more common on the web and the DOM API available in browsers.
Prime edging us at the end. Love to see it
PHP is awesome, and feels much more robust. Smaller build pipeline, less dependencies, no state hell. React, Vue it was just a big mistake. Don't do client code, fire and forget. PHP is superior, long live PHP, JS is bad, TS is bad, we love PHP ❤
I hate to say it but somehow php language wise seems to evolve better and faster than JavaScript lol
I agree that PHP is getting better and better, and I really like how PHP has evolved. It has evolved greatly! On the other hand, many other languages are also getting better and better. PHP is still terrible when it comes to JSON and doing HTTP requests, and there is no way to generate UUID in the standard library.
about json isn't actually much different of JS, but JS sucks so, i guess you're right
The only thing keeping us back from Lambos is ourselves and PHP
I’ve recently gotten into Java. So far i’m loving it, cause its just soo much better designed than php
Hate maven/gradle/... and the frameworks and libraries seems to be over engineered, overcomplicated . Nevertheless learning java has made me a better PHP developer but still prefer modern PHP with symphony
Java is an absolutely terrible language. Everything is an exception. You'll learn how painful Java is when you start doing anything that, by its nature, is filled with failure states. For example: Networking. DNS queries can fail? Java exception. Transfers can be interrupted midstream? Java exception. The server can be temporarily down? Java exception. A packet is dropped? Java exception. No other language on Earth is filled with terrible decisions like Java has. It's a terrible language, no one should use it, and it was on its way out of existence until Google decided to use the JVM for Android. And that's before you get into the _awful_ tooling for Java.
@ working in the finance infustry. Everything is spring framework. It would be a nightmare having everyone spaghetticode a bunch of php. Couldnt one argue that the tech we build these things on is full of exceptions?
@@privacyvalued4134 Someone's living in the Java 1.6 days
Is Java safe from spaghetti code ? I don't think so. Is PHP always a crappy mess ? Of course not.
The DOM api is for html parsing and modification. Its useful to modify user generated html, such as on a Wordpress or other CMS site that migth be giving you formatted html, but you want to say, detect all the h2's and make a jump list sidebar out of them, but its all server rendered.
Setters and getter allows for hidden control flow
Primagen is ready for FrankenPHP!
PHP is becoming a combo of C# and Java but it's still stateless :/
Stateless is it's advantage
It's not entirely true. Whatever PHP is stateless is determined by how you run it. Using php-fpm makes your app stateless, using swoole makes it stateful (+ you got another features like concurrency, shared cache between workers etc.)
You might try with worker mode of FrankenPHP
since oop introduction it always have been this way
the "hiding" you don't like are one of the main concepts of OOP - encapsulation which is hiding implementation code from client code.
The hiding you are doing is malicious because general intent of $a = 1; is for a to be of value 1, but it won't be with the magical trickery of these new getter/setter features.
Next we will encapsulate the entire program into a single function and call it OOP.
going even deeper, if you go back to the core idea that is message passing, you cannot have assumptions about any code in oop, as the messages don't have any meaning, its up to the object interpret that in its own way, so even x + y isn't garanteed to be a sum, because you cannot say if x and y are number objects, they could virtually be any object that support these messages like a string with concatenation, an array with concatenation, and etc.
thanks for the video, now I love Typescript even more
The ton of array_* functions is actually something I miss in some other languages.
There are so many really powerful functions you can just use for pretty much everything array related and know they are optimized in performance and efficiency.
I'm just waiting for PHP that is not a major pain to install, deploy and work around. It's integrated in so many weird places and you have 10 PHP distros that have different workers and stuff. Please PHP, let it be the year of PHP.
Bcmath is for arbitrary precision decimal math.
Wanna add account balances? Use bcmath. You dont want floating point math for that.
Does it do all the correct financial rounding if set to 2dp by default?
@MrMeltdown it does not round by default IIRC, I think it truncates. But the docs are your best bet. It's been a few years since I did any actual accounting with PHP.
Wait so you are telling me that all that floating point arithmetic that I did years ago for banking software at a company was wrong⁉️
@RustIsWinning no need to be a troll about it.
@@lugaidster What do you mean? I already left that company so it's their problem now lol
PHP 8 is actually huge. They added JIT, match exp. and switch statement, add more places to throw, weakMaps, DateTime, enums and the readonly attribute. If they keep this pace up, they will soon reach 2010! (PHP in the backend is probably still better than JS, F U)
js needs config files over config files to have a stable development experience sgared in your team. PHP just has composer.json. If you are feeling fancy .editorconfig.
It was always better than JS, despite its PHP 4 and 5 days
They didn't just add a JIT, they added one, realized it wouldn't scale, deleted it, and then rewrote another one from the ground up yet again, all in the span of PHP 8
Did they ever fix the broken switch typesafety with 0 and null etc.?
Setters themselves are evil. Getters are decent in some instances, like getter for list's item count as it removes some obvious clutter. Setters are either a layer of indirection over public fields, or obfuscate important logic. They really should be either a public field, ideally in a struct or struct-like class, or a public method. Of course, some tools and languages have strong opinions about these, so you have to do what you have to do.
Performance mentioned with static this and that, well now we clearly need a go-php-python benchmark video
PHP MENTIONED ♥
Who codes today in PHP should be a well respected developer. The AI support for coding in PHP is really shit, so it is avoided by idiots.
Avoided because the language is pure shit!
Who coded in PHP in the past should also be respected, like with any other language. You gotta have the Lambo somehow
I honestly think that the only good additions are the PDO subclasses.
Aaron Francis is coming??!
Honest take at 0:00, I like prime when he is riffing on something off the cuff. The prepared videos alright, but I come to prime for his raw takes.
When are you dumping zig/rust/go/c++ and switching to php, prime?
A lot of grandstanders on transmit in the chat when they should be on receive only. Thanks for calling them out.
We've come a long way baby!!!
Attributes are for metadata. You can get them with reflection API. to me, they feel similar to annotations
I really love PHP
What is dead may never die.
PHP: Hello there
Change it to "Hello world"
*echo "Hello World";*
Imagine Taylor Otwell & Adam Wathan are the 2 dudes that will help Prime to build the php thing => EASILY around 1 zilion views.
Love that you mentioned Wathan. He's very inspiring to watch
I’m waiting for the Ruby (Rails) session to hear comments about whether it’s horrible or not
TIL: Baby dev theprimagen doesn't know about XPath, which was the DOM manipulation standard in the XML era.
Great as long as I like sustaining work and am not worried about performance.
Modern PHP can run up there with the best of em. Perf argument is a skill issue.
ah yes because JAVA devs think about performance when they request extra RAM sticks to be inserted into the server rack
You should generally just have validation logic in property setters. Not logic that mutates the value itself, because you want to retrieve it as it was later from the getter. If you want to do complex actions on data use method with a name that tells you what it does.
is php pronounced “fap” or “pahoop”
Pretty sure it's "pee-age-pee"
Missed opportunity to say pragmagean at the outro
I love writing php. I'm sorry, but it is elegant imo.
When i first tried php 5 years ago and saw the function array_chunk, i was so happy. The fact that i can have effortless way to make a grid with bootstrap lol.
Only recently i saw proposal for javascript to be included.
and robust
I struggle looking at functions with underscores in them. Sorry but I disagree with you
@ That sounds relatively autistic… at least on the spectrum but I get you. I have been a one-man-army web dev for 34 years. Maybe that's why I would take those underscores over fragmentation and excessive infrastructure. 🫣
@@greenjello421the current standard is to use camel case. There are some built in functions that use underscore but if you write a function you use camel case
BC is a unix program “basic calculator”. Cool homage.
Good video Prime,
Laraval is the best framework ecosystem from far. ( I used
to hate php )
The name... is the pragmagen. I can't believe he didn't use it.
Not gonna lie. I clicked on this video primarily because of the cat.
missed chance to say the name is pragmagen
i had to type the dollar sign for five years. i'm not gonna do it anymore, you can't make me
I will make you and you will enjoy it no matter what
So you don't like money?
It was so funny to watch him bounce while writing code
PHP > RUBY
To be fair, it's easy to be better than ruby
Nah, the syntax is horrible. public private(set)?
Ruby's syntax for getters setters is 1000x better
@@TheRealCornPop if you said C# then I would agree, but Ruby is just way worse than this.
Anything is better than Ruby. Maybe not Perl or Tcl?
@primetime PHP does support arrow functions !
So php is trying to catch in terms of semi modern functionality? As a non php dev I am scratching my head.
🔥
Someone needs to make an EUPHP where $ is replaced by €.
pHP goes down the road of get/set hell.
PHP: replaces xpath with CSS quering so you do not have to learn new unnecessary language
Prime: I don´t get it
It is very enjoyable when setter is written something like this - `set { _field = flase; }`, it is so fun I cant begin to describe how much joy that brings. But I am not against setters/getters.. they have their place to be..
2 person? Aaron and Taylor?
Yes you will hear more and more about php, and laravel of course
trustme, dollar sign is a BIG deal, when you entering it thousands of times eachday everyday, at some point it becomes so annoying!
We’re still trying to migrate from PHP 7.4 to PHP 8.1
How is your code base that poorly designed sheesh
@ well, it’s a 1+ million LOC 15 yo codebase that has parts written in 3 different frameworks (pure PHP, our own MVC framework and Mezzio).
- Code style is nonexistent. There’s been 3 migrations from spaces to tabs and back to spaces. All unfinished.
- There’s no unit tests. Somebody was writing unit tests 5 years ago, but since then all code has been untested.
- API has no documented specification. Internally, calls to our new API versions are rerouted to old APIs. So changes to the new API break old API.
- And of course we use micro services so that now there’s 20 services all tangled up together so much you never know if a change in 1 of them will break the other.
@@evergreen-Ouch. Luckily I can still boot up my 10 year old PHP project without issues, but my 2 year old JS is another story. 90 % of the tooling doesn't exist anymore
lmao bro I have to sub if he puts his audience on the spot when they comment something
I think many people still prefer React and Laravel stack cause you know php servers are way cheap then node so if php 8.4 having this changes it can also change the further version of Laravel too I myself also worked 2 react and Laravel project so it's not bad
i like getters and setters, nice syntax-suggar
but what i really really REALLY want are accessors for classes, all classes are public by default and it’s so wrong IMHO
Enlighten us regards
@@XDarkGreyX you like encapsulation for your methods and properties right? It would be really cool if we had this at module level right? Well in PHP all the classes are public, so you couldn't do that.
What about hack?
Im good. Enjoy though lol. Laravel was definitely the best thing that's ever happened to PHP. I don't hate when i have to work on it, but I don't enjoy it.
Symfony > Laravel
Yes, all languages are good in small amounts -- the same way people thought New Coke was better, because they only had a small taste. But how much do you like the language when you come in on a project that another dev built in PHP? If you still like the language then it is a great lang, if not...
and you are saying bad code can't be written in other languages? Have you ever coded in js?
You're aware this applies to any codebase you inherit, right? How does this apply to PHP?
i thought Prime was frontend dev???
Hidden function calls and hidden program flows are the devil imo
I'm doing Django in my current project. I like python, but I'm not liking Django that much. Will give Laravel a try in a couple of months.