|
||||||
| 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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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. |
|
||||
|
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 |
|
|||
|
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.
Quote:
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。 |
|
||||
|
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:
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 |
|
|||||||
|
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.
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:
Quote:
Quote:
Quote:
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:
Quote:
Quote:
|
|
||||
|
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 |
|
|||
|
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.
Quote:
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.. |
|
||||
|
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.
Quote:
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; Code:
printf("%d",myint);
Quote:
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 |
|
|||
|
Re: Open source my OIOIC, a completely new object-oriented mechanism for the C.
Quote:
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.. |
|
||||
|
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
Code:
#ifndef __CAR_H__
#define __CAR_H__
#include "vehicle.h"
class Car : public Vehicle
{
public:
float max_load;
float max_velocity;
Car();
};
#endif
Code:
#include "vehicle.h"
Vehicle::Vehicle()
{
weight = 1.01f;
}
Code:
#include "car.h"
Car::Car()
{
max_load = 1.53f;
max_velocity = 186.5f;
Vehicle::Vehicle();
}
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| 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 — 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.
Amrosama.cc
Arekbulski.cc
Debtboy.cc
Guest.cc
Jaan.cc
James.cc
Mathx.cc
Tsz.cc
Vswe.cc