artdyke Posted March 19, 2009 Share Posted March 19, 2009 Hi, I'm relatively new to programming in general. PHP is the first language I've learned. I'm not trying to make a career of this or anything. I'm designing a browser game with my wife, but it's more for fun and the game design/art design experience (something I do plan on making a career of eventually). Sorry if this is too much background, but I'm trying to give you an idea of where I'm coming from with this question. So I'm on the brink of really getting into moving from the design phase into the heavy programming phase and I'm trying to decide how best to approach everything before I spend forever working on it. I've heard a lot of hype about OOP, and I've got the very basic basics down, but honestly, I don't really see the advantage of it when I'm gonna be the only one working on this. It seems like far more trouble than it's worth. And then I thought, 'Well I'll just try it anyway because everybody swears it's the best way to go,' but I've found that it's a lot more awkward for me to deal with - either I'm not getting something or my brain just doesn't work that way. Can't I achieve the same reusability and modularity by using includes/requires? Why is OOP really better, functionally speaking? Because these abstract notions of why it's better theoretically don't seem to apply to how I operate... Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 19, 2009 Share Posted March 19, 2009 You have obviously read about the benefits of OOP, so I won't bother reiterating them for you. However, considering you said you're new to programming in general, I'm automatically assuming that you're doing OOP the wrong way. No offense, you may have got it right, but my experience is just that a lot of people who are new to it starts just grouping their functions into classes and then call it OOP. It's not, they're just using the classes as a kind of name spaces. Obviously, I cannot tell if your code is good or bad without having seen it, but my personal experience is that OOP done right is superior in terms of some of the benefits you already mentioned. Quote Link to comment Share on other sites More sharing options...
alphanumetrix Posted March 19, 2009 Share Posted March 19, 2009 OOP means object-oriented-programming. PHP is OOP, no matter how you use it. So when you talk about using OOP with PHP, it sounds stupid. It's like double OOP, which makes no sense. Am I missing something here? Quote Link to comment Share on other sites More sharing options...
trq Posted March 19, 2009 Share Posted March 19, 2009 PHP is OOP, no matter how you use it. No it is not! [Am I missing something here? Yes, the entire point. Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted March 19, 2009 Share Posted March 19, 2009 OOP means object-oriented-programming. PHP is OOP, no matter how you use it. Is this OOP? $x = 1; print $x; No it isn't Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted March 19, 2009 Share Posted March 19, 2009 If you are the only person working on the system then you can make it entirely how you wish. In another scenario where a developer may work on many systems providing upgrades, extra features, bug fixes then an OOP design is favoured. For example I may create a blog feature for a website that logged in users can view. With an OOP system I can add the components without affecting any of the underlying code so I know I am not creating bugs in the rest of the system. In a procedural system I may need to add extra code to files / functions that are live and potentially create bugs in the system that affect the users. When deciding on OOP or procedural I ask myself the following questions: 1. Is it just myself that will be working on the system 2. Is the system fixed or is it likely that the client may ask for large modifications, extra features 3. Is the system likely to be ported to other servers or other types of database servers 4. What is the deadline for system completion Quote Link to comment Share on other sites More sharing options...
Maq Posted March 19, 2009 Share Posted March 19, 2009 OOP means object-oriented-programming. PHP is OOP, no matter how you use it. So when you talk about using OOP with PHP, it sounds stupid. It's like double OOP, which makes no sense. Am I missing something here? Dear lord... Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 19, 2009 Share Posted March 19, 2009 OOP has nothing to do with working in teams or working alone. You'll need your own code to be maintainable as well. Quote Link to comment Share on other sites More sharing options...
alphanumetrix Posted March 19, 2009 Share Posted March 19, 2009 What does OOP stand for then? Is it basically just CMS? Quote Link to comment Share on other sites More sharing options...
alphanumetrix Posted March 19, 2009 Share Posted March 19, 2009 PHP is OOP, no matter how you use it. No it is not! Yes, it is. Look it up. PHP is an Object-Oriented Programming language (OOP). Quick reference: http://en.wikipedia.org/wiki/Object-oriented_programming_language Quote Link to comment Share on other sites More sharing options...
trq Posted March 19, 2009 Share Posted March 19, 2009 What does OOP stand for then? Is it basically just CMS? What are you talking about? You said it yourself in your original reply. 'Object Orientated Programming'. Quote Link to comment Share on other sites More sharing options...
trq Posted March 19, 2009 Share Posted March 19, 2009 PHP is OOP, no matter how you use it. No it is not! Yes, it is. Look it up. PHP is an Object-Oriented Programming language (OOP). Quick reference: http://en.wikipedia.org/wiki/Object-oriented_programming_language Buddy, you don't know what you are talking about. You don't even know what OOP is according to your last post. Leave it. Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted March 19, 2009 Share Posted March 19, 2009 Yes, it is. Look it up. PHP is an Object-Oriented Programming language (OOP). PHP is an Object-Oriented Programming language if your programming code is based around the OOP concepts in PHP. PHP applications can also be procedural. I don't think you understand the concept of OOP. Do some more research. Quote Link to comment Share on other sites More sharing options...
alphanumetrix Posted March 19, 2009 Share Posted March 19, 2009 I am... Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 19, 2009 Share Posted March 19, 2009 As a matter of fact, PHP didn't get proper OOP support until version 5. There was minimal support for OOP (though so minimal I wouldn't even call it OOP) in PHP4. Quote Link to comment Share on other sites More sharing options...
trq Posted March 19, 2009 Share Posted March 19, 2009 Notice also that Daniel said support. This doesn't mean the language itself is OOP. Quote Link to comment Share on other sites More sharing options...
alphanumetrix Posted March 19, 2009 Share Posted March 19, 2009 I see it on PHP's website. It's here: http://us.php.net/oop - I looked on another few websites, too, for a better definition of it. The funny thing is, I use this style of coding a lot. - I always just referred to it as classes though... Now I feel completely embarrassed. PHP is OOP, no matter how you use it. No it is not! Yes, it is. Look it up. PHP is an Object-Oriented Programming language (OOP). Quick reference: http://en.wikipedia.org/wiki/Object-oriented_programming_language Buddy, you don't know what you are talking about. You don't even know what OOP is according to your last post. Leave it. I thought you guys were referring to a different acronym, because of the post below: If you are the only person working on the system then you can make it entirely how you wish. In another scenario where a developer may work on many systems providing upgrades, extra features, bug fixes then an OOP design is favoured. For example I may create a blog feature for a website that logged in users can view. With an OOP system I can add the components without affecting any of the underlying code so I know I am not creating bugs in the rest of the system. In a procedural system I may need to add extra code to files / functions that are live and potentially create bugs in the system that affect the users. When deciding on OOP or procedural I ask myself the following questions: 1. Is it just myself that will be working on the system 2. Is the system fixed or is it likely that the client may ask for large modifications, extra features 3. Is the system likely to be ported to other servers or other types of database servers 4. What is the deadline for system completion Thanks for clearing this all up for me, guys! Quote Link to comment Share on other sites More sharing options...
Maq Posted March 19, 2009 Share Posted March 19, 2009 What does OOP stand for then? Is it basically just CMS? From this post, you obviously don't have a clue about OOP. Please do a search on these forums and Google for discussions and tutorials about it. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 19, 2009 Share Posted March 19, 2009 I thought you guys were referring to a different acronym, because of the post below: As far as I'm concerned, the only thing OOP stands for in computer science is "object oriented programming". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.