4 replies
I don't think this is the right kind of programming
but can someone explain what object oriented programming means?
#object #oriented
  • {{ DiscussionBoard.errors[2582656].message }}
  • Profile picture of the author phpbbxpert
    There are 2 types of programming.
    Procedural Programming and Object Oriented Programming

    Procedural Programming for the most part is writing code to complete tasks.
    It is usually not easily extendable and to add more tasks within the program requires more work.
    From Wiki "specifying the steps the program must take to reach the desired state"
    Procedural programming - Wikipedia, the free encyclopedia

    OOP is coding with objects that are re-usable over and over again. Each object and or the structure it is contained in is easily extendable.
    Object-oriented programming - Wikipedia, the free encyclopedia

    So in PP if I write the code to create a user. In that code the user has a name, email, id.
    Now, say latter I want to give these users a profile. To do that I need to write the code for the profile and work it into the original code adding the profile to the user.

    In OOP, you create a Class for the user with the methods to handle the users Id, name and email.
    Later you want to add a profile like above you can simply write a profile Class that extends the user. All objects from the original user are available to use (depending on the visibility of the method it is in).

    I'm not sure how clear that is, in my mind it makes sense
    Well I included links to the wiki anyway.
    You have to have a pretty strong programming understanding to really see the potential of OOP or at least dig in and play with the various things it can do.

    Is there a specific language?
    {{ DiscussionBoard.errors[2582730].message }}
  • Profile picture of the author ursimrankhanna
    Object-oriented programming (OOP) is a programming paradigm that uses "objects" - data structures consisting of data fields and methods together with their interactions - to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, modularity, polymorphism, and inheritance. Many modern programming languages now support OOP
    {{ DiscussionBoard.errors[2744573].message }}
  • Profile picture of the author caesargus
    As if you didn't already have enough to read on this subject

    The way objects have always been taught to me is think of an alarm clock. Alarm clocks have very specific ways to interact with it. You can set the alarm clock, you can set the alarm, You can turn on the alarm, etc.

    But you typically do not have access to the internal workings of the alarm clock. You can't change the lights inside the alarm clock. You can't change the color, etc.

    That's basically how an object works. You have access to certain "methods" to interact with the object. The object controls everything else. The only thing you are concerned with setting the alarm and making sure it's on.
    {{ DiscussionBoard.errors[2744851].message }}

Trending Topics