My company has used PHP for a long time, and we’ll be gradually migrating new applications to go over the next few years. It might sound a little odd but they are more similar than you might think by the criteria that are most important to us. 1. Despite what the guest says, they are both “batteries included” languages. Built into both languages are utilities for dealing with JSON, SQL databases, making HTTP requests, regex, email, etc. If third-party frameworks aren’t an option for you, you can roll your own pretty easily. 2. Both value backwards compatibility. In golang they have their compatibility promise. In PHP you can get a 15 year old application running with only minor changes generally. 3. The ecosystem. This is largely a product of the first two items, but both languages do have a good ecosystem. Composer and go get are the two best package management solutions I’ve used by a pretty wide margin. Syntax, performance, programming paradigms, and even static typing obviously make some difference in how you use a programming language, but their impact for many (most?) use cases is completely overshadowed by broader concerns.
I'm in favor of static-typed languages like Go and Rust. However, I can say that I appreciate languages like PHP for writing scripts or some particular HTTP tasks for example instead of Javascript. The reason is that writing PHP code (v8) feels to me more succinct than writing plain JS or indentation-based languages like Python or Ruby. That is because PHP has improved a lot its syntax, performance and added support for strict typing. Francis has a nice video about PHP's built-in features enums, pattern matching, closures, etc. Although PHP is single-threaded, if you want to do multi-thread PHP stuff, you have C extensions like Swoole. Or if you are worried about performance, the compiler team is working to get a new JIT for PHP to optimize it even better in the future. So IMO PHP is fairly decent at this point, so why not give a try?
Yeah, not sure about the threaded thing, the most annoying thing is dealing with moving an old monolith from mod-php to fpm-php and making sure you are tuning your application correctly
I'm thankful for the lack of "side quests" in PHP. JS is a nightmare to wade through right now as a beginner. For me, it's an easy choice. Laravel and Vue.
Talking about frameworks in JS land - yes Next.js doesn't compare to Rails and Laravel, but there IS a JS framework that's trying to be like that - it's called Adonis. It comes with auth, database, file storage, etc. Unfortunately the community and publicity is just nowhere near other JS frameworks for some reason. There's also Nest.js, but Adonis is a lot closer to those full-featured frameworks.
37:51 I would disagree in the sense that I use Golang not because I want to be able to handle 100,000 requests per second, which would be cool, but rather to drastically reduce CPU time and memory usage. After all, CPU time and memory are exactly what I end up paying for with cloud computing. And when Laravel advertises Severless for performance, just like JS/Node, I find that a bit dubious, because it ends up costing quite a bit when the credits are used up.
I can relate with the disgust at 51:26. I'm a big php fan, but last week I was using a standard function, array_merge, which you'd think it merges arrays, right? Here's the kicker: if you try to merge arrays with numeric keys, it actually behaves as an append! That was a fun hour.
I cant even tell how this conversation was fantastic, you both are really good speakers. Im getting comfortable with laravel ecosystem and very happy with the productivity
Hah! I use PHP as a templating language all the time! The CMS we use is written in Java, but we used it to produce PHP scripts. 😂 None of this front controller routing stuff, just an index.php in every directory. Bish, bash, bosh, job's a good 'un!
I think of typescript as just an easier documentation tool. When I don't care `as any` is my friend, and on important stuff just type a small type declaration, no big deal. `strict: false` always
Interesting chat, but: I don't think you guys know what static vs dynamic typing is. "We don't have huge amorphous arrays that we pass in PHP" - what? It's the exact thing I see most of the time.
Aaron basically saying he likes types (class instances) but not the syntax TS is clunky but we use it often for the same reasons he uses classes in PHP: so we know what we're working with And JS has an unfair aversion to using classes otherwise I think it would look quite similar at the end of the day
@@raenastra perhaps. I think inferred Typing would get him a long way towards appreciating it a bit more, but i understand he prefers the structure of class instances to raw objects. Just pointing out he could prob get a lot of what he likes in TS as well (tho no Laravel of course)
As I understand the extended failure-to-convey sequence about type-safety that never really got resolved as it relates to (eg) Laravel, the thing not being said is: in modern PHP a properly-instantiated class instance *can be a type*, and that's so much more useful than str/int/whatever nitpicky typechecking, and so easy to define in the class definition, that lower-level annoying type crap becomes unnecessary if you're actually... ya know. Working. (Yes, your description of Golang struct as being analagous to class-based typechecking is about right) All of us don't care so much about types. We care about not having type *errors*, especially hidden ones. Nitpicking cares about types and pragmatic struct/class validation cares about errors.
Raw PHP is perfectly fine, you can search the database in a couple of lines and create the result on the fly, no extra files, no library, no nothing, what's wrong with echo? is shameful to use it? is way cooler to have 1000 packages to do the same in other way? which they will have dependency problems? and you will be executing other persons code which could have virus?. If you have a big project is better to use a framework, I use svelte and GO lately, but I don't forget that for some cases PHP is way superior.
The talk was nice. But typing is pretty good and important, even in PHP. Talking about an API, creating DTOs is pretty easy and it would prevent exposing Properties/Attributes as you define only those that are meant to be sent to a client.
19:44 I enjoyed how he repeated "7000 engineers working on React" twice, given that React team has like 10 people and Facebook used to be 100% written in PHP 😂
hey! Don't mess with Typescript, it basically fixed Javascript. haha. Isn't Vue a library like React? Why Vue instead of a full framework like Angular which goes slowly but stable with backwards compatibilty too? I can understand the hate for React, with all those libraries updating in diferent dates, and with breaking changes in frameworks like Next. But I see Vue as something similar like React, they even have Nuxt which almost sound like Next .-. Shouldn't it be a better option Angular? which is a Complete Framework that doesn't have that many updates like React and its thirdparty libraries but it is still cool and stable. I almost see it as a equivalent to Laravel but for Frontend...
25:00 a fractal of bad design was a tear down of PHP what 5.4?? Fast forward how many versions that have come since then, it's hard to see how that article is even valid anymore.
Great episode! I got really excited when I saw it was out, but I can't help but feel a bit uncomfortable watching it because it seemed like Aaron was upset at something the whole time. Maybe it's just me. Hope everything is ok on his end.
@@aarondfrancis Good to hear! Yeah, I think it was the combination of the crossed arms plus the face you make when you're thinking that comes off as a bit angry. But as a PHP developer who's built a few libraries in his time, your takes on gradual typing and classes seem spot-on to me 😀
@@aarondfrancis I think it might be a combination of where the screen you're looking was located vs your webcam. I wouldn't go as far as calling it an angry/upset look, we're just used to seeing you more relaxed. Great talk by the way.
Next time someone says they hate x language with passion an vigor, simply ask them why. It's astounding how little insight they will have after the basic pebble throwing around types. Most virulent haters of any language are either purists, or sheep.
Typescript... MS's reach into a biz they lost. I spend so much time leaning TS instead of coding, agreed hate it. Agree the pinnacle of react is over gone. Don't get it overly complex. V19 with now a compiler, so now all that pain with usememo, usecallback i can toss? nice how about Htmx, or livewire. Laravel is to me like .Net without the big prices. Host where i want not stuck with windows. I like .Net, next really? Lets jam a front end tech into this... huh?
49:22 he's saying TypeScript is not enforced at runtime, that's why he says "pretend types". TypeScript doesn't provide type safety, it provides type hints, and whoever disagrees better take a look at what Vite.js does. Vite.js will build your application if there are type errors, because they just gave up completely on the idea of enforcing types even at build time, they just delegate that to your IDE and your CI piplines or whatever you're using to deploy. Which makes sense, at least they're being realistic about TypeScript. On top of that there are also some pitfalls in TypeScript where it can be just wrong, specifically with arrays and union types. Just as a very simple example an Array con become a valid Array, which is nuts.
In practice, TS uses "type erasure", and it works like Java, Python, C, and many others. Languages like C#, Rust and PHP have "reified types", where type information is integral to the objects and kept on runtime. Type erasure is okay, and was not invented by TS. It's just another way to do things.
There is no Laravel without PHP. So Laravel cannot be beautiful if PHP is not. I use Laravel and I started using Vanilla PHP from the onset for many years. I love PHP and everything around it's ecosystem, including Laravel.
PHP Frameworks… okay… you started talking about it… Laravel? Hmm.. No.. wouldn’t touch that.. Symfony? Yeah.. better.. but.. hmm.. Flow? Definitely! Oh you don’t know Flow? Ah… that’s the problem…. And please… stop talking about Wordpress… that the worst thing that ever happened to the internet..
dude, laravel is the slowest framework that exists. eloquent is the worst ORM in the php eco system. the entire project is a joke. I'll stick witch php, but thx for the advice.
So how is php today: "well, I just don't use it" PHP sucks so much that php developers "just don't use it". It reminds me of Java. it sucks so much that developers built alternative languages to use the jvm, just to avoid touching the language.
100% disagree with this. My company uses it because it's lighting fast (in both performance and getting up and running) and just like any other framework it is of course opinionated (otherwise how do you avoid DRY) but you're not locked into how it does something. It's very easily configured to allow you to do something in any way you want.
Laravel is just what happens when a .NET guy gets dumped into an PHP environment and gets an allergic reaction to the templating and cruft. So why does PHP need to be redeemed, apparently against its will, when you could just use something like C# or Go, built from ground up for the "modern" MVC and routing paradigms, without the cruft? It doesn't make much sense. If I'm going through the trouble to put the
wrapping things in a docker to develop something is not a sane thing to do probably nix is a better option to keep track of all these php versions and extensions
Just downloaded Herd on Mac and got an app up and running in 10 minutes. Excited to build something with Laravel. Awesome episode!
"Telling a fish water is weird" lmao. Aaron is super funny and very articulate. Thank you Lane for this amazing podcast.
My company has used PHP for a long time, and we’ll be gradually migrating new applications to go over the next few years.
It might sound a little odd but they are more similar than you might think by the criteria that are most important to us.
1. Despite what the guest says, they are both “batteries included” languages. Built into both languages are utilities for dealing with JSON, SQL databases, making HTTP requests, regex, email, etc. If third-party frameworks aren’t an option for you, you can roll your own pretty easily.
2. Both value backwards compatibility. In golang they have their compatibility promise. In PHP you can get a 15 year old application running with only minor changes generally.
3. The ecosystem. This is largely a product of the first two items, but both languages do have a good ecosystem. Composer and go get are the two best package management solutions I’ve used by a pretty wide margin.
Syntax, performance, programming paradigms, and even static typing obviously make some difference in how you use a programming language, but their impact for many (most?) use cases is completely overshadowed by broader concerns.
that's super interesting actually
I'm in favor of static-typed languages like Go and Rust.
However, I can say that I appreciate languages like PHP for writing scripts or some particular HTTP tasks for example instead of Javascript.
The reason is that writing PHP code (v8) feels to me more succinct than writing plain JS or indentation-based languages like Python or Ruby.
That is because PHP has improved a lot its syntax, performance and added support for strict typing. Francis has a nice video about PHP's built-in features enums, pattern matching, closures, etc.
Although PHP is single-threaded, if you want to do multi-thread PHP stuff, you have C extensions like Swoole.
Or if you are worried about performance, the compiler team is working to get a new JIT for PHP to optimize it even better in the future.
So IMO PHP is fairly decent at this point, so why not give a try?
Yeah, not sure about the threaded thing, the most annoying thing is dealing with moving an old monolith from mod-php to fpm-php and making sure you are tuning your application correctly
I'm thankful for the lack of "side quests" in PHP. JS is a nightmare to wade through right now as a beginner. For me, it's an easy choice. Laravel and Vue.
you can't say JS is a nightmare then use JS framework hahaha
@@berserkerrxii5776 fr LOL
Talking about frameworks in JS land - yes Next.js doesn't compare to Rails and Laravel, but there IS a JS framework that's trying to be like that - it's called Adonis. It comes with auth, database, file storage, etc. Unfortunately the community and publicity is just nowhere near other JS frameworks for some reason. There's also Nest.js, but Adonis is a lot closer to those full-featured frameworks.
Yup, big thumbs up for Adonis from me too. It's a great framework. They really know what they're doing in terms of developer ergonomics.
@@rumble1925 The integration of payload CMS with Next is awesome as well. You now get all these functionalities such as authentication out of the box.
37:51 I would disagree in the sense that I use Golang not because I want to be able to handle 100,000 requests per second, which would be cool, but rather to drastically reduce CPU time and memory usage. After all, CPU time and memory are exactly what I end up paying for with cloud computing. And when Laravel advertises Severless for performance, just like JS/Node, I find that a bit dubious, because it ends up costing quite a bit when the credits are used up.
I can relate with the disgust at 51:26.
I'm a big php fan, but last week I was using a standard function, array_merge, which you'd think it merges arrays, right?
Here's the kicker: if you try to merge arrays with numeric keys, it actually behaves as an append! That was a fun hour.
I cant even tell how this conversation was fantastic, you both are really good speakers. Im getting comfortable with laravel ecosystem and very happy with the productivity
Hah! I use PHP as a templating language all the time! The CMS we use is written in Java, but we used it to produce PHP scripts. 😂 None of this front controller routing stuff, just an index.php in every directory. Bish, bash, bosh, job's a good 'un!
This is a new learning for me
Wow this debate really clarified the vs. framework discussion
Ah! I already followed Aaron Francis UA-cam before!
Now follow this channel too. Keep it up!!!
I think of typescript as just an easier documentation tool.
When I don't care `as any` is my friend, and on important stuff just type a small type declaration, no big deal. `strict: false` always
Laravel is just good, it works, it scales nicely for us, love it.
Underrated video, enjoyed this a lot
Interesting chat, but:
I don't think you guys know what static vs dynamic typing is.
"We don't have huge amorphous arrays that we pass in PHP" - what? It's the exact thing I see most of the time.
Best explanation of what really laravel is.🎉
Aaron basically saying he likes types (class instances) but not the syntax
TS is clunky but we use it often for the same reasons he uses classes in PHP: so we know what we're working with
And JS has an unfair aversion to using classes otherwise I think it would look quite similar at the end of the day
I think he's specifically not a fan of the structural typing in TS here
@@raenastra perhaps. I think inferred Typing would get him a long way towards appreciating it a bit more, but i understand he prefers the structure of class instances to raw objects. Just pointing out he could prob get a lot of what he likes in TS as well (tho no Laravel of course)
Great content!! very insightful for beginners
As I understand the extended failure-to-convey sequence about type-safety that never really got resolved as it relates to (eg) Laravel, the thing not being said is: in modern PHP a properly-instantiated class instance *can be a type*, and that's so much more useful than str/int/whatever nitpicky typechecking, and so easy to define in the class definition, that lower-level annoying type crap becomes unnecessary if you're actually... ya know. Working.
(Yes, your description of Golang struct as being analagous to class-based typechecking is about right)
All of us don't care so much about types. We care about not having type *errors*, especially hidden ones. Nitpicking cares about types and pragmatic struct/class validation cares about errors.
Mm😮
Raw PHP is perfectly fine, you can search the database in a couple of lines and create the result on the fly, no extra files, no library, no nothing, what's wrong with echo? is shameful to use it? is way cooler to have 1000 packages to do the same in other way? which they will have dependency problems? and you will be executing other persons code which could have virus?. If you have a big project is better to use a framework, I use svelte and GO lately, but I don't forget that for some cases PHP is way superior.
The talk was nice.
But typing is pretty good and important, even in PHP.
Talking about an API, creating DTOs is pretty easy and it would prevent exposing Properties/Attributes as you define only those that are meant to be sent to a client.
19:44 I enjoyed how he repeated "7000 engineers working on React" twice, given that React team has like 10 people and Facebook used to be 100% written in PHP 😂
You want truth and facts??? Wrong pod
but you cant use laravel in wordpress can you ?
Podcast about backend? Been looking for something like this for years. Subbed!
Oh god, I do understand now: I don't know it, I don't use it, but I know it sucks because it looks like it sucks. Is this reddit?
I'm making it 501 likes as a. PHP lover
hey!
Don't mess with Typescript, it basically fixed Javascript. haha.
Isn't Vue a library like React? Why Vue instead of a full framework like Angular which goes slowly but stable with backwards compatibilty too?
I can understand the hate for React, with all those libraries updating in diferent dates, and with breaking changes in frameworks like Next.
But I see Vue as something similar like React, they even have Nuxt which almost sound like Next .-.
Shouldn't it be a better option Angular? which is a Complete Framework that doesn't have that many updates like React and its thirdparty libraries but it is still cool and stable. I almost see it as a equivalent to Laravel but for Frontend...
I write "echo" whenever I create a Dockfile...
Lane said fuck
hey now... true
Laravel is like macOS while Next is like some Linux Distro.
It ain't a tiring typing dollar 💰 sign because it looks money 🤑.
🤣🤣
54:55 I don't remember typing dollar signs when writing PHP.
Are you sure you've actually used PHP then? In PHP, a variable is declared using the $ sign followed by the variable name 🤷
$noob
You used Euro signs?
Php for getting shit done fast.
Go for performance, low cost and low maintenance.
25:00 a fractal of bad design was a tear down of PHP what 5.4??
Fast forward how many versions that have come since then, it's hard to see how that article is even valid anymore.
What about Symfony & Drupal?
They have less money for marketing.
5:56 I don't know a thing bout raw PHP. Is it a Framework? Or am I so dumb not to realise people use the word in place of "Vanilla" PHP? 😹😹😹
Great episode! I got really excited when I saw it was out, but I can't help but feel a bit uncomfortable watching it because it seemed like Aaron was upset at something the whole time. Maybe it's just me. Hope everything is ok on his end.
Haha really?? I'm all good! Love to banter
@@aarondfrancis Good to hear! Yeah, I think it was the combination of the crossed arms plus the face you make when you're thinking that comes off as a bit angry. But as a PHP developer who's built a few libraries in his time, your takes on gradual typing and classes seem spot-on to me 😀
@@JanJozefo ha perfect, I shall forever be self conscious about my face now 😂😂
@@aarondfrancis I think it might be a combination of where the screen you're looking was located vs your webcam. I wouldn't go as far as calling it an angry/upset look, we're just used to seeing you more relaxed. Great talk by the way.
Next time someone says they hate x language with passion an vigor, simply ask them why.
It's astounding how little insight they will have after the basic pebble throwing around types.
Most virulent haters of any language are either purists, or sheep.
44:26 me before I started using TS
golang only language can compete with php/laravel productivity
Typescript... MS's reach into a biz they lost. I spend so much time leaning TS instead of coding, agreed hate it. Agree the pinnacle of react is over gone. Don't get it overly complex. V19 with now a compiler, so now all that pain with usememo, usecallback i can toss? nice how about Htmx, or livewire. Laravel is to me like .Net without the big prices. Host where i want not stuck with windows. I like .Net, next really? Lets jam a front end tech into this... huh?
49:22 he's saying TypeScript is not enforced at runtime, that's why he says "pretend types".
TypeScript doesn't provide type safety, it provides type hints, and whoever disagrees better take a look at what Vite.js does.
Vite.js will build your application if there are type errors, because they just gave up completely on the idea of enforcing types even at build time, they just delegate that to your IDE and your CI piplines or whatever you're using to deploy.
Which makes sense, at least they're being realistic about TypeScript.
On top of that there are also some pitfalls in TypeScript where it can be just wrong, specifically with arrays and union types.
Just as a very simple example an Array con become a valid Array, which is nuts.
In practice, TS uses "type erasure", and it works like Java, Python, C, and many others. Languages like C#, Rust and PHP have "reified types", where type information is integral to the objects and kept on runtime. Type erasure is okay, and was not invented by TS. It's just another way to do things.
that title is so bad! learn the framework not the language? the podcast was good tho
Ex-PHP dev here. Calling PHP one of the older languages still in use is just weird to hear. Also very wrong.
google is the reason i stay away and have no interest in GO. evil empire.
There is no Laravel without PHP.
So Laravel cannot be beautiful if PHP is not.
I use Laravel and I started using Vanilla PHP from the onset for many years.
I love PHP and everything around it's ecosystem, including Laravel.
I make fun of Javascript (and yes, typescript = javascript)
PHP Frameworks… okay… you started talking about it… Laravel? Hmm.. No.. wouldn’t touch that.. Symfony? Yeah.. better.. but.. hmm.. Flow? Definitely!
Oh you don’t know Flow? Ah… that’s the problem….
And please… stop talking about Wordpress… that the worst thing that ever happened to the internet..
Would you mind elaborating on how Wordpress is terrible? Just a few points, I would really appreciate.
dude, laravel is the slowest framework that exists. eloquent is the worst ORM in the php eco system. the entire project is a joke. I'll stick witch php, but thx for the advice.
This comment is written by a Brainf*ck programmer
So how is php today: "well, I just don't use it"
PHP sucks so much that php developers "just don't use it".
It reminds me of Java. it sucks so much that developers built alternative languages to use the jvm, just to avoid touching the language.
Write PHP not Laravel!
code should be framework agnostic! so yeah, you don't write laravel code, you write php code.
Write PHP, not Laravel.
Laravel is bloated, heavily opiniated and slow. It's made to sell courses, so it has a steep leaning curve and a fragmented and confusing ecosystem.
its easy and awesome to use lol.
100% disagree with this. My company uses it because it's lighting fast (in both performance and getting up and running) and just like any other framework it is of course opinionated (otherwise how do you avoid DRY) but you're not locked into how it does something. It's very easily configured to allow you to do something in any way you want.
Laravel is just what happens when a .NET guy gets dumped into an PHP environment and gets an allergic reaction to the templating and cruft.
So why does PHP need to be redeemed, apparently against its will, when you could just use something like C# or Go, built from ground up for the "modern" MVC and routing paradigms, without the cruft? It doesn't make much sense.
If I'm going through the trouble to put the
wrapping things in a docker to develop something is not a sane thing to do
probably nix is a better option to keep track of all these php versions and extensions