I just migrated to writing PHP as OOP and I am absolutely loving it, I am sticking to procedural for small non-scaling projects but using using the OOP for scalable projects obviously because it maintainable and neater
Hi Dani, you're the person who made php make sense to me. For the past months i have been reteaching myself and practicing making my own frameworks in different ways. I have a few websites deployed on the cloud and i am now redoing them using OOP.
I'd like to add that you can find a middle-ground, insofar as having a fully procedrual/functional site/app with files and functions all split out like you would in OOP/classes. This is how we build our apps within our agency, and it works really well. Not to say OOP couldn't work well, but for us, procedural/functional with very organised files, splitting out of functions into various self-contained files, allows us to have zero duplication, and many of the benefits of the OOP 'approach' without the somewhat more complex code structure.
I'm no expert in any form of coding in any language however I think your comment that these are just tools is absolutely spot on. The same statement can also be applied to which language do you write your code in as well as a great many other aspects of life (which is the best hammer for driving that nail? Should I use my sledge hammer or would the pin hammer be better suited to the task?). You evaluate the project and decide which is going to give you the required results.
Very useful overview for a beginner, thanks! I am building a personal website and will not tinker much about it in the future, at most once a year. I think I would find it easier in the future to understand what I originally planned if I stay with procedural solutions.
OOP for the win, it's soo much easier to work with blueprints. What I like the most about php is you don't have to include something from somewhere but just include the file and all variables and methods are available.
Hi thanks for the video. if you go to use a full framework like codeigniter, symfyny or laravel, the basics of php are not enough, you need the basics of OOP. if you find a online course telling you that to learn a full php like laravel you only need the basics of php, think twice or more. If you are connecting to a DB is better to use PDO then a specif drive like mysqli ( which allows procedure way) because is a universal / generic driver for any SQL DB. And to use PDO you need to know the basics of OOP Either way, you should know the basic of OOP And some time use with procedure way. Or you can use the mix of the two in functional way (which is sometimes laravel or codeigniter do)
I believe people who insists on procedural havent worked in a large team with complex code bases where the benifits of OOP outshines its cons. OOP just makes more sense in those cases. Although I really dont like the idea of PHP to be embedded directly into the View. But I understand thats one spec of PHP that makes it unique.
before watching this video, i really dont know what are procedural or OOP, i just have coded a PHP site/app for data entry, but i hope i get alot of knowledge in this video
all OOP, is trivially slower in execution. However, OOP, is just plain cooler. But, when I code for myself, I usually prefer faster for the final product.
Currently I’m not using OOP, however, since I like to use JavaScript and post method in it, I’m ending up with huge number of files and folders. I have folder for php, js, css, imgs, etc. I feel that the page is organised in somewhat similar way. I have a page with some forms and plus I have a bunch of various files doing things I need for the page.
I know this is one of those nooby questions but I'm having a bit of a panic, I feel pretty competent with HTML, CSS, and PHP (kind of), but I've entered a software / webdev workplace and basically none of that is used, they are using angular / CSS and the implication was that PHP is outdated. My goal is to get my own wee website up and running and I constantly feel like I'm just behind the times. Is PHP still useful or is it a bit antiquated nowdays?
Depends which country your in. PHP is one of the best programming languages you can learn if you want to become a freelancer. There's tons of jobs for wordpress, laravel and magento developers as well. Even though no one builds websites on vanilla php nor vanilla javascript, learning laravel (OOP PHP) and a modern front-end framework like vue.js will not only make you feel better but it will also help you land a well paying job
Most of the time when people say PHP is outdated, it is because they think PHP is the same as it was many years ago, back when it was around PHP 5. The current PHP 8 is modern, constantly being updated with new features, and in NO WAY outdated. 🙂 80% of ALL websites wouldn't use PHP, if it was "outdated"... 👈 I'm guessing you are working with some older gentlemen, who have experience using a older version of PHP hehe. Which is perfectly understandable, but unfortunately it is very common to hear people down about PHP, because they don't stay up to date with its improvements over the past many years. It's unfortunately one of those awkward moments where people say "PHP is outdated", but ironically they out themselves out for being "outdated developers" by not having stayed up to date with how languages are developing... 😕 So if you are sitting in a workplace that uses Angular, AND are incredibly closed minded about staying up to date with other languages, then I can understand your panic hehe. I'd like to mention, that there is absolutely nothing wrong with using Angular, since it is also a good option. 😊 The issue here, is your workplace stating that "PHP is outdated"... 😅 The important point for you to take from this reply, is that you are MUCH better off knowing PHP for website backend development, than learning Angular. Angular is ALSO good to have in your backpack, but most places use PHP. You are just in a situation atm, where you are in a work environment that prefer Angular over PHP, which unfortunately isn't the language that you have learned... 💁 And to top it off, they have told you wrongful information, that makes you feel that PHP is a waste. Usually whenever searching for a job, the company will list out which languages, frameworks, and CMS systems they use at their company, to make it easier to find developers who know the same skills. 🙂 I'm sure there is a good reason for how you ended up in a company, where they use a language you aren't familiar with. So from my point of view, you are in a situation where you need to ask yourself if you are willing to take a crash course in Angular hehe. 🙂
@@Dani_Krossing Thank you so much for your response, I really appreciate it. You hit the nail on the head, I'm early 30s and working with people in their late 40s-50s with a lot more experience than me. I basically changed career from counselling/psychology to IT and am trying to work my way up from entry QA into some coding work. I really love the type of work, but I feel so behind and I had this big panic that I'm behind + learning what I've been told is an outdated language which isn't relevant in the workforce anymore! I'm thinking that I'll just keep going with PHP, with the hopes that I can transfer the concepts over into this workplace at some stage. Again, thanks heaps for what you do and for taking the time to respond
I think none of extremes are good. Only OOP and no OOP. I'm for start with modular/procedural and when it comes for scenario where not using OOP is silly, I use it. For example e-shop order should be an object, but template displaying various parts, authors, price, stock should not be an object.
your employer will establish which tech stack and programming method you will work with, and OOP is widely use in the real world and that is why you should learn it.
I think this is a good explanation, however I dont think a beginner (with no OOP experience) would understand this and definitely no one new to PHP. This is because I remember when I first started learning more advanced PHP and a lot of lango that you get used to saying after writing thousands of lines of code is not understood by any newbie until they by luck cross that one video where that one guy explains something in layman’s terms, so it finally kicks in. For example, a method is the same thing as a function, only diff is it is a function within a class. If you use the word “method” to a person who hasn’t really learned OOP, this is not going to register in a way that sticks. And imho, properties and variables are also different names for the same thing because one is in a class and one is not, but they serve the same purpose. None of this was understood by me at first. When I watched tutorials where people used classes, if only they had of explained that, I wouldn’t have had to keep searching for that one video which made it all stick in my brain so I didnt need a tutorial. Interestingly, it wasnt until I was seeking to learn how to make an MVC framework that classes & methods finally did not seem over complicated even tho every vid I had watched made it seem complicated because trying to understand $this-> just wasn’t sticking. It’s one thing to copy the code from a video, but it’s another thing to understand it and be able to do the same thing without watching a tutorial.😏
I just migrated to writing PHP as OOP and I am absolutely loving it, I am sticking to procedural for small non-scaling projects but using using the OOP for scalable projects obviously because it maintainable and neater
I Learned PHP with you almost 3 years ago... i got my first job with PHP and change my life, today i'm working with javascripts. thanks man!
Hi Dani, you're the person who made php make sense to me. For the past months i have been reteaching myself and practicing making my own frameworks in different ways. I have a few websites deployed on the cloud and i am now redoing them using OOP.
Thanks to this guy am now a full stack developer. Been following his lessons past 3 to four years. Am even in the route of opening my dream company 😁
I'd like to add that you can find a middle-ground, insofar as having a fully procedrual/functional site/app with files and functions all split out like you would in OOP/classes. This is how we build our apps within our agency, and it works really well. Not to say OOP couldn't work well, but for us, procedural/functional with very organised files, splitting out of functions into various self-contained files, allows us to have zero duplication, and many of the benefits of the OOP 'approach' without the somewhat more complex code structure.
I'm no expert in any form of coding in any language however I think your comment that these are just tools is absolutely spot on. The same statement can also be applied to which language do you write your code in as well as a great many other aspects of life (which is the best hammer for driving that nail? Should I use my sledge hammer or would the pin hammer be better suited to the task?). You evaluate the project and decide which is going to give you the required results.
Very useful overview for a beginner, thanks! I am building a personal website and will not tinker much about it in the future, at most once a year. I think I would find it easier in the future to understand what I originally planned if I stay with procedural solutions.
OOP for the win, it's soo much easier to work with blueprints.
What I like the most about php is you don't have to include something from somewhere but just include the file and all variables and methods are available.
Hi thanks for the video.
if you go to use a full framework like codeigniter, symfyny or laravel, the basics of php are not enough, you need the basics of OOP.
if you find a online course telling you that to learn a full php like laravel you only need the basics of php, think twice or more.
If you are connecting to a DB is better to use PDO then a specif drive like mysqli ( which allows procedure way) because is a universal / generic driver for any SQL DB. And to use PDO you need to know the basics of OOP
Either way, you should know the basic of OOP And some time use with procedure way.
Or you can use the mix of the two in functional way (which is sometimes laravel or codeigniter do)
Good explanation Thank you. we should select what method to use depending on the type of application we are building
An excellent, for me, clarifying presentation.
0:39 "Is it something you should learn" (Yes) :D
Exactly 😉
Thanks, Dani :)
I believe people who insists on procedural havent worked in a large team with complex code bases where the benifits of OOP outshines its cons. OOP just makes more sense in those cases.
Although I really dont like the idea of PHP to be embedded directly into the View. But I understand thats one spec of PHP that makes it unique.
Tnx Daniël, this gives a good overview of the possibilities
before watching this video, i really dont know what are procedural or OOP, i just have coded a PHP site/app for data entry, but i hope i get alot of knowledge in this video
For now Procedural is good for me.
all OOP, is trivially slower in execution. However, OOP, is just plain cooler. But, when I code for myself, I usually prefer faster for the final product.
Currently I’m not using OOP, however, since I like to use JavaScript and post method in it, I’m ending up with huge number of files and folders. I have folder for php, js, css, imgs, etc. I feel that the page is organised in somewhat similar way. I have a page with some forms and plus I have a bunch of various files doing things I need for the page.
In my opinion, one needs to learn Procedural as a beginner.
Totally agree. Procedural is best for learning the fundamentals first, and then OOP afterwards.
Break it down!👍
Mr Dani will you make a new php oop course? With projects
Daniiiiiii plsssssssssssssssss
Make JS tuts ❤
JS is getting very popular according to recent research, so might get back into it soon on the channel 🙂
@@Dani_Krossing Yes please 🙏 😍
It's not about good or not in my company we are using yii2 it's MVC so we use OOP
I know this is one of those nooby questions but I'm having a bit of a panic, I feel pretty competent with HTML, CSS, and PHP (kind of), but I've entered a software / webdev workplace and basically none of that is used, they are using angular / CSS and the implication was that PHP is outdated. My goal is to get my own wee website up and running and I constantly feel like I'm just behind the times. Is PHP still useful or is it a bit antiquated nowdays?
Depends which country your in. PHP is one of the best programming languages you can learn if you want to become a freelancer. There's tons of jobs for wordpress, laravel and magento developers as well. Even though no one builds websites on vanilla php nor vanilla javascript, learning laravel (OOP PHP) and a modern front-end framework like vue.js will not only make you feel better but it will also help you land a well paying job
Most of the time when people say PHP is outdated, it is because they think PHP is the same as it was many years ago, back when it was around PHP 5. The current PHP 8 is modern, constantly being updated with new features, and in NO WAY outdated. 🙂 80% of ALL websites wouldn't use PHP, if it was "outdated"... 👈
I'm guessing you are working with some older gentlemen, who have experience using a older version of PHP hehe. Which is perfectly understandable, but unfortunately it is very common to hear people down about PHP, because they don't stay up to date with its improvements over the past many years.
It's unfortunately one of those awkward moments where people say "PHP is outdated", but ironically they out themselves out for being "outdated developers" by not having stayed up to date with how languages are developing... 😕 So if you are sitting in a workplace that uses Angular, AND are incredibly closed minded about staying up to date with other languages, then I can understand your panic hehe.
I'd like to mention, that there is absolutely nothing wrong with using Angular, since it is also a good option. 😊 The issue here, is your workplace stating that "PHP is outdated"... 😅
The important point for you to take from this reply, is that you are MUCH better off knowing PHP for website backend development, than learning Angular. Angular is ALSO good to have in your backpack, but most places use PHP. You are just in a situation atm, where you are in a work environment that prefer Angular over PHP, which unfortunately isn't the language that you have learned... 💁 And to top it off, they have told you wrongful information, that makes you feel that PHP is a waste.
Usually whenever searching for a job, the company will list out which languages, frameworks, and CMS systems they use at their company, to make it easier to find developers who know the same skills. 🙂 I'm sure there is a good reason for how you ended up in a company, where they use a language you aren't familiar with. So from my point of view, you are in a situation where you need to ask yourself if you are willing to take a crash course in Angular hehe. 🙂
@@Dani_Krossing Thank you so much for your response, I really appreciate it. You hit the nail on the head, I'm early 30s and working with people in their late 40s-50s with a lot more experience than me. I basically changed career from counselling/psychology to IT and am trying to work my way up from entry QA into some coding work. I really love the type of work, but I feel so behind and I had this big panic that I'm behind + learning what I've been told is an outdated language which isn't relevant in the workforce anymore!
I'm thinking that I'll just keep going with PHP, with the hopes that I can transfer the concepts over into this workplace at some stage.
Again, thanks heaps for what you do and for taking the time to respond
I think none of extremes are good. Only OOP and no OOP. I'm for start with modular/procedural and when it comes for scenario where not using OOP is silly, I use it. For example e-shop order should be an object, but template displaying various parts, authors, price, stock should not be an object.
your employer will establish which tech stack and programming method you will work with, and OOP is widely use in the real world and that is why you should learn it.
I just mix and match
Nice i thought u were onto Game development now
I'm a multimedia designer, so I'm a bit like a Swiss army knife hehe.
You just cannot escape OOP
Dude... Are you aware of mainstream php frameworks?
I think this is a good explanation, however I dont think a beginner (with no OOP experience) would understand this and definitely no one new to PHP. This is because I remember when I first started learning more advanced PHP and a lot of lango that you get used to saying after writing thousands of lines of code is not understood by any newbie until they by luck cross that one video where that one guy explains something in layman’s terms, so it finally kicks in. For example, a method is the same thing as a function, only diff is it is a function within a class. If you use the word “method” to a person who hasn’t really learned OOP, this is not going to register in a way that sticks. And imho, properties and variables are also different names for the same thing because one is in a class and one is not, but they serve the same purpose. None of this was understood by me at first. When I watched tutorials where people used classes, if only they had of explained that, I wouldn’t have had to keep searching for that one video which made it all stick in my brain so I didnt need a tutorial. Interestingly, it wasnt until I was seeking to learn how to make an MVC framework that classes & methods finally did not seem over complicated even tho every vid I had watched made it seem complicated because trying to understand $this-> just wasn’t sticking. It’s one thing to copy the code from a video, but it’s another thing to understand it and be able to do the same thing without watching a tutorial.😏