The best way to read OO code?

This is a discussion on The best way to read OO code? within the C++ Programming forums, part of the General Programming Boards category; This might be a silly question. What's the best way to read a complicated, interweaved OO code?: 1. Start from ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    362

    The best way to read OO code?

    This might be a silly question.

    What's the best way to read a complicated, interweaved OO code?:

    1. Start from the main() and go through each function call to get to know the classes?
    2. Start from the beginning of the 1st cpp file and read every file back-to-back?
    3. Another way?

    Thanks. Good day to all.

  2. #2
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    Read the header files, as with any code. For OO code, I would read the base classes first and then the implementations (going down the tree).

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,655
    I like to start from main (or a class) and trace backward from there. That usually works pretty good since most OOP uses the 'top-down' design approach. That way, you get to study the abstraction before you get to the 'guts' of the code.
    Code:
    #include <ip.hpp>

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. array bounds overflow
    By BendingUnit in forum C Programming
    Replies: 3
    Last Post: 06-18-2006, 10:45 PM
  2. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 03:17 PM
  4. << !! Posting Code? Read this First !! >>
    By biosx in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 11:51 AM
  5. << !! Posting Code? Read this First !! >>
    By biosx in forum C Programming
    Replies: 1
    Last Post: 03-20-2002, 11:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21