[vox-tech] objective C

Micah Cowan vox-tech@lists.lugod.org
Fri, 26 Jul 2002 15:57:30 -0700


Peter Jay Salzman writes:
 > hola,
 >=20
 > i started looking at objective C.  to my eyes, the grammar is worlds=

 > simpler than C++.  as far as i can tell, it adds only 1 piece of syn=
tax
 > to the C language -- passing a message to an object
 >=20
 >    [Object doSomethingWith: anotherObject];
 >=20
 > all the other OO enhancements are simply more keywords.  so the synt=
ax
 > is pretty much the same as C.  people who use it say that objective =
C is
 > a proper superset of C (as opposed to C++).
 >=20
 > has anyone here used objective C?  it looks really interesting.

I have, and it is.

It's basically C plus OO classes. It's good if you want C, and want
objects (without having to fake 'em), but don't like various things
about C++ (e.g., references, lack of strictly defined behavior on
casting char* to unsigned char* or vice-versa, C++ iostreams'
inability to repoen a text stream as binary, Stroustrup's massive
ego...).

It's C with just a *little* OO sugar. One thing that C++ benefits from
that neither C nor Objective C have is templates, and the Standard
Template Library, which can be quite handy sometimes. While still a
horribly screwy mechanism with compared to more elegant, and even more
general equivalents such as Ada's, it provides much better
generalization than C can manage with (say) macros.

Lest anyone try to determine my stance from my comments above, let me
state that I really am language-agnostic for the most part. C is
really my favorite language, if for nothing else than having spent
more time on it than on any other language. It is a horrible language
in may respects - but it never gets in your way, unlike most other
languages I've known. C++ has added a lot of elegance to C, and about
an equal amount of its own brand of horribleness as well. Which one I
use depends a lot on what I'm doing. When being able to work somewhat
closer to the problem using OO classes, the STL and other abstraction
techniques is strong enough to outweight the control freak in me that
just loves to use C for everything, well I use C++.

I'd probably use Objective C more, except for the fact that it has no
true standard (though it must have a spec, somewhere), and isn't
as widespread as either Objective C or C++.

My 2=A2,
Micah