+ Reply to Thread
Page 2 of 5
FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 47

Thread: Open source my OIOIC, a completely new object-oriented mechanism for the C.

  1. #11
    Newbie pervise.zhao is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    29

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Quote Originally Posted by WingedPanther View Post
    Looking at Chapter 3: Single Inheritance of your tutorial (English), all of your code is presented as snapshots. Since I have not downloaded OIOIC to follow the directions, perhaps you could post the code necessary for that example to compile (I use GCC).

    Based on that, I'll be happy to write the corresponding C++ code for comparison. I already noticed that you appear to have a LOT of custom datatypes that don't all appear to be defined in the code you posted.

    EDIT: Never mind the first part, I saw the download link for the source code. I find it somewhat odd that the source code for such a simple application spans 20 files. I find it stranger that you are creating aliases for built-in data types. Why should float be refered to as SR32, for example?

    I am working on the corresponding C++ code now.

    [/CODE]
    Even though all examples are assumed the Visual C++, but a minor modification will make them to adapt to GCC in Linux/Unix. Perhaps the necessary changes are:

    1. In the “oioic.h” file, postfix “LL” for the following each macro, as follows:
    #define MSKOS 0xFFFF000000000000LL
    #define MSKHO 0x0000FFFFFFFF0000LL
    #define MSKSO 0x000000000000FFFFLL

    #define OID_OICOS 0x0001000000000000LL
    #define OID_UNIX 0x0002000000000000LL
    #define OID_LINUX 0x0003000000000000LL
    #define OID_WINDOWS 0x0004000000000000LL

    2. In the “oioic.h” file, define OID_OS as OID_LINUX, as follows:
    #define OID_OS OID_LINUX

    3. In the “ho.h” file, postfix “LL” for the “0x0000xxxxxxxx0000” in commentary, as follows:
    /* #define OID_HO (0x0000xxxxxxxx0000LL | OID_OS) /-* HO’s OID.*-/ */


    This is a good thing to to write the corresponding C++ code for comparison. Look forward to your results of the comparison

    SR32 is the data type of 32 bits signed real number.
    UR32 is the data type of 32 bits unsigned real number.

  2. #12
    Programming Professional Phoenixz will become famous soon enough
    Join Date
    Dec 2008
    Posts
    252
    Blog Entries
    1

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    I'm still reading. I find it quite interesting, but I do think pervise.zhao is fighting a losing battle and I don't know C++ so well, but C++ haas a lot of things different, and I kinda like code that is neat, but 3000 lines to do a 40 line job? kinda way OTT.

  3. #13
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,686
    Blog Entries
    57

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Quote Originally Posted by pervise.zhao View Post
    Even though all examples are assumed the Visual C++, but a minor modification will make them to adapt to GCC in Linux/Unix. Perhaps the necessary changes are:

    1. In the “oioic.h” file, postfix “LL” for the following each macro, as follows:
    #define MSKOS 0xFFFF000000000000LL
    #define MSKHO 0x0000FFFFFFFF0000LL
    #define MSKSO 0x000000000000FFFFLL

    #define OID_OICOS 0x0001000000000000LL
    #define OID_UNIX 0x0002000000000000LL
    #define OID_LINUX 0x0003000000000000LL
    #define OID_WINDOWS 0x0004000000000000LL

    2. In the “oioic.h” file, define OID_OS as OID_LINUX, as follows:
    #define OID_OS OID_LINUX

    3. In the “ho.h” file, postfix “LL” for the “0x0000xxxxxxxx0000” in commentary, as follows:
    /* #define OID_HO (0x0000xxxxxxxx0000LL | OID_OS) /-* HO’s OID.*-/ */


    This is a good thing to to write the corresponding C++ code for comparison. Look forward to your results of the comparison

    SR32 is the data type of 32 bits signed real number.
    UR32 is the data type of 32 bits unsigned real number.
    So what you are saying is: the generated code is not cross-platform. That's a bit inconvenient.

    You have started responding to my analysis. Ultimately, it's the difference between 15 vs 5 files, 3000 lines vs 50 lines, many many many typedefs vs 2 classes, well-contained coded versus code sprawl across files.

    What you have done is a brilliant bit of programming that does a great job of giving an OO feel to the C language, but at a significant cost. I cannot imagine trying to do a large project in this, especially since it seems to require violating good programming practices to make it work.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #14
    Newbie pervise.zhao is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    29

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Quote Originally Posted by Phoenixz View Post
    I'm still reading. I find it quite interesting, but I do think pervise.zhao is fighting a losing battle and I don't know C++ so well, but C++ haas a lot of things different, and I kinda like code that is neat, but 3000 lines to do a 40 line job? kinda way OTT.
    Do not use the number of rows or pages of the code to measure the complexity of a programme. If we write a programme as simple as "Hello, world", not need OO at all. In reality, a software is much more complex, no such simple car, ship, amphicar ...
    Last edited by pervise.zhao; 03-21-2009 at 04:34 AM.

  5. #15
    Newbie pervise.zhao is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    29

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    The name of example 3 code and example 2 code are the same, it is "Factory.tar.gz", But their contents are not the same, NOTICE, not to cover one another when download one.

  6. #16
    Newbie pervise.zhao is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    29

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Quote Originally Posted by WingedPanther View Post
    So what you are saying is: the generated code is not cross-platform. That's a bit inconvenient.

    You have started responding to my analysis. Ultimately, it's the difference between 15 vs 5 files, 3000 lines vs 50 lines, many many many typedefs vs 2 classes, well-contained coded versus code sprawl across files.

    What you have done is a brilliant bit of programming that does a great job of giving an OO feel to the C language, but at a significant cost. I cannot imagine trying to do a large project in this, especially since it seems to require violating good programming practices to make it work.
    I think, for beginners, it requires time to experienced the tremendous energy of OIOIC. I do not think this is a huge cost to use OIOIC, but I think this will greatly reduce costs. I very much look forward to everyone's views, whether your comments are positive or negative.

  7. #17
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,686
    Blog Entries
    57

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Here's a more details response, then.
    From a philosophical standpoint, I believe that anything that is auto-generated should be left alone. I immediately run into a problem in example 3 when, in step 6, you modify oioic.h. Again, you make changes to ho.c, which to my mind should not be necessary. There are numerous declarations of constants, which are not obviously or automatically kept distinct. The overall result is that you cannot simply take your car.* files and use them in another project without modifying a lot of other files in the other project. The same is true of the vehicle.* files. Because so much is inter-related, the potential for bugs with a small change strikes me as huge. Debugging strikes me as a nightmare.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  8. #18
    Newbie pervise.zhao is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    29

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Quote Originally Posted by WingedPanther View Post
    Here's a more details response, then.
    From a philosophical standpoint, I believe that anything that is auto-generated should be left alone. I immediately run into a problem in example 3 when, in step 6, you modify oioic.h. Again, you make changes to ho.c, which to my mind should not be necessary. There are numerous declarations of constants, which are not obviously or automatically kept distinct. The overall result is that you cannot simply take your car.* files and use them in another project without modifying a lot of other files in the other project. The same is true of the vehicle.* files. Because so much is inter-related, the potential for bugs with a small change strikes me as huge. Debugging strikes me as a nightmare.
    NO, After you are familiar with the OIOIC, you will find they are only easy, regular, small troubles.
    Of course, if there will be a C IDE that supports OIOIC in the future, these small troubles will be also gone.

  9. #19
    The Crazy One TkTech will become famous soon enough TkTech's Avatar
    Join Date
    Jun 2006
    Location
    Canada
    Age
    18
    Posts
    1,549
    Blog Entries
    1

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Ah, this was a truly amusing read.

  10. #20
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,686
    Blog Entries
    57

    Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

    Quote Originally Posted by pervise.zhao View Post
    NO, After you are familiar with the OIOIC, you will find they are only easy, regular, small troubles.
    Of course, if there will be a C IDE that supports OIOIC in the future, these small troubles will be also gone.
    Have you ever worked with a language that supports OOP natively? Have you worked with any GUI libraries in an OOP language? I'm thinking of things like wxWidgets, Ultimate++, FLTK, QT or GTK+ for C++; Delphi (VCL + Object Pascal); .NET languages. In every one of those instances, I am able to simply include a component, such as a socket listener, and the only code I have to write is a #include! I do NOT every touch the library to make the component work with my code. While I need to know a component's properties, I never need to worry about incorporating its implementation details into my own project. The #include simply handles that for me.

    By contrast, if you gave me a network socket class written in OIOIC, it appears that I would have to worry about merging multiple source files together with my own project, managing any potential conflicts in the various aliases used, etc. My concern, when looking at this, is simple: it looks like it makes my life harder, not easier. It also looks like it does not support many of the OOP concepts that I rely on.

    As I said before, it is a brilliant creation. Unfortunately, I am having a hard time seeing how it would make my life easier. I can, however, envision it making my life harder.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

+ Reply to Thread
Page 2 of 5
FirstFirst 1 2 3 4 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. C/C++ resources
    By v0id in forum C and C++
    Replies: 18
    Last Post: 03-11-2010, 07:22 PM
  2. Replies: 0
    Last Post: 11-27-2008, 01:30 AM
  3. Object Oriented F# - Creating Classes
    By Kernel in forum News
    Replies: 0
    Last Post: 09-29-2008, 05:40 PM
  4. Replies: 0
    Last Post: 04-24-2008, 06:01 PM
  5. Exploring Open Source
    By peter Laman in forum Introductions
    Replies: 9
    Last Post: 04-19-2008, 11:52 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts