JackClarke Posted May 19, 2012 Posted May 19, 2012 Hey, I'm quite new to PHP and have only just started to learn it but I've come across several things that have thrown up some questions. Usercake is something that introduced me to classes in PHP but I don't know why they're used. Could somebody tell me when and why you should use classes in PHP? Somebody over at MyBB suggested that the plugins system should change to use classes to prevent conflict, how would it do this? Why not just use standard functions? Thanks to anyone who can explain this! Jack Quote
redinit Posted May 20, 2012 Posted May 20, 2012 It sounds like you are new to programming. I assume by "classes based" you actually mean Object-Oriented Programming (OOP). Function based would be called procedural programming. Long story short, if you want less headaches, use OOP paradigm http://www.linuxjournal.com/content/programmer%E2%80%99s-discussion-procedural-vs-oo http://www.chrispian.com/php-oop-or-procedural/ Quote
JackClarke Posted May 20, 2012 Author Posted May 20, 2012 Ah I see thanks for explaining the correct terminology to me. I now understand it a little better although I still need to get my head around OOP with PHP because I found PP far easier when I built my first CMS. Over at MyBB someone suggested the plugin system should use classes, would you agree with that or not? Quote
redinit Posted May 21, 2012 Posted May 21, 2012 Ah I see thanks for explaining the correct terminology to me. I now understand it a little better although I still need to get my head around OOP with PHP because I found PP far easier when I built my first CMS. Over at MyBB someone suggested the plugin system should use classes, would you agree with that or not? Yes, if you want yourself, as well as other potential developers to be able to add to your code in the future, you should use classes Quote
__Darknite Posted May 23, 2012 Posted May 23, 2012 Making the jump from Procedural programming to OOP is very important. Generally in my view, this is the journey that programmers should aspire to go (in terms of mastering programming): Procedural (Level 1) Object Oriented Programming (Level 2) Event Based Programming (Level 3) Set Based Programming (Level 4) Concurrent based Programming (Level 5) Functional Programming (Level 6) Metaprogramming (Level 7) Along the way you will need to pick up a lot of different programming languages as no one language covers all the above paradigms. If you have any specific questions on OOP please do ask. Quote
Mansi30 Posted June 4, 2019 Posted June 4, 2019 5 On 5/23/2012 at 4:16 PM, __Darknite said: Making the jump from Procedural programming to OOP is very important. Generally in my view, this is the journey that programmers should aspire to go (in terms of mastering programming): Procedural (Level 1) Object Oriented Programming (Level 2) Event Based Programming (Level 3) Set Based Programming (Level 4) Concurrent based Programming (Level 5) Functional Programming (Level 6) Metaprogramming (Level 7) Along the way you will need to pick up a lot of different programming languages as no one language covers all the above paradigms. If you have any specific questions on OOP please do ask. Thanks for the great information to me. It will help me keep sharing it. Quote
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.