Thread: Oop

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    88
    Rep Power
    10

    Oop


    Could someone explain the basics of OOP and how it works to me? I've gotten a lot of things in python, but OOP is confusing to me... Could someone tell me how to use ect..
    Thankyou.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    3
    Rep Power
    0

    Smile Oop


    There are a lot of details to OOP, for which see a good tutorial such as on the Python website, or http://www.freenetpages.co.uk/hp/alan.gauld/.

    One way of looking at OOP which helped me is to look at OOP as a way of simplifying a program.

    It simplifies a program by breaking it down into sub-programs,usually classes, each of which has its own methods or functions, and its own variables. Then each sub program can interact with other subprograms.

    A very long and complex program then becomes a series of simpler, interacting programs. This has two advantages: it makes the code easier to write and to amend, like adding to a chapter in a book instead of diving into a whole book written without any subsections. The second advantage is that classes can be constructed to interact with each other, yo use each others data and methods, in a flexible way which allows the programmer to model the interactions in the real world.

    For example, a class could represent a dice, and then other classes could represent players who each take a turn throwing the dice.

    Hope this helps, its a bit of an unusual explanation but it was helpful to me. Try the above tutorials, they are pretty good. OOP is much easier than other approaches, especially in Python, which has very simple code anyway. It helps if you can remember that.

    Good luck

    aclarke
    Originally Posted by pylon
    Could someone explain the basics of OOP and how it works to me? I've gotten a lot of things in python, but OOP is confusing to me... Could someone tell me how to use ect..
    Thankyou.
  4. #3
  5. Commie Mutant Traitor
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2004
    Location
    Norcross, GA (again)
    Posts
    1,804
    Rep Power
    1569
    I recently posted a message giving another perspective on OOP in the Beginning Programming forum, which you might want to check out.
    Last edited by Schol-R-LEA; January 2nd, 2005 at 01:32 AM.
    Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF
    #define KINSEY (rand() % 7) λ Scheme is the Red Pill
    Scheme in Short Understanding the C/C++ Preprocessor
    Taming Python A Highly Opinionated Review of Programming Languages for the Novice, v1.1

    FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov

IMN logo majestic logo threadwatch logo seochat tools logo