What are frameworks like Laravel? Why should my team and I use them? | Big Tech on Point Podcast

Hi everyone. I’m JohnoTheCoder Welcome to another episode of big tech on point. This week, we’re gonna talk about what is a framework and how does that differ from a CMS or softwares platforms that you might have heard of quite often, when you talk to an engineering team or you talk to developers, web developers, whoever they say to you , we are going to build on and that’s fine.

Now, most programming languages have frameworks and the reason they have frameworks, and the reason that you’ll hear developers talk about what framework they like to use and why it’s good is because way back when, if we do like a little bit of history for a second, we used to build vanilla. And when we talk about building vanilla, it’s using a language, only the features that the language has. And therefore you have to do a bunch of the same job on every application that you build.

So when we look at really common problems or really common solutions, things that we do all the time and I’ll take WordPress is the example. Again, building all of the features that WordPress has a standard blog in features , pages, managing users, forgot password, registration, all of that stuff. It all takes time. So when you go and build something, you have to factor in all of that build, even though that’s not really what you wanted. And that solves the problem for websites now, with WordPress, as you install it, it is a thing it’s a WebPress website, it’s a website it’s already there . It’s got some options, some settings, you can install some themes and stuff, but there is already a working piece of software that does a thing. And I don’t use WordPress an example, but you’ve got Drupal and there’s loads of others. And they all come as a prepackaged thing. You know, it’s kind of like buying a piece of flat pack furniture. You buy your piece of furniture, you take the bits out the box easily, and there you go. There’s your dining table. Happy days.

The reason we talk about using frameworks is cuz when you build an application, it doesn’t really matter what we’re talking about. There’s a bunch of things it has to do with standard things that they’re not features really. They’re not things that you would ask for. They’re not things that you would expect, the things it has to be able to do. I’m gonna talk primarily in my examples, I’m gonna talk about Laravel, Laravel is an MVC framework that is developed on PHP, but most languages have them.

Node JS has expressed JS asp.net comes with NBC out of the box. Java has spring there’s the just goes on and on. Uh , Python has Django. Uh , Ruby has Ruby on rails. They’ve all got, I mean there’s lots and lots and lots of them in PHP alone, you have Laravel symphony Zend, CodeIgniter, cake PHP, Falcon, the list just goes on and they’re all good at different things. They all come with different pros and cons like everything. But the thing when you development team tell you, oh , we’re gonna be using a framework for this thing is , is not the same as just installing WordPress and having a website or installing , uh , e-commerce platform. And you run through an installer and then you have a shop ready to our products to , it’s not the same as that.

This is the equivalent of having all of your raw materials delivered. So instead of me having to go out and I’m gonna show how little I know about the building instead of me going and chopping down trees and turning them into scaffolds and turning them into floorboards and everything else, cuz that’s crazy. Although we need eat that thing to happen.

You can’t build a house without the stairs and for the stairs, you need the wood, but that’s a very expensive thing to go and do. So I would just buy the wood from somewhere and that’s equivalent. That’s really what is happening when you’re using a framework is you’re being given a bunch of tools, but it’s up to you to use them. And it’s up to you to you to lies the features of that framework features aren’t features in terms of, I want an events calendar. These are features like we’ll handle HTTP requests for you, we’ll handle your looting. And routings when something comes into the application and you need to decide how you are gonna handle it. And that usually you are gonna be looking at a webpage. So when I go to forward slash about something, needs to figure out that what I want is the about page and there’s gonna be some page emails and database stuff and things that happen to give me the about page or the news listing page ver page.

So what frameworks do is they really simplify the build process by taking these really common jobs, doing them very it very well by using packages, someone else has done and it reduces the amount of bugs and stuff. And the way it does that is because this one component, this one package is used by so many different teams cuz everyone that uses Laravel uses those features. And what that really means is that I get the benefit of a whole bunch of developers all contributing towards it. I get the benefit of all of the users of all of those applications, which is gonna run into millions and millions of people having tested it. So now this is a thing that I don’t have to personally develop. And as we talked about one of my other , uh , episodes, because I didn’t develop it, obviously have to test it .

My things still work, but I’m unlikely to come across in any framework of any sort of maturity, I’m unlikely to come across those kind of core level features. Things like uploading a file or saving a database record or implementing some caching. Now there’s another really important benefit of using these frameworks minus the, take the fact that all of the foundations for the application managing how you connect to a database or multiple databases or how you are gonna deliver a kind of decent cash in mechanism or session management and all of these kind of really boring tech features that you don’t care about. And frankly, the developers don’t care about if they’ve been in the industry long enough to have been, to have worked on things that weren’t built on frameworks before frameworks was kind of really the main way to go those tasks.

We’ve built so many times it’s tedious for us, but there’ll still be the odd bug in it. There’ll still be the odd edge case I’m gonna cover what an edge case is. And one of my other episodes, we’re gonna talk about testing and the different types of testing that’s available. So we save all this time. And obviously that means we save money because what we’re really doing is we’re spending all of our time building the feed for your app, not the generic foundation level stuff that is expensive to build and ultimately kind of pointless cause someone else has done it better. But the second part of what makes these frameworks so valuable in your new product in your new software is that they tend to be ready to cater for a whole bunch of things that you might not be ready for at launch . And I’ll take an example and I’m really sorry, but this is gonna get just slightly technical, but I need second. When you click a button to upload a photo to Facebook, it only does a little bit of what you think it does when you click that button. So you click the button, it uploads the photo and it saves the caption. As an example, there’s a whole bunch of other things it’s gonna go and do off the back of that. But because you’ve just posted it. If you’re talking about Twitter, I can subscribe to people and get a notifications. So those notifications get sent out. Or what if there’s a thousand people that follow need that notification or sorry, a thousand people that have favored me so need a notification. And maybe there’s a million people that follow me. So I, my new tweet now needs to show up in a million people’s different feeds that’s without things like hashtag search in everything else.

Now, as your application gets bigger, complexity comes with an application, not really as a result of the complexity of the features. Sometimes that’s the case, but the thing that makes it more impressive when you’re looking at a CV or the thing that makes it more complex is always the way that you manage it . Lot of that is by offloading what your web servers are doing. So the thing that the user does, they click the button, they upload the photo. That photo now needs to be distributed to a bunch of other places so that it’s available around the world. A bunch of people need to be notified. Maybe some emails need send in, who knows maybe it needs to be auto flagged and reported. And all of these things happen. And the way that you make that, not tremendously slow for the user that’s uploading it is that you would take that job and jobs and put them on cues . Now that as I’ve built those tools from scratch and I’ve used those tools in frameworks, they aren’t the most complex things in the world to write, but they are is kind of a precision engineer type thing . You do have to get it just right. And that’s just one example. You’ve got an application you wanna start rooting things differently. You want configurations to be able to change based on what’s going on. You wanna be able to use my loads of data and it’s being all accessed very , very quickly by lots of users.

Some of these things would require almost a complete rewrite of your whole application. Once you hit a certain threshold of load in a certain scale and particularly Laravel, which is where I’ve got the most experience, Laravel handles these things really well. And they have a bunch of packages that mean that you don’t ever have to go and rebuild your application. Usually if you’ve used the packages and the features that they’ve got. So just as an , in a previous role, I developed a tool that would build demon jobs and a demon job is a job that just runs forever. Even if it’s got nothing to do. So, and it sit there. And what happens with a queue is you get this queue and obviously sometimes the queue is empty and you have have workers that will take jobs off of the queue and do them. So maybe send that notification and it’s quicker. You know, if you think about people like Steven Fry with all of their followers, as soon as he posted something, there’s gonna be like a whole bunch of notifications are gonna go out. Awesome . So you would put those jobs onto the queue and your workers would sit there doing nothing until there is something you to do.

Now, one of the things that can be quite difficult with that is you don’t necessarily know when your load’s gonna happen. Some load is really obvious, like new year’s Eve suddenly Facebook’s gonna explode with people post their is about what an amazing year they’ve had and how the next year is their year and all of this stuff. And that’s fine. So that’s a predictable spike, but there’s some things like today, meatloaf absolutely devastated about it. But , um, or actually by the time this goes out, it’ll be yesterday , um, meatloaf passed away. So that’s an unpredictable spike in the loads that social media might have had. And if you were running an application that was specifically dedicated to rock legends, you are gonna experience a big spike in activity as it , out of that. And you couldn’t have predicted that if you could tell me how cuz we could make loads of money with it. So what happens , what you need to then do is say, well , we use Q , usually we send 5,000 tweets a day. We need one worker to be able to get through that load. I’m making these numbers up, but I know meatloaf died . Now we need to send 50,000. So we’ll spin up 10 workers instead. And Laravel has a package called horizon . And what horizon does is it manages that process for you of spinning up your workers , spinning down your workers and managing all of that.

Now that sort of tool. If I had to go back through my application and now like that, that would be a very, very expensive task. All of these tasks where you suddenly hit load and scale would be really expensive. These frameworks have the tools there. So all you have to do is know they exist, know how to use them and be able to go and implement them properly at the relevant time . So this goes back into what we talked about in the last episode about doing what you need to do right now and understanding how to not block yourself off. A lot of frameworks do that for you. So they’re your two main reasons.

Firstly, your build speed is always gonna be quicker when you’re not building things that need that don’t need building. Someone else has done it. They’ve done it better. We’ll just use that. And the second one is when you hit load, when you hit scale, when you need to add complexity, those frameworks for the most part have been built with that in mind to stop you, having to go through and completely rewrite your software. As soon as you hit a certain threshold of users or as soon as you’re starting to really struggle. And particularly with Laravel is also ready for you to be able to do this or for you to be able to move your files from being on one server, to being sat on Amazon web services or digital spaces or something like that. So it’s quicker to build. It’s more reliable and I’ve forgotten my third point. It’s quicker to build. It’s more reliable. And when you need to scale, it’s ready out of the box to do it for you. And that is when your development team are talking about frameworks. That’s what they mean. But just because it’s a framework and they’re building a top thing until they’ve actually coded it to do something,

I’m Johno, you can follow me on socials @ johnothecoder and I will see you next time.

I'd love to hear your opinion on what I've written. Anecdotes are always welcome.

This site uses Akismet to reduce spam. Learn how your comment data is processed.