Hey, I really liked your video; I'm not trying to be a prick but I just thought I'd like you know that it's not called Object OrientATed Programming; its actually Object Oriented Programming; you are mispronouncing the word Orientated in the video
@phpacademy your comment was left 3 months ago ... how soon is soon? ... i do realize and appreciate that you do these on your own time and give them out for free.... thank you .. but how soon can we expect more on classes/oop please?
@CommentBBScript You can create many instances of the same class, however, the properties and methods for each declaration will be unique to the variable you assign the instance to. Hopefully this makes sense? Obviously, with a function you can't do this. This is the overall point of OOP.
I love your videos but i would never kill you if you could make them quicker. You should maybe use a different structure so you could free up some time in your videos. Here is what I mean:
On the first video you should say what basics tutorials' information will be needed in the actual project/tutorial series.
Then you should not explain what are you doing just say 'this is further explained in video XYZ.'
Thanks for the tutorial, it is easy to understand :) it's a little bit different than OOP in Java, but I'll get used to it! waiting for more tutorials!
So when your using $human->gender, it's kind of like get information from an xml document using php, like youtube api for example. Nice tutorials, keep up the good work. This seems interesting.
Disculpa que te hable en español , pero siempre puedes usar traductor google, bueno te digo que nose por que usar CLASS para adentrar FUNCTIONES , si podemos dejar las FUNCTIONES sueltas sin ningun class , no le veo mucha logica aparte que lo de PUBLIC es una ventaja ya que no incluye dentro del parentisis function ($gender){
echo $gender
}
bueno si me dicen la idea la entendere por lo que veo muy absurdo esto.
Hooray this is what I've been waiting for! Just to let you know you taught me everything I know about PHP and now you're taking me from complete newbie to advanced! KEEP IT UP!!!!
can you after you have done a few more videos on OOP do a demonstration of how it could be used in action? I'm not sure what you could build as a demonstration but i'm sure you get my point. Also, can you do some videos on securing you're PHP scripts and methods help prevent hacking?
BTW Sorry for spamming comments, but OOP is quite a big topic and I was bored and maybe the man behind phpacademy isn't bored enough to explain it all in comments.
While I've gotten pretty good at php... I still have an issue grasping how to use OOP in PHP within an everyday kinda thing... I can't wait to see it.
What I don't get is why you can't just use functions and variables without classes -_- like the exact same thing to me. Maybe OOP is better for very advanced stuff?
@kleinespelvids OOP is basically used to create objects. So you could have like, 3 people, every single one with Age, Gender, and loads of other stuff (I'm not the most creative guy sorry xD). So you could have multiple of those without the need of making multiple arrays for each person, you could just create one array storing multiple Human's.
@kleinespelvids Yes you can! But now you have just created these awesome arrays for no re-use. Unless you copy and paste which is disgusting. So if you used a class you could extend onto those objects. Using a "human" isn't a too good of a example, and OOP is best used in games and applications. But let's say you made a game in C#, and you wanted to make weapons for the player, you first make a class called "Items" and then a class called "Holdable's" which extends items (as it is a item.)
@kleinespelvids and you further from holdables make "weapon" which extends holdable, because it's a Holdable-item. Do you see how it goes on? This is why OOP is such a important thing to grasp. You will most likely go from PHP to C# if you want to try and make games later on (or java) where these are super important. But this is why classes and inheritance is so important when it comes to programing. And you really should learn it even if you'll never use it, if just to understand other's code.
@kleinespelvids Also, Arrays can contain methods (functions inside classes are called methods). So you can have one class "HumanHandler"(terrible naming ftw) and then human extends HumanHandler, so what that means is you give "Human" the variables and then every method in the "HumanHandler" is available in "Human", so that way you can follow the SRP, "Human" contains the variables and it extends "HumanHandler" so it can use functions such as "$Human->Name($name);" which you put in "HumanHandler"
@katt157 Ok, thanks! I'd actually like to get into C but I don't know where to start between all the Cs: C, C++, C# ... what the hell is this all about? I know that C++ supports OOP, and is in some way better than C.
@kleinespelvids C++ is an upgrade from C. C# is a "C-Like Object Oriented Language" that's why it was originally going to be named "Cool". I'd recommend starting with C#, but remember, C# is .Net and Windows Only.
@kleinespelvids Now what he most likely will get into is the SRP (single responsibility principle) which is basically that one class should only have one responsibility. So, one class to contain the state of a "Human" (Like how much his health it, what his gender is at that time, his age right now) and you'll use other classes to modify that data. It's quite complicated to stay within the SRP sometimes, but you got to remember, it's just a principle, it's not a rule. It CAN do it the other way.
@kleinespelvids It's all about giving your code re-usability (making words on the fly FTW), to be able to just say :
Ok so I'm going to use a type of posting here (like posting a comment), so I'll use my "Comment class" which extends (some class like post or message...) which extends....... and so on.
Nice video. I've not used OO PHP before and it's something I'm going to be moving onto in the near future so this vid was good to clear up a few basics :)
This video remembers me of my days learning Java language XD
leoyt123 2 months ago
Hello, this is a very interesting part of php, could you make more tutorials abou this?
zipron
dutchwowerke 4 months ago
This man is a genius. I have read a lot about OOP. But Alex made it too easy for me.
Alex please kindly make more videos on OOP. I will surely donate. I almost never forget anything I learn from Alex. It just sticks!!
trommelbiel 5 months ago
IN the second part (where you make a method), I assume you could change the variable to
private $gender = 'Male';
and it would still work for the method when you call "$this->gender" because that method is part of the same class?
MrSkinnyBill 5 months ago
That was fantastic keep them coming... Hope you get rewarded in some way! Many thanks
deeksterN 5 months ago
I'm eating. I'm male.
elvisniperx 6 months ago
Hey, I really liked your video; I'm not trying to be a prick but I just thought I'd like you know that it's not called Object OrientATed Programming; its actually Object Oriented Programming; you are mispronouncing the word Orientated in the video
hsyed88 10 months ago
I do tons of work with PHP and big applications but have had a need to use Classes. It seems more like an organizational thing.
LavaEagle 10 months ago
thenewboston sent me here .... Subbed !!
MDI911 10 months ago
I don't really see a use to OOP... Can you provide some *real world* examples? Thanks.
khadwen 10 months ago
I actually love Oop and classes etc. Very cool
Acceptable76 10 months ago
pubic is replaced by var.
n1tr0b 11 months ago
yes, I don't get the point of OOP either. But, always good knowledge. :-)
Acceptable76 11 months ago
This has been flagged as spam show
hello Sir how r u.
Where is the other parts of this tutorial
Please Please Please Please Teach us with DETAIL of OOP
deemipk 11 months ago
hello Sir how r u.
Where is the other parts of this tutorial
Please Please Please Please Teach us with DETAIL of OOP
deemipk 11 months ago 4
@deemipk More to come soon...
phpacademy 11 months ago 7
@phpacademy your comment was left 3 months ago ... how soon is soon? ... i do realize and appreciate that you do these on your own time and give them out for free.... thank you .. but how soon can we expect more on classes/oop please?
LogikosMan 7 months ago
Whats the difference between classes and functions? Is there a reason classes (may) are better?
CommentBBScript 11 months ago
@CommentBBScript You can create many instances of the same class, however, the properties and methods for each declaration will be unique to the variable you assign the instance to. Hopefully this makes sense? Obviously, with a function you can't do this. This is the overall point of OOP.
phpacademy 11 months ago
I love your videos but i would never kill you if you could make them quicker. You should maybe use a different structure so you could free up some time in your videos. Here is what I mean:
On the first video you should say what basics tutorials' information will be needed in the actual project/tutorial series.
Then you should not explain what are you doing just say 'this is further explained in video XYZ.'
--
If this is a bad idea just ignore it anyway...
greetings - from me
bamahacker01 11 months ago
Object "ORIENTED", not "orientated"... lol. still... much love and props and thanks to you, sir!
xninjax420 11 months ago
@xninjax420 Lol... This guy always makes a mistake, sometimes it takes half a video to correct it...
bamahacker01 11 months ago
I learned this while coming php with flash :)
CompDomination 11 months ago
Wouldn't public be classed as an instance/object ?
phpfanboi 11 months ago
Comment removed
phpfanboi 11 months ago
Comment removed
RodS1967 11 months ago
Thanks for the tutorial, it is easy to understand :) it's a little bit different than OOP in Java, but I'll get used to it! waiting for more tutorials!
beckham7england4ever 11 months ago
So when your using $human->gender, it's kind of like get information from an xml document using php, like youtube api for example. Nice tutorials, keep up the good work. This seems interesting.
lukie254 11 months ago
thanks m8 ur tutorials are great
drago8701 11 months ago
Disculpa que te hable en español , pero siempre puedes usar traductor google, bueno te digo que nose por que usar CLASS para adentrar FUNCTIONES , si podemos dejar las FUNCTIONES sueltas sin ningun class , no le veo mucha logica aparte que lo de PUBLIC es una ventaja ya que no incluye dentro del parentisis function ($gender){
echo $gender
}
bueno si me dicen la idea la entendere por lo que veo muy absurdo esto.
rapblack2 11 months ago
Comment removed
rapblack2 11 months ago
oop easy...do tutorial about deisgn pattern instead
slier81 11 months ago
Hooray this is what I've been waiting for! Just to let you know you taught me everything I know about PHP and now you're taking me from complete newbie to advanced! KEEP IT UP!!!!
abz121 11 months ago
finally!!.... oh wait do i going to have to buy the rest of it
kgn1876 11 months ago
finally!!
kgn1876 11 months ago
finally
kgn1876 11 months ago
Object Oriented. Not "Object OrientATEd!"
comstation11 11 months ago
Orientated or ORIENTED?, i think its the second one m8
0wnix 11 months ago
can you after you have done a few more videos on OOP do a demonstration of how it could be used in action? I'm not sure what you could build as a demonstration but i'm sure you get my point. Also, can you do some videos on securing you're PHP scripts and methods help prevent hacking?
minidevelop 11 months ago 12
OOP is a great way to reuse code and add to it. Good video.
daviddalbylive 11 months ago
This is great, thanks! :)
faviouznet 11 months ago
BTW Sorry for spamming comments, but OOP is quite a big topic and I was bored and maybe the man behind phpacademy isn't bored enough to explain it all in comments.
katt157 11 months ago
While I've gotten pretty good at php... I still have an issue grasping how to use OOP in PHP within an everyday kinda thing... I can't wait to see it.
h1ll37 11 months ago
Extremely like Java, which is good because I've been doing a LOT of Java lately.
:D
LegoLoverFilms 11 months ago
No 1911 button :/
katt157 11 months ago
What I don't get is why you can't just use functions and variables without classes -_- like the exact same thing to me. Maybe OOP is better for very advanced stuff?
kleinespelvids 11 months ago
@kleinespelvids OOP is basically used to create objects. So you could have like, 3 people, every single one with Age, Gender, and loads of other stuff (I'm not the most creative guy sorry xD). So you could have multiple of those without the need of making multiple arrays for each person, you could just create one array storing multiple Human's.
katt157 11 months ago
@katt157 Can't you use associative arrays for that? I'm kind of a noob for the moment, sorry 'bout that :/
kleinespelvids 11 months ago
@kleinespelvids Yes you can! But now you have just created these awesome arrays for no re-use. Unless you copy and paste which is disgusting. So if you used a class you could extend onto those objects. Using a "human" isn't a too good of a example, and OOP is best used in games and applications. But let's say you made a game in C#, and you wanted to make weapons for the player, you first make a class called "Items" and then a class called "Holdable's" which extends items (as it is a item.)
katt157 11 months ago
@kleinespelvids and you further from holdables make "weapon" which extends holdable, because it's a Holdable-item. Do you see how it goes on? This is why OOP is such a important thing to grasp. You will most likely go from PHP to C# if you want to try and make games later on (or java) where these are super important. But this is why classes and inheritance is so important when it comes to programing. And you really should learn it even if you'll never use it, if just to understand other's code.
katt157 11 months ago
@kleinespelvids Also, Arrays can contain methods (functions inside classes are called methods). So you can have one class "HumanHandler"(terrible naming ftw) and then human extends HumanHandler, so what that means is you give "Human" the variables and then every method in the "HumanHandler" is available in "Human", so that way you can follow the SRP, "Human" contains the variables and it extends "HumanHandler" so it can use functions such as "$Human->Name($name);" which you put in "HumanHandler"
katt157 11 months ago
@katt157 Oops not arrays, CLASSES. Stupid me xD
katt157 11 months ago
@katt157 Ok, thanks! I'd actually like to get into C but I don't know where to start between all the Cs: C, C++, C# ... what the hell is this all about? I know that C++ supports OOP, and is in some way better than C.
kleinespelvids 11 months ago
@kleinespelvids C++ is an upgrade from C. C# is a "C-Like Object Oriented Language" that's why it was originally going to be named "Cool". I'd recommend starting with C#, but remember, C# is .Net and Windows Only.
katt157 11 months ago
@kleinespelvids Now what he most likely will get into is the SRP (single responsibility principle) which is basically that one class should only have one responsibility. So, one class to contain the state of a "Human" (Like how much his health it, what his gender is at that time, his age right now) and you'll use other classes to modify that data. It's quite complicated to stay within the SRP sometimes, but you got to remember, it's just a principle, it's not a rule. It CAN do it the other way.
katt157 11 months ago
@kleinespelvids So the SRP is just to make your classes more usable in different circumstances.
katt157 11 months ago
@katt157 Ok, so it's basically just about organisation and better usuability of the code?
Does OOP permit to do things you can't do some other way?
kleinespelvids 11 months ago
@kleinespelvids It's all about giving your code re-usability (making words on the fly FTW), to be able to just say :
Ok so I'm going to use a type of posting here (like posting a comment), so I'll use my "Comment class" which extends (some class like post or message...) which extends....... and so on.
katt157 11 months ago
@kleinespelvids I really don't have any good examples on how it's useful in PHP, but I bet phpacademy has a great way of explaining how :)
katt157 11 months ago
Very good video. I've used OOP in C# and I can see the minor differences now.
MattDurden 11 months ago
Nice video. I've not used OO PHP before and it's something I'm going to be moving onto in the near future so this vid was good to clear up a few basics :)
tctctc91 11 months ago
@tctctc91 Excellent, look forward to more in the very near future.
phpacademy 11 months ago
do more about oop.
it's a good subject! thanks.
waitingfordoom 11 months ago 10
@waitingfordoom I will be doing :)
phpacademy 11 months ago
Nice video, but its object oriented programming. Not orientated ;)
JaxDragon1 11 months ago
@JaxDragon1 As long as people know what he means right? ;)
LimmenThijs 11 months ago
First?
Juliozz3 11 months ago