thanks for FAQ -- so objC is lousy?

thanks for FAQ -- so objC is lousy?

Post by Dan Kell » Mon, 04 May 1992 00:15:38



I only subscribed to this group 2 days ago, so I was luck to see the
posting of the FAQ.  It answered an important question for me, which I
list below to provoke discussion.  I do this because, until I read the
FAQ, I thought a NeXT might be nice to have.  But if programming in
NeXT is "best" using objective C (which it must be, if NeXT encourages
it), and if programming my science is worse in objective C than in
C++, then NeXT won't help me.

  Q: Is objective C useful for my work?

  A: No, since it does no operator overloading.  The best thing about
     these new variants of C is operator overloading, as far as I can
     see.  I like the idea that I can define a class to store my data,
     and within it define how to add data-sets, or input/output data
     sets, using the same notation for my data as for an int.  If I
     have to do these things with function calls, then I'm back to the
     old C (or even FORTRAN) philosophy, and I'm not willing to dig
     that far back into the past.

... comments?

--

Dalhousie University                  |  {uunet watmath}!dalcs!kelley
Halifax, Nova Scotia, CANADA, B3H 4J1 |  (902) 494-1694

 
 
 

thanks for FAQ -- so objC is lousy?

Post by Tim McClarr » Mon, 04 May 1992 07:14:14



>I only subscribed to this group 2 days ago, so I was luck to see the
>posting of the FAQ.  It answered an important question for me, which I
>list below to provoke discussion.  I do this because, until I read the
>FAQ, I thought a NeXT might be nice to have.  But if programming in
>NeXT is "best" using objective C (which it must be, if NeXT encourages
>it), and if programming my science is worse in objective C than in
>C++, then NeXT won't help me.

        NeXTstep itself is in Objective, and you'll have to use Objective
dispatch to get to it.  But, that doesn't mean you can't use C++.  In
fact, you can do all of your app. in C++ but use Objective wrappers to
talk to NeXTstep.  This would allow using all of the nifty (and often-
abused) aspects of C++ to do your computational work (for an example of
this, take a look at Next's Calculator Lab from the Developer's demos).
Oh, and it all compiles with the SAME compiler (g++).

Quote:>  Q: Is objective C useful for my work?
>  A: No, since it does no operator overloading.  The best thing about
>     these new variants of C is operator overloading, as far as I can
>     see.  I like the idea that I can define a class to store my data,
>     and within it define how to add data-sets, or input/output data
>     sets, using the same notation for my data as for an int.  If I
>     have to do these things with function calls, then I'm back to the
>     old C (or even FORTRAN) philosophy, and I'm not willing to dig
>     that far back into the past.
>... comments?

Yes, overloading is one of the best new things about this new variant of C
(C++, I mean), operator overloading in particular is NOT one of the best
new things, because it tempts people to use overloaded operators where
they are not applicable, they are confusing (now, let's see, is this
particular 'plus' here in my code calling some routine or is it just a
normal plus), and, this person has made the classical mistake of assuming
that he's somehow avoiding function call overhead.  It's pretty obvious that
if a routine is virtual, then the compiler cannot simply plug the proper code
in where necessary; the run-time system must deal with dispatch.  Thus,
all those nifty little operators are function calls anyways (and virtuals
at that).  I am fairly convinced that there are FEW places where one would
benefit from overloading an arithmetical operator.  It is almost always
better to define something as A.SomeAdditiveOperation(B) than A + B, even
if it makes for uglier, albeit very easy to figure out, code.  Besides,
you avoid the one true evil: THINKING ABOUT PRECEDENCE :o)!

--
Tim McClarren     | "I see the pestilence outside my window


(217)244-0015     |  I face the morning with my customary sigh" --  Fishbone

 
 
 

thanks for FAQ -- so objC is lousy?

Post by M.. » Tue, 05 May 1992 01:05:33



says:

Quote:>  Q: Is objective C useful for my work?
>  A: No, since it does no operator overloading.  The best thing about
>     these new variants of C is operator overloading, as far as I can
>     see.  I like the idea that I can define a class to store my data,

  WHOA!!!

  I always thought that this "answer" in the FAQ was meant to be humorous.
ObjC is a great language, and it supports all the key OO concepts in clean
and elegant ways, including polymorhism, aka "overloading".

  However, C++ allows users to redefine operators like +, -, << etc.,
polymorphically.  This is a neat feature of C++, but hardly significant
enough to decide the issue.  (If it were, APL would always win! 8-)

  Why was the joke made in the first place?  Well, in every discussion
of C++ v. ObjC I've ever heard, eventually, after the ObjC side has debunke
every argument, the C++ side eventually says, "But we've got operator
overloading."

  Maybe it is time for ObjC users to fight back.  We've got square bracket
message passing!

lee

 
 
 

thanks for FAQ -- so objC is lousy?

Post by M.. » Tue, 05 May 1992 01:13:46


...and of course, on the NeXT, the Obj C compiler also compiles C++,
so you have both anyway.
 
 
 

thanks for FAQ -- so objC is lousy?

Post by Howard W P » Tue, 05 May 1992 02:43:44



says:

Quote:>  Q: Is objective C useful for my work?
>  A: No, since it does no operator overloading.  The best thing about
>     these new variants of C is operator overloading, as far as I can
>     see.  I like the idea that I can define a class to store my data,

Hi,

Does anyone know where I can find an article that compares and contrasts C++
with Objective C? I would like to learn more about the differences and the
similarities between the two languages and would appreciate it greatly if
someone could send me information on this topic. Thank you.

Also, does anyone know if there are any journals dedicated to Objective C and
if there are any archives on the INTERNET that holds Objective C classes?

Please send me email. Thanks.

-hp

 
 
 

thanks for FAQ -- so objC is lousy?

Post by Mark C. Carro » Tue, 05 May 1992 06:09:16



>I only subscribed to this group 2 days ago, so I was luck to see the
>posting of the FAQ.  It answered an important question for me, which I
>list below to provoke discussion.  I do this because, until I read the
>FAQ, I thought a NeXT might be nice to have.  But if programming in
>NeXT is "best" using objective C (which it must be, if NeXT encourages
>it), and if programming my science is worse in objective C than in
>C++, then NeXT won't help me.

>  Q: Is objective C useful for my work?

>  A: No, since it does no operator overloading.  The best thing about
>     these new variants of C is operator overloading, as far as I can
>     see.  I like the idea that I can define a class to store my data,
>     and within it define how to add data-sets, or input/output data
>     sets, using the same notation for my data as for an int.  If I
>     have to do these things with function calls, then I'm back to the
>     old C (or even FORTRAN) philosophy, and I'm not willing to dig
>     that far back into the past.

Objective-C is standard-C with message passing Object-orientation
layed over the top. What that means is: outside of the main
objective-C constructs, code is absolutely standard ANSI-C.

The main objective-C construct is message passing. You define a class
and the operations that exist for the class. Then you call those
operations using message passing. The message pass is a syntactic
construct in objective-C. Within a message pass, the system is fully
dynamically bound - moreso than in C++.

Outside of the message pass, code is absolutely standard C. Nothing
about the semantics of any C construct is changed.

So you don't have operator overloading - the arithmetic operators are
a standard C construct outside of a message pass. But it doesn't make
any difference.

Operator overloading is a nifty syntactic construct. To get it, you
change the meaning of an operator. You said that x + y is really just
synactic sugar for the call

        operator+(x,y)

and then since functions are overloaded by operand type, the meaning of
operators can be changed. You have _no_ increase in power by allowing
operator overloading - there is no semantic difference in C++ between
        x + y * z
and
        operator+(x,operator*(y,z)).

In objective-C, you don't use function calls or operators in the sense
of C++. You never write x+y when x and y are members of a class that
you've defined. You write message passes:
        [x plus: y]
        [x plus: [y times: z]]

Sure, it's a bit wordier. But I don't believe that typing an extra
couple of letters is so significant that it makes a language useless.
The full dynamic nature of C++ is a HUGE advantage over C++.
Objective-C has a _much_ cleaner object model than C++. And the fact
that friend functions aren't necessary in Objective-C is a BIG win.

And once the NeXT Objective-C compiler implements protocols,
Objective-C will have all of the advantages of the multiply inherited
mess of C++ without the mess.

Note: I don't necessarily mean to flame the hell of out C++. It's a
useful language for many purposes. There are places where I choose C++
over Objective-C. C++ is a fine low-level language - and for low level
work I'd choose it every time. But in the domain of Objective-C - high
level applications programming - Objective-C is a far better language.
And overall, it's semantically cleaner and much more elegant. I just
can't stand to see some ignorant twit who's jumped on the C++
bandwagon badmouth the language so stupidly. :-)

        <MC>

--
[ Mark Craig Carroll <MC> ] You say you know no tricks, have no talents -
[ U of Delaware, CIS Dept ] Isn't everyone supposed to have their own?
[ Grad Student/Lab Hacker ] Yes, but few are obvious. Few draw notice to those

 
 
 

thanks for FAQ -- so objC is lousy?

Post by <M.. » Tue, 05 May 1992 08:43:06



Carroll) says:

Quote:>The full dynamic nature of C++ is a HUGE advantage over C++.

                            ***

                     I think he meant ObjC here. 8-)

 
 
 

thanks for FAQ -- so objC is lousy?

Post by mich.. » Tue, 05 May 1992 22:17:24



>  Q: Is objective C useful for my work?

>  A: No, since it does no operator overloading.  The best thing about
>     these new variants of C is operator overloading, as far as I can
>     see.  I like the idea that I can define a class to store my data,
>     and within it define how to add data-sets, or input/output data
>     sets, using the same notation for my data as for an int.  If I
>     have to do these things with function calls, then I'm back to the
>     old C (or even FORTRAN) philosophy, and I'm not willing to dig
>     that far back into the past.

I agree, we should see operator overloading in Obj-C.  So far, for my purposes, however, Obj-C has been superior to C and C++, so I will continue to put up with what I believe to be a serious shortcoming in the language, and continue to pray to the software gods that it will eventually be fixed. :-)

Michael
--
Michael Pizolato

Sometimes yer the windshield...

 
 
 

thanks for FAQ -- so objC is lousy?

Post by mo.. » Wed, 06 May 1992 01:43:18



writes:


> >I only subscribed to this group 2 days ago, so I was luck to see the
> >posting of the FAQ.  It answered an important question for me, which I
> >list below to provoke discussion.  I do this because, until I read the
> >FAQ, I thought a NeXT might be nice to have.  But if programming in
> >NeXT is "best" using objective C (which it must be, if NeXT encourages
> >it), and if programming my science is worse in objective C than in
> >C++, then NeXT won't help me.

>    NeXTstep itself is in Objective, and you'll have to use Objective
> dispatch to get to it.  But, that doesn't mean you can't use C++.  In
> fact, you can do all of your app. in C++ but use Objective wrappers to
> talk to NeXTstep.  This would allow using all of the nifty (and often-
> abused) aspects of C++ to do your computational work (for an example of
> this, take a look at Next's Calculator Lab from the Developer's demos).
> Oh, and it all compiles with the SAME compiler (g++).

Not quite.  gcc is used for Objective C and straight C, g++ is used for C++.  
The reason for this is that g++ will not work as a straight C compiler.  One of  
the drawbacks of C++ is that straight C causes problems.

--

Cubist                          |       makes me a NeXT programmer
Software Ventures               |       maker of MicroPhone II
#include <std.disclaimer>

 
 
 

thanks for FAQ -- so objC is lousy?

Post by Royce Howla » Wed, 06 May 1992 11:35:18




>says:
>>  [something to which Howard is not responding :~)]
>Hi,
>Does anyone know where I can find an article that compares and contrasts C++
>with Objective C? I would like to learn more about the differences and the
>similarities between the two languages and would appreciate it greatly if
>someone could send me information on this topic. Thank you.
>Also, does anyone know if there are any journals dedicated to Objective C and
>if there are any archives on the INTERNET that holds Objective C classes?
>Please send me email. Thanks.

This may be of general interest, so I'm posting instead of mailing.  For
an intro to the topic of OOP as well as a comparison of C++ and Objective
C (and Smalltalk and Object Pascal), check out "An Introduction to
Object-Oriented Programming" by Timothy Budd.  Published by Addison-
Wesley, ISBN 0-201-54709-0.  The edition I have says "Reprinted with
corrections April, 1991".
--
Royce Howland   --   Everything is IMHO   |  "I can eat enormous quantities