7

I dont understand why we must use PHP to
understand OOP

Im a student software developer and this is the first time i will learn about Object Oriented programming but i dont know man im really confused why our prof makes us use PHP to understand the concept of OOP rather than to learn Python or Java which is ten times easier for an OOP based application

I can understand that PHP can be used for OOP but why just why... can someone please explain why this might be and how does it feel to use PHP for OOP purpouses

Comments
  • 4
    PHP is in the middle.

    Python isn't "fully" OOP, a lot of OOP patterns require hacks.

    PHP has good object support and is pretty easy - if the version is at least 7.

    Java has support - sadly - for everything.

    https://en.m.wikipedia.org/wiki/...

    OOP is a lot of careful planning and design - not everything that is possible or seen as good from a theoretical point of view is "good". Many theoretical approaches to OOP - especially when combined with languages which support every kind of fuckity imaginable - lead to devs programming like a 4 year old on espresso beans in a sugar rush.

    Looooot of energy, but the collateral damage is massive.
  • 2
    PHP since 7 is decent when it comes to basic OOP concepts. Most web frameworks use classes and objects these days.

    Sure, they could have used a more "pure" language that typically comes to mind when talking about OOP like C# and Java, but PHP is easier to learn and they're trying to teach you concepts rather than working with the language.

    At least that's what I think.
  • 2
    PHP can be a good starter language to learn OOP principles, if used purely for that and only in CLI mode, but there are better languages for learning OOP like C#, C++ or Java.
  • 3
    The only thing in PHP's favour is how easy it is to set up and use.
    In 10-20 loc you can have a secure login system, a cool db wraper, or a nice class structure.
    It is awful, and I agree it isn't the best option, but PYTHON? FOR OOP?
    PLEASE. Get your priorities straight.
  • 0
    Use Ruby. Everything is an object.
  • 0
    Or shit, watch this and learn most paradigms and stop going to the lectures:
    https://youtu.be/cgVVZMfLjEI
  • 0
    @theKarlisK Absolutely. C++ does have some additional complexity that would stand in the way.
  • 2
    I can tell you how it feels to use PHP for OOP… the greater the PHP version, the better. You can do OOP systems with it quite easily, yet the language is flexible enough to let you use a different paradigm where OOP doesn’t make sense.

    For teaching OOP… I guess PHP is more approachable than some other OOP languages, and as someone said, easy to setup and crucially: debug. Also, your prof is definitely throwing you into the deep end in the sense that when it comes to pure OOP, PHP doesn’t hold your hand as much as more straightforward OOP inclined languages like C# and Java do.

    Personally, I was thaught OOP with Java, but it never actually clicked before I started working with a mostly-OOP codebase in PHP.

    … also, Python for learning OOP? What the fuck? Why? Nobody in their right minds would… nevermind, I’ve seen crazier shit.
  • 0
    Using python for this makes me think the course's name should be "Learning basic OOP by First Mastering Django (and also picking up some complete nonsense about MVC on the way)"
Add Comment