[0:00] how it going guys I'm back to another [0:02] series on how to do op oriented [0:03] programming using PHP code now because [0:07] this is the first episode in optic [0:08] oriented programming I'm going to spend [0:10] this episode explaining what exactly [0:12] optic oriented programming is because [0:14] it's very important that you guys [0:16] understand what it is if you have never [0:18] done anything with objectoriented [0:19] programming before so if you're [0:21] completely familiar with objectoriented [0:23] programming you don't need to watch this [0:25] episode The reason I want to do a small [0:27] episode on just explaining what exactly [0:29] it is is because I remember back when I [0:31] was learning object oriented programming [0:33] you know back when I was studying my [0:35] bachelors um the teacher had a specific [0:38] way of explaining optic oriented [0:40] programming that didn't make sense to [0:42] the entire class so it's very important [0:45] to me that I understand this in a way [0:46] that you guys understand it and know [0:48] exactly why we need to use op oriented [0:51] PHP programming versus the other way we [0:54] do it in the past okay now when it comes [0:57] to PHP programming the way been doing it [1:00] in my other series that's just called [1:02] PHP um we use something called procedure [1:05] programming now what that means is that [1:08] when we have a website such as just a [1:10] regular website with a login system we [1:12] would just go ahead and create the PHP [1:14] code and insert it inside the document [1:17] whenever we needed to use it meaning [1:19] that if I had a sign up form inside my [1:21] website I would just create the PHP code [1:24] inside the HTML page or inside the PHP [1:27] document uh where I had the sign up for [1:30] form whereas in object going into phsp [1:33] programming we create separate documents [1:36] only meant for PHP code that has [1:39] something in it called classes now [1:41] classes contain something called [1:43] properties and methods that we use [1:46] regarding one specific thing inside our [1:48] website now if that sounded confusing it [1:51] will sound confusing if you've never [1:53] done anything with optic ored PHP [1:54] program before so don't get scared that [1:57] you don't understand what classes and [1:59] properties methods are just go ahead and [2:02] follow the lessons and you will [2:03] understand in no time so the basic idea [2:06] here is that let's say we have this [2:07] login system inside a website and I need [2:10] to create the PHP code for this login [2:12] system now what I can do instead of just [2:14] creating the code where I need to use it [2:16] inside my phsp document I'm going to go [2:19] ah and create a separate document that [2:20] has a class which is just a very big [2:24] container to a lot of code that I use [2:27] regarding login systems so this class [2:30] might be called [2:31] login now inside this login class we [2:34] have properties and methods which is [2:36] another way of saying we have variables [2:38] and functions that are saved inside this [2:41] class now don't get me wrong properties [2:43] and methods are not the same as [2:46] variables and functions but they work in [2:48] a very similar way okay so inside this [2:51] class regarding login systems we have [2:54] code that does something regarding the [2:56] login system and because we do it this [2:59] way way if I were to do anything else [3:02] inside the website you know in another [3:03] page regarding a sign up form I can [3:06] reuse the code inside the class rather [3:08] than creating the code again inside the [3:11] website okay so we can actually reuse [3:13] code again and again and again which is [3:16] one of the benefits from using op gr to [3:18] PHP [3:19] programming now another benefit from [3:21] optic gr to PHP programming is that when [3:24] you if you want to work at a marketing [3:27] agency you know a place where they [3:28] actually create websites for companies [3:29] and that sort of thing it's pretty much [3:32] a standard today that you need to [3:34] understand after gr to PHP programming [3:36] because oop which is what we call optic [3:39] oriented PHP programming is a format [3:42] that all programmers understand with [3:44] procedural code I have one way of coding [3:47] it another programmer has another way of [3:49] coding it meaning that we might not [3:51] understand the code that each you know [3:53] each person wrote so op to go into PHP [3:55] programming kind of solves that problem [3:58] because we need to understand with other [4:00] people program when we have other people [4:02] that we work with now you might be [4:04] asking well is optic ored PSP [4:06] programming better than procedural [4:08] programming you know we just create the [4:09] code wherever we need to use it inside [4:11] our document well if the code is just [4:14] meant for you to use and you just create [4:16] the code for small applications then no [4:19] it doesn't matter if you do optic rer [4:21] phsp programming or procedural [4:23] programming like a login [4:25] system I would say it's borderlining you [4:27] know where you need to start considering [4:29] us using optic run to phsp programming [4:31] because now you're starting to create a [4:33] lter application but I just want to [4:35] highlight that a lot of people at least [4:37] a lot of programmers don't believe that [4:39] optic ored PSP programming is better [4:42] than procedural some people think they [4:44] do exactly the same thing where a person [4:46] like me think that optic rer PSP [4:49] programming if used right can do a lot [4:52] more beneficial things when it comes to [4:54] larger applications so if you're [4:56] watching this series and thinking well [4:58] optic R to PSP programming sounds much [5:00] too complicated or might be too [5:02] difficult to learn versus what you're [5:04] actually getting out of it then you [5:06] shouldn't look at it as a bad thing to [5:09] just want to go with procedural [5:10] programming just remember that if you [5:12] want to work with this in the future [5:14] you're going to need to look into optic [5:16] R into phsp programming but it's really [5:18] not that difficult to learn I just want [5:19] to empathize that because it really [5:21] depends on who's explaining it to you [5:23] now another thing I want to mention [5:25] regarding optic run into PHP programming [5:27] which is one thing that if you guys have [5:29] actually been good Googling it looking [5:30] for tutorials is that when you go to [5:33] different tutorial sites object oriented [5:36] phsp programming will be taught [5:39] differently by pretty much everyone and [5:41] the reason for this is that we have [5:43] different patterns in optic R to PHP [5:46] programming now what patents means is [5:49] that when you have optic PHP programming [5:52] you have a specific formula or a [5:54] specific pattern that you create the [5:57] code in meaning that if I were to learn [5:59] this from one website uh they might be [6:02] using something called Constructor [6:03] patents where another tutorial series [6:06] might not be using Constructors which is [6:08] something that we will be talking about [6:09] in this series here because Constructors [6:11] seem pretty important when it comes to [6:13] having the proper format of op ored PHP [6:16] programming but it's different what [6:19] people teach you when it comes to op [6:21] ored PHP programming so I just want to [6:23] mention before you get started on this [6:25] series that what we're going to be doing [6:27] is we're going to go ahead and use [6:29] what's called an MVC pattern which [6:31] stands for model view controller and [6:34] it's a pattern that was created quite a [6:35] while back which was used mainly for [6:38] other types of programming languages but [6:41] has been incorporated into PHP when it [6:43] comes to oop programming and we're going [6:46] to go and using this series here now in [6:48] the next episode I will be explaining [6:50] what exactly an MVC model is you know [6:52] model view controller and why we need to [6:55] do it this way at least when it comes to [6:56] my tutorial series here in the future we [6:59] might might be looking into other design [7:01] patterns but for now in the beginning [7:03] here we're going to focus on the NVC [7:05] pattern since it's pretty popular out [7:06] there so I hope you guys enjoyed and [7:09] I'll see you guys next [7:13] time