Go Back   CodeCall Programming Forum > Software Development > C and C++
Register Blogs Search Today's Posts Mark Forums Read

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-12-2009, 01:22 AM
Newbie
 
Join Date: Mar 2009
Posts: 27
pervise.zhao is an unknown quantity at this point
Open source my OIOIC, a completely new object-oriented mechanism for the C.

OIOIC is a completely new object-oriented mechanism for the C programming language.
Please download the "OIOIC-Primer-2nd-Edition-English.tar.gz". (the English version of << OIOIC Primer >> )
Downloads - oioic - Google Code

Welcome your advice!

Using OIOIC, you can describe the flower, birds, grass, insects, trees, houses ...
Using OIOIC, you can describe the elements, atoms, protons, electrons ...
Using OIOIC, you can describe the earth, the sun, the Milky Way galaxy, collapsar ...
Using OIOIC, you can describe ...

1. OIOIC perfectly supplies the gap of object-oriented technology for the C programming language;
2. OIOIC perfectly solved the multiple inheritance problem in the Software World;
3. OIOIC perfectly objectivizes multithreading access control of object;
4. OIOIC unifies the norm of components in the Software World;
5. OIOIC unifies the structure of code tree in the Software World;
6. OIOIC unifies the thinking of object-oriented programming in the Software World;
7. OIOIC unifies all advanced programming languages in the Software World, to make the C programming language as the preferred.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-12-2009, 12:07 PM
WingedPanther's Avatar
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 11,435
WingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud of
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

Aside from the fact that this is a VERY spammy post (and a double post at that), why wouldn't I just switch to C++ and use the Boost library to get threading?
__________________
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-15-2009, 11:20 PM
Newbie
 
Join Date: Mar 2009
Posts: 27
pervise.zhao is an unknown quantity at this point
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

Quote:
Originally Posted by WingedPanther View Post
Aside from the fact that this is a VERY spammy post (and a double post at that), why wouldn't I just switch to C++ and use the Boost library to get threading?
STATEMENT: THIS IS NOT A SPAMMY POST!

OIOIC is a thinking of completely new object-oriented programming for the C, totally different from the C++ ! In my opinion, OIOIC is FAR STRONGER than the C++ in object-oriented programming!So I open it. I hope OIOIC can help the development of software。
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-16-2009, 12:30 PM
WingedPanther's Avatar
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 11,435
WingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud of
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

You made several extremely broad claims that were extremely short on details.
Quote:
Originally Posted by pervise.zhao View Post
1. OIOIC perfectly supplies the gap of object-oriented technology for the C programming language;
2. OIOIC perfectly solved the multiple inheritance problem in the Software World;
3. OIOIC perfectly objectivizes multithreading access control of object;
4. OIOIC unifies the norm of components in the Software World;
5. OIOIC unifies the structure of code tree in the Software World;
6. OIOIC unifies the thinking of object-oriented programming in the Software World;
7. OIOIC unifies all advanced programming languages in the Software World, to make the C programming language as the preferred.
These claims don't really tell me anything. Here are some immediate questions that come to mind:
1) Which OO paradigms are supported?
2) Are you saying that allowing multiple inheritance is a problem, or that implementing it is a problem? Java disallows it while C++ implements it efficiently.
3) Can you clarify on this item?
4) I have no idea what you mean by this.
5) I have no idea what you mean by this.
6) The thinking about object-oriented programming is splintered. Adding another OO mechanism will not change that.
7) No. Just no. C will probably never be the preferred web programming language, for example.

In addition to the comments questions above, what is this "Software World" you speak of?

I downloaded your tutorial. It betrays several things:
1) OIOIC appears to be a preprocessor of some sort.
2) You seem to be limited primarily to using Visual C++.
3) In my opinion, the code it is producing is hideous compared to C++.
4) It seems like you're trying to recreate something similar to C++ while preserving all the ugliness of C.

Perhaps if you did a code comparison between a complete (simple) program in OIOIC vs the comparable C++ program. As an example, here is a sequence of tutorials I did using C++:
Implementing a Fuzzy Boolean
Implementing a Fuzzy Set
Extending the Fuzzy Set
Viewing the resulting code, I think it is clean, clear, and concise. What would these look like in OIOIC?

Please don't misunderstand, I believe you are very excited about this project. That said, excitement doesn't make it a good replacement for other technologies. Also, I am well aware that it is possible to do OOP in C. It is not clear to me how OIOIC facilitates this.
__________________
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-17-2009, 05:35 AM
Newbie
 
Join Date: Mar 2009
Posts: 27
pervise.zhao is an unknown quantity at this point
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

Quote:
Originally Posted by WingedPanther View Post
1) Which OO paradigms are supported?
Unlike C++, OIOIC has no "class", replaced by "node". A node, witch provides the four features commonly present in OO languages: abstraction, packaging, inheritance and polymorphism, is a highly abstract to an entity.

Quote:
Originally Posted by WingedPanther View Post
2) Are you saying that allowing multiple inheritance is a problem, or that implementing it is a problem? Java disallows it while C++ implements it efficiently.
As far as I know, before OIOIC, no one language can support well the multiple inheritance. On the contrary, often heard that all languages are avoiding or suggesting programmers not to use multiple inheritance, for instance the Java mentioned by you. The relation of multiple inheritance is naturally existent, so we should not shy away from multiple inheritance, but try to achieve it.

Quote:
Originally Posted by WingedPanther View Post
7) No. Just no. C will probably never be the preferred web programming language, for example.
I think, the text data by an Markup Language just is a format of data stream for an OIOIC object, the Object absorb and analyses these data streams and implements.

Quote:
Originally Posted by WingedPanther View Post
In addition to the comments questions above, what is this "Software World" you speak of?
In fact, we are describing this real world in sofrware, so I have introduced the "Software World".

Quote:
Originally Posted by WingedPanther View Post
I downloaded your tutorial. It betrays several things:
1) OIOIC appears to be a preprocessor of some sort.
Yes, and the oicc is a main utility for the preprocessor.

Quote:
Originally Posted by WingedPanther View Post
2) You seem to be limited primarily to using Visual C++.
DO NOT think that OIOIC is only for the Visual C++. The reason of assuming Visual C++ in examples is: 1. the user of Visual C++ is more; 2. the C programming language is independent of any development environments.

Quote:
Originally Posted by WingedPanther View Post
3) In my opinion, the code it is producing is hideous compared to C++.
I do not think so. I think that the OO encapsulation of OIOIC is better. In my opinion, to determine one thing should be assign to the programmer or to the compiler, the C is the most fair referee.

Quote:
Originally Posted by WingedPanther View Post
4) It seems like you're trying to recreate something similar to C++ while preserving all the ugliness of C.
No, I think C is the best, rather than C++.

Quote:
Originally Posted by WingedPanther View Post
Please don't misunderstand, I believe you are very excited about this project. That said, excitement doesn't make it a good replacement for other technologies. Also, I am well aware that it is possible to do OOP in C. It is not clear to me how OIOIC facilitates this.
I consider that OIOIC is great, so I open it. I expect everyone to join in the discussion and look forward to everyone's views.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-17-2009, 12:25 PM
WingedPanther's Avatar
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 11,435
WingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud of
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

So far, what you are saying is that OIOIC doesn't offer any features not already present in C++.

I look forward to seeing how you would implement the three tutorials I referenced using it. There's nothing like comparing code between languages to highlight advantages and disadvantages.
__________________
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-18-2009, 02:50 AM
Newbie
 
Join Date: Mar 2009
Posts: 27
pervise.zhao is an unknown quantity at this point
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

Quote:
Originally Posted by WingedPanther View Post
So far, what you are saying is that OIOIC doesn't offer any features not already present in C++.

I look forward to seeing how you would implement the three tutorials I referenced using it. There's nothing like comparing code between languages to highlight advantages and disadvantages.
OIOIC is designed for the C programming language. In my opinion, compared with the C, apart from OO, C++ has no other advantages to speak of. The C is simple and flexible, but C++ is tanglesome and fussy. More alarming is that the C++, as its name, has be growing fat yet. For programmers, a programming language is only a tool, the programmers are only the users of this tool. As a programming language, its functions should be the more powerful the better, and its usage should be more simple and easy the better. Programmers should be allowed to put more energy into the specific design and exchange of ideas, and should not waste too much energy in the study of the language. This, in all programming languages, only the C did. Formerly, except there is no object-oriented features, and no one dare say that there is other disadvantages in the C, but now, the C has the powerful OIOIC already. In addition, C++ did not implement well multiple inheritance, for example, the constructor of base class is called repeatedly.

Besides providing four features in OO languages and objectivizing multithreading access control of object, OIOIC creatively makes the following four great "unifies" become possible:
1. Unifies the norm of components.
2. Unifies the structure of code tree.
3. Unifies the thinking of object-oriented programming.
4. Unifies all advanced programming languages into the C.

The significance of these four "unifies" is self-evident.

Last edited by pervise.zhao; 03-18-2009 at 03:41 AM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-18-2009, 09:11 AM
WingedPanther's Avatar
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 11,435
WingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud of
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

Quote:
Originally Posted by pervise.zhao View Post
OIOIC is designed for the C programming language. In my opinion, compared with the C, apart from OO, C++ has no other advantages to speak of. The C is simple and flexible, but C++ is tanglesome and fussy. More alarming is that the C++, as its name, has be growing fat yet. For programmers, a programming language is only a tool, the programmers are only the users of this tool. As a programming language, its functions should be the more powerful the better, and its usage should be more simple and easy the better. Programmers should be allowed to put more energy into the specific design and exchange of ideas, and should not waste too much energy in the study of the language. This, in all programming languages, only the C did. Formerly, except there is no object-oriented features, and no one dare say that there is other disadvantages in the C, but now, the C has the powerful OIOIC already. In addition, C++ did not implement well multiple inheritance, for example, the constructor of base class is called repeatedly.
Having read The Design and Evolution of C++, I have to disagree with your comparison of C and C++. C++ did a lot more than simply add OO methods. Examples:
1) greatly reducing the need for macros, which can cause subtle bugs that are hard to isolate. This is accomplished through the use of const variables and templates.
2) increasing the strength of the type system, which forces the programmer to be explicit when performing unsafe conversions. While annoying, this forces the programmer to be more conscientious of unsafe casts.
3) By using a gradual evolution, C++ was able to keep its size modest, the compiler efficient, and allow programmers to slowly add features that C++ offers to their code without penalizing them for unused features.
4) Operator overloading allows C++ to create classes behave like built-in data types. A matrix class can be built that has meaningful + and * operators and will also warn you at compiler time if you attempt a nonsensical operation, like adding a matrix to an integer.

There are numerous other changes that C++ introduces. For me, the ultimate change that impacts me on a regular basis is the difference between
Code:
cout<<myint;
and
Code:
printf("%d",myint);
cout uses operator overloading to correctly output an integer every time. With printf, if I make a mistake and use the wrong specifier for my data type (like %d with a double instead of an int), the compiler won't complain and I'll get REALLY strange bugs. The same applies to cin vs scanf.

Quote:
Originally Posted by pervise.zhao View Post
Besides providing four features in OO languages and objectivizing multithreading access control of object, OIOIC creatively makes the following four great "unifies" become possible:
1. Unifies the norm of components.
2. Unifies the structure of code tree.
3. Unifies the thinking of object-oriented programming.
4. Unifies all advanced programming languages into the C.

The significance of these four "unifies" is self-evident.
1) I'm not sure what you mean by this.
2) what if I disagree with the structure you impose on me?
3) thinking about OOP is inherently not unified (See Java vs C++ for many examples). OIOIC will not change that.
4) C and C++ code can be linked together, as can Fortran code. I suspect you don't see how different languages serve different purposes. My take on it is that you are re-inventing the wheel.
__________________
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 03-19-2009, 03:16 AM
Newbie
 
Join Date: Mar 2009
Posts: 27
pervise.zhao is an unknown quantity at this point
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

Quote:
Originally Posted by WingedPanther View Post
Having read "The Design and Evolution of C++", I have to disagree with your comparison of C and C++. C++ did a lot more than simply add OO methods. Examples:
1) greatly reducing the need for macros, which can cause subtle bugs that are hard to isolate. This is accomplished through the use of const variables and templates.
2) increasing the strength of the type system, which forces the programmer to be explicit when performing unsafe conversions. While annoying, this forces the programmer to be more conscientious of unsafe casts.
3) By using a gradual evolution, C++ was able to keep its size modest, the compiler efficient, and allow programmers to slowly add features that C++ offers to their code without penalizing them for unused features.
4) Operator overloading allows C++ to create classes behave like built-in data types. A matrix class can be built that has meaningful + and * operators and will also warn you at compiler time if you attempt a nonsensical operation, like adding a matrix to an integer.

There are numerous other changes that C++ introduces. For me, the ultimate change that impacts me on a regular basis is the difference between
Code:
cout<<myint;
and
Code:
printf("%d",myint);
cout uses operator overloading to correctly output an integer every time. With printf, if I make a mistake and use the wrong specifier for my data type (like %d with a double instead of an int), the compiler won't complain and I'll get REALLY strange bugs. The same applies to cin vs scanf.


1) I'm not sure what you mean by this.
2) what if I disagree with the structure you impose on me?
3) thinking about OOP is inherently not unified (See Java vs C++ for many examples). OIOIC will not change that.
4) C and C++ code can be linked together, as can Fortran code. I suspect you don't see how different languages serve different purposes. My take on it is that you are re-inventing the wheel.

Macro is reasonable, I like macro.
Operator overloading is unreasonable, I do not agree with Operator overloading.
“cout<<myint;” and “printf("%d",myint);”, I prefer the latter.
C++ is more and more fat ...

Attention,please! OIOIC starts from philosophy (the Philosophy of Dialectical Materialism), not language, and is designed all through on the high level of the philosophy, not merely on the level of language.

This is NOT re-inventing the wheel.

Last edited by pervise.zhao; 03-19-2009 at 05:19 AM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 03-19-2009, 11:55 AM
WingedPanther's Avatar
Super Moderator
 
Join Date: Jul 2006
Age: 36
Posts: 11,435
WingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud ofWingedPanther has much to be proud of
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.

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.

EDIT2: First issue: I wasn't able to get your code for example 3 to compile using gcc. If you can provide directions, that would be nice. There may have been changes required to get it to compiler under Linux, but the code is extremely cryptic. By contrast, the line to compile mine is "g++ Factory.cpp car.cpp vehicle.cpp -o Factory". All my files are in one directory.

Second issue: you are typedef happy. Your typedefs obscure what is going on. I ended up doing cross-file search/replace to get back to core data types so I could interpret the code.

Third issue: the matching C++ (see below) is 50 lines. As near as I can tell, it uses the same logic as your code. By a rough approximation, yours uses over 3000 lines of code.

Final issue: The logic for car is scattered across multiple files in multiple non-nested folders. In particular, having to trace through oioic/oioic.c to find code for so/go/car/car.c was annoying at best. My sense is that there is no true encapsulation of data, with functionality and definitions scattered across a wide variety of different files.

If anyone's reading, the example code can be downloaded as part of the tutorial at: http://oioic.googlecode.com/files/OI...English.tar.gz

vehicle.h:
Code:
#ifndef __VEHICLE_H__
#define __VEHICLE_H__

class Vehicle
{
public:
  float weight;
  Vehicle();
};

#endif
car.h:
Code:
#ifndef __CAR_H__
#define __CAR_H__
#include "vehicle.h"

class Car : public Vehicle
{
public:
  float  max_load; 
  float  max_velocity; 
  Car();
};

#endif
vehicle.cpp:
Code:
#include "vehicle.h"

Vehicle::Vehicle()
{
  weight = 1.01f;
}
car.cpp:
Code:
#include "car.h"

Car::Car()
{
  max_load = 1.53f;
  max_velocity = 186.5f;
  Vehicle::Vehicle();
}
Factory.cpp:
Code:
#include <iostream>
#include "car.h"
using std::cout;

int main()
{
  Car             g_pCar;
  cout<<"car's weight is "<<g_pCar.weight<<" ton.\n";
  cout<<"car's max-load is "<<g_pCar.max_load<<" ton.\n";
  cout<<"car's max-velocity is "<<g_pCar.max_velocity<<" km/h.\n";
  return 0;
}
__________________
CodeCall Blog | CodeCall Wiki | Shareware
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

Last edited by WingedPanther; 03-19-2009 at 10:11 PM.. Reason: Created C++ code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ resources v0id C and C++ 15 09-08-2009 12:02 PM
Object Oriented F# - Encapsulation with Object Expressions Kernel News 0 11-27-2008 02:30 AM
Object Oriented F# - Creating Classes Kernel News 0 09-29-2008 06:40 PM
Hackontest &mdash; 24h Open Source Coding Marathon Kernel News 0 04-24-2008 07:01 PM
Exploring Open Source peter Laman Introductions 9 04-19-2008 12:52 PM


All times are GMT -5. The time now is 11:00 AM.


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0