در حال بارگذاری ...

PHP vs Laravel Debate0:00

All right. So tell me what you think of this. A question that often pops up in the Laravel community revolves around this idea of, well, if I'm a newcomer, should I learn php first, or should I skip over it and jump into Laravel? And here's what I find interesting. Uh, traditionally in the olden days, back in my day, uh, it was universally agreed, well, of course you learn the core language first, right?

it was universally agreed, well, of course you learn the core language first, right? You gotta learn how to crawl. You gotta learn how to walk before you can start running. And, um, I agree with this. However, if you see these questions crop up, uh, often they get many, many responses. Um, community members, php developers, Laravel staff and core team and package developer, they all, uh, will give their thoughts.

and core team and package developer, they all, uh, will give their thoughts. And what I find interesting is frequently they will say, well, you know what? Laravel is php, right? So if you want, if you're a newcomer, perhaps you should just start with Laravel and you will kind of figure both out at the same time. And hmm, I'm trying to figure out what I think about this, right?

And hmm, I'm trying to figure out what I think about this, right? I have a lot of thoughts, and as you can imagine, I work in the education space. I specifically, um, teach this stuff. And so it's interesting to me, right? You shouldn't be thinking about this at all, but me, it's my industry, it's my space. And I'm always curious what the best way to onboard somebody is.

Defining the Newcomer1:26

And I'm always curious what the best way to onboard somebody is. Okay? So we're gonna work this out together. You're gonna help me, Should folks learn PHP or Laravel first? And we're going to assume that this imaginary person, we're gonna, uh, we'll call him Joe or Jane. This person knows some HTML, they've learned some CSS, but that's the extent of it, right? They don't know anything about, um, any backend language.

but that's the extent of it, right? They don't know anything about, um, any backend language. And that's really important, right? If you're coming from the Ruby world, but you don't know php, well, that's a very different thing then if you literally know nothing, if you don't know nothing, uh, these are just different conversations. So what we're talking about right now is literally a newcomer.

Case for Laravel First2:14

So what we're talking about right now is literally a newcomer. They know the basics. They know how to make an each one tag, and now they're ready to make their websites dynamic. Okay, we got it. We're on the same page. So the argument for learning Laravel first, here's what I'm gonna say to the Laravel team. I'm onto you. I know what you guys are doing, and I know it is to your direct financial interest.

I'm onto you. I know what you guys are doing, and I know it is to your direct financial interest that folks skip over php and they just die right into Laravel without seeing what else is available. I see what you're doing. Uh, I'm just kidding. There's probably a little bit that, there's probably that much that, but I think actually in reality, uh, most of them are just saying, you know what? You can become overwhelmed when you're learning, uh,

of them are just saying, you know what? You can become overwhelmed when you're learning, uh, vanilla php. Even something as simple as like the process of securely connecting to a database. It is way simpler than it was back in the day. Uh, back in the php four MySQL connect days, um, there were endless tutorials that were rife, is that the right word? Rife, uh, with, uh, errors and vulnerabilities.

rife, is that the right word? Rife, uh, with, uh, errors and vulnerabilities and SQL injection, uh, opportunities. It's not as bad, uh, as back then, but still, you know what? I'm gonna be honest with you. If you told me right now, just write out the full process for, um, creating a connection to a database and, uh, updating some records. You know what? It might take me a minute. I've been detached from that for so long.

You know what? It might take me a minute. I've been detached from that for so long. I'd have to relearn the API, and it's just a little bit, I dunno, cumbersome. So I get the arguments, and I was just teasing with the Laravel team. Uh, I get the argument that would it be best to skip over some of the more, uh, verbose aspects of PHP and immediately dive into a platform.

verbose aspects of PHP and immediately dive into a platform where you see instant results? Uh, there's a lot to that, right? So I think that is, that is a feather in Laravel capped. Even if you don't know anything, you could probably follow a tutorial or work with AI, work with AI, unbelievable. Uh, you could follow a tutorial, you could watch a Laracasts video, uh,

Uh, you could follow a tutorial, you could watch a laracasts video, uh, or go through the Laravel Bootcamp and maybe get something on the page pretty quickly. And you know what? I feel like that is like one of the most important things, right? We need to have a term for that. Like, uh, you know, when you are measuring, uh, performance for websites, there's uh, this idea of like, um, I'm not even gonna tell you what the term is right now.

for websites, there's uh, this idea of like, um, I'm not even gonna tell you what the term is right now 'cause I can't remember, but it's something along the lines of like, time until first paint time until you instantly see something on the page. Uh, some of you know exactly what that term is. I do not, and I'm not looking it up, but I feel like we need something along those lines for learning time until your first win, right? And in this world, I think the first win is like,

for learning time until your first win, right? And in this world, I think the first win is like, you write some code and you see it in the browser, right? This is the amazing thing about learning HTML first. You, and we've all experienced this. You like create your first <h1> tag. You don't know what <h1> means. You don't know that h is heading, you just know it makes it big and bold. So you create <h1>hello world</h1>, you reload the browser,

you just know it makes it big and bold. So you create h1 hello world, you reload the browser, and bam, you instantly see it, right? That, that was the moment for me when I'm like, okay, I get it. This is cool. And then you learn like, okay, here's paragraph tags. Here's how I create a list. Like there, the, the response, uh, the, the what do we want here, Jeffrey?

Like there, the, the response, uh, the, the what do we want here, Jeffrey? The time between each win is very rapid at that stage, right? Instant results. Uh, and we want that when you switch over to any language, right? Any backend language. So I'm thinking this through here, and you think through it well, with me as well, you already have an opinion, but let's set our opinions.

and you think through it well, with me as well, you already have an opinion, but let's set our opinions aside and really try to think of this time to first one in php, I open a file. It can be simple HTML, and I can still echo HelloWorld and I can load the browser and I'm gonna see a response. That's really cool. Um, but then when I wanna do anything else, it just gets tricky, right? So with vanilla PHP I can link between pages.

it just gets tricky, right? So with vanilla php I can link between pages. I can have some dynamic content. I can play around with, you know, the, the usual 1 0 1 stuff, create an array and then loop over the array and render it in the browser. That's all very helpful. But if I ever wanna do anything practical, if I actually wanna begin the process of building a website, which will always consist of like connecting to a database and creating tables

of building a website, which will always consist of like connecting to a database and creating tables and querying against those. I mean, most applications are just CRUD, right? We want to imagine they are more than that, but they're just CRUD. Uh, Laravel is 100% CRUD. Think how many applications are just CRUD? Your invoicing app is CRUD. Your CMS is CRUD, your contacts list is CRUD.

Your invoicing app is CRUD. Your CMS is CRUD, your contacts list is CRUD. Anyways, how quickly can we onboard a person into building their CRUD app? Um, Laravel is gonna be quicker, but I am sensitive to the idea of like the rest of the PHP world here in folks in the Laravel community. Say, Hey, just skip over that. Just start with Lara, come on board

Say, Hey, just skip over that. Just start with Lara, come on board and then you'll figure it out. I'm, I'm sensitive to them saying, you sure about that? Really, I see what you're doing and I see it too. Um, but I'm trying to give the devil up stew, not to call Laravel the devil by any stretch. Is there value in it? Uh, and is this something I should recommend? And I, I keep coming back to

Overwhelm and Foundations7:48

Uh, and is this something I should recommend? And I, I keep coming back to crawl before run. Uh, even if you can find your first win, if you start with Laravel, I am just so concerned about, um, the overwhelm factor, people being introduced to not just a new language, not just new syntax. Not just a new way of doing things, but also, uh, a very big framework, very big community, uh, and hundreds of files.

but also, uh, a very big framework, very big community, uh, and hundreds of files. The second they install that, um, project, can they figure it out? Um, maybe, maybe I've learned not to underestimate people. I, I think there's often this tendency to protect the newcomers. This is something I've seen endless times, uh, over the years.

This is something I've seen endless times, uh, over the years. Uh, and I fight against it. And I feel myself leaning towards that view a little bit here. So I wanna be careful. I wanna check myself. I never wanna fall into this trap of thinking like they can't figure it out. I know what I'm doing, but the newcomers, they're gonna be overwhelmed.

I know what I'm doing, but the newcomers, they're gonna be overwhelmed and they like people, people are smarter than we get them credit for. They can figure this stuff out. They know when they hit a roadblock, uh, a roadblock. They know when they hit a roadblock to take a step back and they're like, okay, I need to learn a little bit more about this. If they're working with routing

to learn a little bit more about this. If they're working with routing and they just can't figure out, um, even the syntax, like maybe it's where we have route::get, and the newcomer's, like, what are, what are those two colons? I learned how to create a variable. I learned how to create a class. I knew about the little dash, uh, greaterThan sign the arrows,

I knew about the little dash, uh, greater than sign the arrows, but I've never seen the colon, the two colons. What on earth is that? You know, I could say, well, they're gonna be overwhelmed by that. 'cause they're, they haven't learned the basics yet and now we're throwing them into all of this stuff. They don't understand. Well, they're gonna figure it out, right?

They don't understand. Well, they're gonna figure it out, right? They're gonna Google, or they're gonna ask AI and they're gonna say, what are those two colons? And then they're gonna get this perfect, um, explanation for what it is, and then they will go from there. So we wanna be careful about underestimating just how smart people are. However, we also don't wanna needlessly overwhelm them. And there's just something to be said for

However, we also don't wanna needlessly overwhelm them. And there's just something to be said for let's get started and get our feet wet and figure out what a variable is and figure out what an array is and learn the building blocks of a framework. Just build our way up. Learn the building blocks so that then when you do switch over to any framework, and maybe it's Laravel, maybe it's not,

that then when you do switch over to any framework, and maybe it's Laravel, maybe it's not, but when you do, you're gonna browse around these files and instantly feel like, okay, there's a lot here. I don't understand, but you know what? I kind of get it. I see what's going on here. I've created files before. I know why this file is extracted. I know what a class is, I know what a controller is because I sort of built my own makeshift controller in my project.

because I sort of built my own makeshift controller in my project. Oh, views models, okay. The model generally is business logic, but also just kind of, um, an abstraction for querying my database. Okay? I got that views. I created my own views. That's sort of where the template goes. And I receives the data. Okay? I kind of know what I'm doing here, right?

Deep-End Learning Argument11:02

And I receives the data. Okay? I kind of know what I'm doing here, right? That's what I like. However, let's go back to the other side one more time. Is there value in throwing somebody into the deep end of the pool and just saying, you know what? You're gonna figure this out. Just play around, ask questions, have some wins. And you know what? You will catch up to anything you don't instantly understand.

And you know what? You will catch up to anything you don't instantly understand. There's something to that as well. You know, I look at my young son, he's almost one, he will be one next month at the time of this recording. And yeah, it's like I, when we we're teaching him how to talk, we're teaching him how to communicate. And we're not doing this like we start with the building blocks. Uh, we're just asking him to say words, right?

with the building blocks. Uh, we're just asking him to say words, right? And sometimes he starts to say the word and he doesn't know what the word is, right? But he catches up, right? He will say what we say, and then slowly you can just tell. He starts connecting the dots. Like, oh, oh yeah. When he says, yeah, which is kind of cute, he goes, yeah, yeah, yeah. When he says, yeah, that means he's saying, okay,

yeah, yeah, yeah. When he says, yeah, that means he's saying, okay, yes, I want that. Please. Um, if, if he says no, which he hasn't said no yet, but when he does, he will get that as well, right? He will understand, even if he learned the word before, he knew what it meant, he will catch up. And I wonder if that is the same argument for learning any kind of framework. First, get some wins, figure it out.

for learning any kind of framework. First, get some wins, figure it out. Go into the deep water, right? Like the most I have ever learned in my life is when I dove or dived, whatever one is correct there into the deep end. And I felt like I was drowning and I felt like everyone understood it except me. But what ends up happening is I start paddling and I start researching and I have some late nights and I catch up.

and I start researching and I have some late nights and I catch up. Most people would agree. That's when you're learning the most. And maybe there's a, maybe there's something to that for newcomers. I don't know. So this is something I am genuinely thinking about. And like I said, you should not be thinking about this at all except for this video.

Requesting Viewer Feedback13:08

And like I said, you should not be thinking about this at all except for this video. And when we're done with this video, you don't think about it again 'cause it's irrelevant to you. But it is very super relevant to me. And I'd like to know, how do I handle this? So tell me your thoughts. Um, if you're on YouTube, ask a comment below. If you're at laracasts.com, ask a comment below.

if you're on YouTube, ask a comma below. If you're at laracasts.com, ask a comma below. If you're watching this on x leave a leave an X, whatever it is. Uh, my name is Jeffrey. We, this is the laracasts snippet. I'll see you next time. Bye.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟