Converting procedural type code to OO code

Discussion in 'C++' started by Mohitz, Jul 12, 2007.

  1. Mohitz

    Mohitz Guest

    Any pointers as to how one should go about porting procedural type
    code into object
    oriented code??

    ---
    Mohit
    Mohitz, Jul 12, 2007
    #1
    1. Advertising

  2. Mohitz

    Guest

    On 7 12 , 1 31 , Mohitz <> wrote:
    > Any pointers as to how one should go about porting procedural type
    > code into object
    > oriented code??
    >
    > ---
    > Mohit


    >From my perspective, the most importance point is that you should put

    data and relevant operations in one class. What's more, only when
    necessary, data and operations should be "public".
    In addition, inheritance, encapsulation and polymorphism are the three
    major characteristics of object-oriented programming.
    , Jul 12, 2007
    #2
    1. Advertising

  3. Mohitz wrote:
    > Any pointers as to how one should go about porting procedural type
    > code into object
    > oriented code??


    Simple: don't.

    If you have a model you need to program, program that model.
    But don't "port" anything anywhere.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Jul 12, 2007
    #3
  4. Mohitz

    osmium Guest

    "Victor Bazarov" wrote:

    > Mohitz wrote:
    >> Any pointers as to how one should go about porting procedural type
    >> code into object
    >> oriented code??

    >
    > Simple: don't.
    >
    > If you have a model you need to program, program that model.
    > But don't "port" anything anywhere.


    That sounds like pretty good advice to me. I wonder if that is how
    Microsoft Foundation Classes came to be? Someone told someone to convert
    the code into objects and they came up with wrappers that no one outside of
    Redmond could love.

    If you are told to do it and can't get out of it, I would say "just do it".
    osmium, Jul 12, 2007
    #4
  5. Mohitz

    Jim Langston Guest

    "Mohitz" <> wrote in message
    news:...
    > Any pointers as to how one should go about porting procedural type
    > code into object
    > oriented code??


    Object oriented code is a different paradigm than procedural code. Meaning
    that the design of the entire program is usually different in an OOPs
    langauge than a procedural language. Trying to force procedural code into
    OOPs wrappers doesn't do much to change the paradigm of the code itself.

    So basically, don't.

    It is better to design an object oriented program from the ground up.
    Jim Langston, Jul 12, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. parley
    Replies:
    13
    Views:
    743
    jim corey
    Feb 11, 2004
  2. John Gabriele

    help: good sturdy C procedural program design

    John Gabriele, Apr 24, 2004, in forum: C Programming
    Replies:
    2
    Views:
    485
    John Gabriele
    Apr 24, 2004
  3. Manuel

    OOP vs procedural

    Manuel, Jan 3, 2006, in forum: C++
    Replies:
    16
    Views:
    794
    James
    Jan 8, 2006
  4. tenxian
    Replies:
    10
    Views:
    2,664
    Mark Space
    Apr 25, 2008
  5. mike3
    Replies:
    13
    Views:
    524
    mike3
    Apr 2, 2010
Loading...

Share This Page