By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,955 Members | 1,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,955 IT Pros & Developers. It's quick & easy.

Will C ever have OO (any) as part of the std?

P: n/a
Will C ever have OO (any) as part of the std?

Tony
Nov 4 '08 #1
Share this Question
Share on Google+
15 Replies


P: n/a
"Tony" <to**@my.netwrites:
Will C ever have OO (any) as part of the std?
Seems unlikely. C++, Objective C, Java, and C# exist already,
and they have the market covered pretty well.
--
"I hope, some day, to learn to read.
It seems to be even harder than writing."
--Richard Heathfield
Nov 4 '08 #2

P: n/a
On Mon, 03 Nov 2008 20:01:24 -0800, Ben Pfaff wrote:
"Tony" <to**@my.netwrites:
>Will C ever have OO (any) as part of the std?

Seems unlikely. C++, Objective C, Java, and C# exist already,
and they have the market covered pretty well.
OO would be an uglification for C. It has been for fortran.
--
George

America must not ignore the threat gathering against us. Facing clear
evidence of peril, we cannot wait for the final proof, the smoking gun that
could come in the form of a mushroom cloud.
George W. Bush

Picture of the Day http://apod.nasa.gov/apod/
Nov 4 '08 #3

P: n/a
On Nov 4, 10:57*am, "Tony" <t...@my.netwrote:
Will C ever have OO (any) as part of the std?
?!?!?!?! :-) :-) ... :-(

APL is a better language than Forth; why not make
Forth more APL-like? Oh, and please rewrite the
shell I use to employ a video game-like interface.

When a blind-tasting test found that 51% of
consumers preferred Pepsi, Coke took its product
off the shelves, replacing it with a Pepsi
taste-alike named "Coke"! (Admittedly this bizarre
ploy turned into a money-winner for Coke when
it reintroduced Classic Coke a little later!)

Call me an old fogey, but I found it simplest
to simply copy old 'nvi' and 'csh' binaries when
I bought a new computer recently. Sounds like
I'd better keep a Classic-C Compiler binary
around also. 1/2 :-)

James Dow Allen
Nov 4 '08 #4

P: n/a
James Dow Allen wrote:
When a blind-tasting test found that 51% of
consumers preferred Pepsi, Coke took its product
off the shelves, replacing it with a Pepsi
taste-alike named "Coke"! (Admittedly this bizarre
ploy turned into a money-winner for Coke when
it reintroduced Classic Coke a little later!)
Close, but no.

http://en.wikipedia.org/wiki/New_Coke

--
pete
Nov 4 '08 #5

P: n/a
Tony wrote:
Will C ever have OO (any) as part of the std?
Nothing prevents you to do OOP with C. OOP is not bound to
languages. For a excellent OOP library for C have a look at
GObject:

http://library.gnome.org/devel/gobject/stable/

Wolfgang Draxinger
--
E-Mail address works, Jabber: he******@jabber.org, ICQ: 134682867

Nov 4 '08 #6

P: n/a
Tony wrote:
Will C ever have OO (any) as part of the std?
You can already do OO in C; it's just that some other languages have
features that make OO easier than it is in C. If you want a C-like
language with features that support OO, there's several to choose from,
as you almost certainly are already aware of. If there's any point at
all in the continued existence of C after the creation of perl, C++, and
java, it must be to take advantage of the greater simplicity of a
language that does not support OO. That simplicity makes the language
easier to learn, easier to understand, and easier to implement.

OO has it's advantages, too. That's why there's more than one
programming language in the world - different languages are better for
different types of tasks, no one language is best for all tasks.
Nov 4 '08 #7

P: n/a

"Tony" <to**@my.netha scritto nel messaggio
news:7L*****************@nlpi064.nbdc.sbc.com...
Will C ever have OO (any) as part of the std?

Tony
No, because no C programmer agree on a "single" way to do it in C. For
example Gtk+ has an oop-like system with GObject, but somebody could not
like all that macros and casts under the hood and all the typedefs (example:
gchar for char). So what one do? You create your own sort of oop in C of
course, as a mixture of what you've got already or completely from scratch.
I prefer the second option but you cannot always do that...
Nov 4 '08 #8

P: n/a
Probably not. The primary mandate for WG-14 is to
document current practice. Most OO proposals would
shift the focus of the purpose of C. As other have said
there are many OO languages rooted in C.

w..

Tony wrote:
Will C ever have OO (any) as part of the std?

Tony
Nov 4 '08 #9

P: n/a
Tony wrote:
Will C ever have OO (any) as part of the std?
Will the Elgin Marbles ever return to Greece?

--
Er*********@sun.com
Nov 4 '08 #10

P: n/a
Ben Pfaff wrote:
"Tony" <to**@my.netwrites:
>Will C ever have OO (any) as part of the std?

Seems unlikely. C++, Objective C, Java, and C# exist already,
and they have the market covered pretty well.
Besides, it already exists. It just isn't as simple to use, and
requires (horrors) discipline. For example:

typedef struct thing {
readfn readop;
wrtfn writeop;
size_t gutsize;
char guts[MAXGUTS]
} thing, *thingp;

with readfn and wrtfn pointers to procedures, can be used to
implement many of the types of operations used in OO. Then
"thing.readop" might require coding:

if (err = *thingp.readop(*thing, stdin, 100))
handlerr(err, *thing);

and I don't use this, so ignore any silly errors above.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 4 '08 #11

P: n/a
In article <7L*****************@nlpi064.nbdc.sbc.com>, "Tony" <to**@my.net>
wrote:
Will C ever have OO (any) as part of the std?

Tony
Yes. It's called Objective-C.

--
I'm not even supposed to be here today.

I ASSURE YOU WE'RE OPEN!
Nov 5 '08 #12

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

S M Ryan wrote:
Yes. It's called Objective-C.
Objective-C extensions are no covered by any C standard. It's just
another programming language that is based on C.

Pawel Dziepak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkRnA4ACgkQPFW+cUiIHNq4IgCfQs2e7gjdcV Qlg7gVNJVdEFtR
UpAAoJDhBDgbChAbpqwgvkx7DxKTwMZF
=45bY
-----END PGP SIGNATURE-----
Nov 5 '08 #13

P: n/a

"Pawel Dziepak" <pd******@quarnos.orgha scritto nel messaggio
news:ge**********@registered.motzarella.org...
>
Objective-C extensions are no covered by any C standard. It's just
another programming language that is based on C.
Yes and the syntax is quite different (and horrible in my view)...
Nov 5 '08 #14

P: n/a
Pawel Dziepak wrote:
>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
.... snip ...
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkRnA4ACgkQPFW+cUiIHNq4IgCfQs2e7gjdcV Qlg7gVNJVdEFtR
UpAAoJDhBDgbChAbpqwgvkx7DxKTwMZF
=45bY
-----END PGP SIGNATURE-----
Please eliminate this useless gup.

I'll revise that - it has a purpose - to annoy.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 5 '08 #15

P: n/a
On 4 nov, 04:57, "Tony" <t...@my.netwrote:
Will C ever have OO (any) as part of the std?

Tony
You can download the "C Object System" from sourceforge which is a
pure C library. The current release is 0.7 but it's already pretty
stable for the CosBase module which is the required module to do OO in
C. It requires a C99 preprocessor but a C89 compiler once preprocessed
(obviously a C99 compiler is ok). The CosStd module is still under
development (unstable).

The features provided by COS go far beyond to other framework (e.g.
GObject) and some languages (e.g. Objective-C):

- uniform object model (class, metaclasses) better organized than in
Objective-C
- multimethods (methods member of more than one class) with a
dispatcher faster than Objective-C and as fast as virtual function of C
++ (for single dispatch).
- fast message forwarding (about 50-80 faster than Objective-C)
- exception and contract
- ownership and memory management
- introspection
- closure
- thread compliant (use TLS if available, pthread otherwise)

I can send you some transparencies on COS as a (very short) manual,
but still enough since COS is rather simple for C programmers with
minimum OO knowledge.

regards,

ld.



Nov 5 '08 #16

This discussion thread is closed

Replies have been disabled for this discussion.