Level of OOPS

Discussion in 'C Programming' started by Vivek, Aug 20, 2003.

  1. Vivek

    Vivek Guest

    To what level can we attain object oriententation with the C language?
    Vivek, Aug 20, 2003
    #1
    1. Advertising

  2. Vivek

    ArWeGod Guest

    "Vivek" <> wrote in message
    news:...
    > To what level can we attain object oriententation with the C language?


    Well, you can write a C++ compiler in C. ;-)

    But seriously, like the old song said; "Anything C++ can do, C can do
    better..."

    .... You just have to do it the old fashioned way, by creating structures
    with pointers to linked-lists of other structures, and stuff like that.
    Kinda like the concept of an Interface in COM objects.

    It's hard enough to do that they invented a new "generation" of languages to
    handle it all, so why not use those? There's C++, Java, D, etc.

    --
    ArWeGod@sbc_global.net
    Remove underscore to email.
    ArWeGod, Aug 20, 2003
    #2
    1. Advertising

  3. Vivek wrote:
    > To what level can we attain object oriententation with the C language?
    >


    You may want to have a look on :
    - the Gtk+ framework (http://www.gtk.org)
    - Laurent Deniau's OOPC
    (http://ldeniau.home.cern.ch/ldeniau/html/oopc/oopc.html)


    The first one may not support all and every OO concept, but has proven
    to be fairly usable - and used : Gnome is based on Gtk+.

    The second is more complex, and seems to support more of the OO
    concepts. I don't know how much it is used in production code, but if I
    understand well, it has been developped by Laurent Deniau to use OO on
    emmbedded platforms not supporting C++.

    Google (+"C" + "object oriented" -Objective) also points to :
    http://sunsite.nstu.nsk.su/sunworldonline/swol-10-1995/swol-10-ooc.html
    http://www.accu.org/acornsig/public/articles/oop_c.html (not really
    interesting IMHO - mostly a confusion between ADT and OO).
    http://www.ticalc.org/archives/files/fileinfo/251/25159.html
    http://www.methodpark.com/produkte_oo2c_en_body.html
    http://www.linux-mag.com/2000-10/compile_01.html
    http://www.planetpdf.com/binthing~WebPageID,620.htm
    etc...

    Bruno
    Bruno Desthuilliers, Aug 20, 2003
    #3
  4. Vivek

    Malcolm Guest

    "Vivek" <> wrote in message
    >
    > To what level can we attain object oriententation with the C language?
    >

    Data encapsulation is easy and is done all the time.
    All you do is define a structure, a function that creates it (the
    constructor) and a function to destroy it (the destructor), and a few
    functions that do interesting things.

    What is very messy to do in C is inheritance and polymorphism. It is
    possible, OO is a programming technique rather than a language, but if your
    design calls for hierachies of objects then you are better off with a
    higher-level language that supports these structures directly.
    Malcolm, Aug 20, 2003
    #4
    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. Riken

    OOPS concepts

    Riken, Jul 15, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    17,265
    bmundy
    Aug 6, 2003
  2. Anandraj

    OOPS in .NET

    Anandraj, Aug 4, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    17,992
    Terry
    Aug 29, 2003
  3. =?Utf-8?B?ZGhucml2ZXJzaWRl?=

    Oops.. how can I rebuild a RESX file?

    =?Utf-8?B?ZGhucml2ZXJzaWRl?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    8,017
    =?Utf-8?B?ZGhucml2ZXJzaWRl?=
    Feb 2, 2005
  4. Replies:
    2
    Views:
    390
    Joerg Jooss
    Aug 21, 2005
  5. pabbu
    Replies:
    8
    Views:
    708
    Marc Boyer
    Nov 7, 2005
Loading...

Share This Page