T
Tech07
When will C have an object model?
Please explain your definition of "object model"Tech07 said:When will C have an object model?
When will C have an object model?
C isn't an extensible programming language.
| When will C have an object model?
It doesn't need one. Applications may need one, but languages don't.
If you application needs one, choose a language that has one.
When will C have an object model?
Tech07 said:When will C have an object model?
Malcolm McLean said:Opinion is moving against object-oriented programming.
Malcolm McLean said:Stuff I've read. You used to read plenty of articles attacking C++, but not
object-oritented programming itself. Now I've notice far more material
attacking the very concept of object oriented programming.
Dijkstra said "Object-oriented programming is an exceptionally bad idea
which could only have originated in California"
The Wikipedia entry on "object-oriented programming" has a list of critics.
I'd admit this isn't a very scientific survey, more an impression about they
way the wind is blowing.
Malcolm McLean said:Dijkstra said "Object-oriented programming is an exceptionally bad idea
which could only have originated in California"
ld said:You could be interested by
http://cos.cvs.sourceforge.net/viewvc/*checkout*/cos/doc/cos-draft-dls09.pdf
to see how C itself is extensible and can do better than Objective-C.
The C Object System is a C library which adds a rather complete object
model to C (like CLOS to Common Lisp) and allows to build component
(reusable generic object) that you can't built in C++ or Objective-C.
Mark Storkamp said:I may be wrong about this, but I was always under the impression that
C++ and Objective-C were super sets of C. If that's true, how can it be
said that something can be done in C, but not C++ or Objective-C?
Or in a strict sense, would it be said that C++ and Objective-C
compilers are able to compile C code, but when doing so, they are not
actually C++ or Objective-C compilers at that moment in time.
C++ is very nearly a superset of C. There are valid C programs that
are not valid C++ programs, and there are even a few valid C programs
that are valid C++ programs with different semantics. But in general,
for a given valid C program, it's not difficult to convert it into
a valid C program with the same semantics that's also a valid C++
program with the same semantics.
Objective-C is said to be a strict superset of C.
I suspect what ld was saying is that the C Object System can be used
to do things that can't be done using the object-oriented features of
C++ or Objective-C. I can't comment on the accuracy of that claim.
Presumably the COS library could be compiled as C++ or Objective-C,
perhaps with some tweaks -- but that would be a rather odd thing to
do.
Right.
No, they're still C++ or Objective-C compilers, and the programs
they're compiling are still C++ or Objective-C programs (that also
happen to be C programs).
pete said:I don't know about that.
It is possible that what a program does,
can depend only upon whether the compiler considers
it to be a C program or a C++ program.
You can do object-oriented programming In C, but it is messy because there
is no syntactical support so things like inheritance have to be scratched up
from tables of function pointers.
Every so often someone comes up with some extensions to C, and an object
model is a common thing to add. C++ is the best-known example. There will be
other attempts, but none so far has been accepted into the core language,
and probably never will be. Opinion is moving against object-oriented
programming.
Done already more than 15 years back.When will C have an object model?
Herbert said:Done already more than 15 years back.
Google for CORBA.
Truly object oriented - mor that C++ will ever be.
Wolfgang Draxinger said:And even then you can choose any language you like. You'll just have a
little more work to do, implementing all the object system's backend
stuff.
Or use a ready to use object system. For C there is GObject. (Please no
debates, GObject works and does it's job very well. In my experience GNOME
is a lot more stable than KDE, and I'm saying this as a mainly-KDE user).
Kaz Kylheku said:C isn't an extensible programming language. So adding an object system to
C
means that a new language is created (possibly one which has significant
backward compatibility).
This has already happened, quite long ago, and the results were given
names
like C++ and Objective C.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.