The future of objective-C

84 views
Skip to first unread message

Jamie Curmi

unread,
Feb 20, 2001, 5:35:40 AM2/20/01
to
Hi All,

I've only just discovered Objective-C -playing with MacOSX basically. So
I've been doing a bit of research and it seems quite nifty (though the
syntax is kind of strange).

Now, I'm not trolling, I'm seriously wondering what the future holds for
Objective-C. Clearly NeXT has done some amazing things with it, and I'm
sure others have. Do you guys see a future for it beyond the niche that it
currently has? Is there a possibility Apple could do something with it
making it a Java alternative on all platforms (make the syntax more like
C++/java, but make it compiled not interpreted, perhaps)?

I've read some people are worried because WebObjects will soon be (if not
already?) working with Java, and Apple may be concentrating on the Java side
of web objects as that is the current flavour of the month.

I'd love to hear everyone's thoughts on this. What does the future hold?

Jamie

mike burrell

unread,
Feb 20, 2001, 10:20:31 AM2/20/01
to
Jamie Curmi <jcu...@bigpond.net.au> wrote:
> Now, I'm not trolling, I'm seriously wondering what the future holds for
> Objective-C. Clearly NeXT has done some amazing things with it, and I'm
> sure others have. Do you guys see a future for it beyond the niche that it
> currently has? Is there a possibility Apple could do something with it
> making it a Java alternative on all platforms (make the syntax more like
> C++/java, but make it compiled not interpreted, perhaps)?

i doubt that Apple will kill off Objective C development entirely. they
have a lot of legacy code written for it. plus, it's a good language :)

> I've read some people are worried because WebObjects will soon be (if not
> already?) working with Java, and Apple may be concentrating on the Java side
> of web objects as that is the current flavour of the month.

if i were Apple, i'd be looking at getting Java and Objective C talking
together. Java has its RMI; Foundation has its NSDistributedObject; then
there are RPC, CORBA, etc. they're all fairly similar, though.

> I'd love to hear everyone's thoughts on this. What does the future hold?

Objective C has a life outside of Apple/NeXT. if Apple were to abandon it,
the developer pool might get cut in half, which would suck, but wouldn't do
too much to halt the progression of Objective C in general.

--
/"\ m i k e b u r r e l l
\ / ASCII RIBBON CAMPAIGN mik...@home.com
X AGAINST HTML MAIL,
/ \ AND NEWS TOO, dammit finger mik...@mikpos.dyndns.org for GPG key

John C. Randolph

unread,
Feb 20, 2001, 10:24:44 AM2/20/01
to

Jamie Curmi wrote:
>
> Hi All,
>
> I've only just discovered Objective-C -playing with MacOSX basically. So
> I've been doing a bit of research and it seems quite nifty (though the
> syntax is kind of strange).
>
> Now, I'm not trolling, I'm seriously wondering what the future holds for
> Objective-C. Clearly NeXT has done some amazing things with it, and I'm
> sure others have. Do you guys see a future for it beyond the niche that it
> currently has?

Well, with Mac OS X server alone the number of Obj-C developers took a major
leap. If you take a look at the lists that Omni maintains, you'll see more
new Obj-C developers than anytime in the last ten years.

>Is there a possibility Apple could do something with it
> making it a Java alternative on all platforms (make the syntax more like
> C++/java, but make it compiled not interpreted, perhaps)?

Not likely. Apple floated the idea of a new syntax for Obj-C that
looked like
Java, and we made sure that the so-called "modern syntax" got put up against
the wall and shot through the head.

As for the cross-platform capabilities that Apple's pissing away, I suspect
that some kind of backroom deal with Sun and/or MicroSquish will prevent Apple
from ever shipping Cocoa for windoze (as they promised at THREE consecutive
Worldwide Developer Conferences.)

> I've read some people are worried because WebObjects will soon be (if not
> already?) working with Java, and Apple may be concentrating on the Java side
> of web objects as that is the current flavour of the month.

Web Objects is a lost cause. The much more important issue is the preservation
of an Objective-C Enterprise Objects Framework.

> I'd love to hear everyone's thoughts on this. What does the future hold?

I see Obj-C becoming the language of choice for Macintosh development,
and
possibly for GUI apps on Linux when GNUStep nears completion.

-jcr

Frederic Stark

unread,
Feb 20, 2001, 12:48:37 PM2/20/01
to
Jamie Curmi wrote:

> Hi All,
>
> I've only just discovered Objective-C -playing with MacOSX basically. So
> I've been doing a bit of research and it seems quite nifty (though the
> syntax is kind of strange).

Huh ? You means it lacks goodies like:

A::B C::D<T0<T1> >() { return 42; }

or

return new MyClass { int f() { return 42; } };

Don't say the syntax is strange. Says that it is a new syntax for you.

> Now, I'm not trolling, I'm seriously wondering what the future holds for
> Objective-C.

Furture of objc is much better shaped now than 2 years ago, when apple wanted to kill it.

> Clearly NeXT has done some amazing things with it, and I'm
> sure others have. Do you guys see a future for it beyond the niche that it
> currently has? Is there a possibility Apple could do something with it
> making it a Java alternative on all platforms (make the syntax more like
> C++/java, but make it compiled not interpreted, perhaps)?

It doesn't make sense. Why do you want to change objc syntax ? And, IIRC, compiled compiled java exists too.
Btw, neither objc nor java are interpreted, so I have trouble understanding you.

Anyway, you should ask directly apple about what they plan to do. (I can give you a slight info anyway, they probably don't know. And even if they know, they'll probably do something else anyway)

> I've read some people are worried because WebObjects will soon be (if not
> already?) working with Java,

WebObjects always worked with java. In fact you can mix/match objc and java with apple run-time. Now, WO5 will be a java-only product, but the relationship between WebObjects and objc is really thin.

[crunch];

> I'd love to hear everyone's thoughts on this. What does the future hold?

We'll see. Thanks god, there is place for more than one language.

Cheers,

--fred

Doc O'Leary

unread,
Feb 20, 2001, 6:53:40 PM2/20/01
to
In article <B6B891F5.466%jcu...@bigpond.net.au>, Jamie Curmi
<jcu...@bigpond.net.au> wrote:

> I've only just discovered Objective-C -playing with MacOSX basically. So
> I've been doing a bit of research and it seems quite nifty (though the
> syntax is kind of strange).

Embrace the oddity. You'll come to question why other languages use
such an anemic syntax.

> Now, I'm not trolling, I'm seriously wondering what the future holds for
> Objective-C.

I'm not sure what you mean. I'll use it to implement a solution when
it makes sense to do so, and I'll use other languages when they seem
appropriate. Unlike Sun, I can't control market forces, so it doesn't
worry me in the least that ObjC is being jammed down everyone's throat.
I have a technical need, not a marketing need.

> Is there a possibility Apple could do something with it
> making it a Java alternative on all platforms (make the syntax more like
> C++/java, but make it compiled not interpreted, perhaps)?

As has been pointed out by others, a Java-style syntax for ObjC has
been proposed, judged lacking, and discarded. If you want Java, use
Java. If the Java object system does not meet your needs, prepare to
learn a little new syntax to access the features of a different object
system.

> I've read some people are worried because WebObjects will soon be (if not
> already?) working with Java, and Apple may be concentrating on the Java side
> of web objects as that is the current flavour of the month.

It's not just "working with Java" that concerns me; WebObjects has done
that for some time. It's the "requiring Java" that irks most (I've
ranted myself on the Subsume corporate site). It means that I can't
reuse the business objects I create for my regular apps (I am *not*
going to use Java to write a desktop app; even something simple like
TextEdit blew as a Java app!) in building a web site. That's a big
miss, and if Apple ever completely drops ObjC support from WebObjects
I'm quite certain they'll find more people flocking to GNUstep Web
rather than porting perfectly good code to Java, and paying Apple for
the privledge.

John C. Randolph

unread,
Feb 21, 2001, 9:32:14 PM2/21/01
to

Frederic Stark wrote:
>

> Furture of objc is much better shaped now than 2 years ago, when apple wanted to kill it.

That was before NeXT had consolidated its takeover of Apple.

-jcr

Stan Shebs

unread,
Feb 26, 2001, 12:31:31 AM2/26/01
to John C. Randolph
"John C. Randolph" wrote:
>
> >Is there a possibility Apple could do something with it
> > making it a Java alternative on all platforms (make the syntax more like
> > C++/java, but make it compiled not interpreted, perhaps)?
>
> Not likely. Apple floated the idea of a new syntax for Obj-C that
> looked like
> Java, and we made sure that the so-called "modern syntax" got put up against
> the wall and shot through the head.

It's not quite dead yet! - try cc -fmodern-objc-syntax on your OS X
system. But we're definitely not moving those patches to the
GCC 3.0-based compiler that's in the works.

Stan Shebs
sh...@apple.com

John C. Randolph

unread,
Feb 26, 2001, 3:32:49 AM2/26/01
to

Glad to hear it.

-jcr

David Stes

unread,
Feb 26, 2001, 4:16:52 AM2/26/01
to

On Mon, 26 Feb 2001, John C. Randolph wrote:

> > > Not likely. Apple floated the idea of a new syntax for Obj-C that
> > > looked like
> > > Java, and we made sure that the so-called "modern syntax" got put up against
> > > the wall and shot through the head.
> >
> > It's not quite dead yet! - try cc -fmodern-objc-syntax on your OS X
> > system.
>

> Glad to hear it.

Is this truly what we want ? I could accept the idea of an alternative
syntax, but why then has it be called "modern objc syntax" ?

The name "java style objc syntax" would be more appropriate.

John C. Randolph

unread,
Feb 26, 2001, 4:40:16 AM2/26/01
to

Who cares? It's going away, and good riddance.

-jcr

Stephen Peters

unread,
Feb 26, 2001, 8:00:16 AM2/26/01
to
"John C. Randolph" <j...@idiom.com> writes:

> > > > It's not quite dead yet! - try cc -fmodern-objc-syntax on your OS X
> > > > system.
> > >
> > > Glad to hear it.
> >

> > Is this truly what we want ? [...]

> Who cares? It's going away, and good riddance.

Ah, John -- you missed David's clever attempt to make you look like
you wanted the `modern' syntax. Note that he removed Stan's note that
he wasn't moving it into GCC 3.0, thus making it look like you were
pleased about the syntax, not about its death.

Sometimes David can be a real wanker. :-)

--
Stephen L. Peters por...@portnoy.org
PGP fingerprint: A1BF 5A81 03E7 47CE 71E0 3BD4 8DA6 9268 5BB6 4BBE
"Poodle: The other white meat." -- Sherman, Sherman's Lagoon

David Stes

unread,
Feb 26, 2001, 8:34:58 AM2/26/01
to
Stephen Peters wrote:
>
> > Who cares? It's going away, and good riddance.
>
> Ah, John -- you missed David's clever attempt to make you look like
> you wanted the `modern' syntax.

You still write `modern'.

I'd greatly prefer you'd say 'java-style syntax'.

I've seen over the last 15 years various attempts of NeXT (and now
Apple) to fuck up Objective-C and it usually always starts with "the old
way doing such of such" and the 'new modern way is tit or tat'.

John C. Randolph

unread,
Feb 26, 2001, 6:26:55 PM2/26/01
to

David,

Get some competent professional help.

-jcr

David Stes

unread,
Feb 27, 2001, 3:33:25 AM2/27/01
to
"John C. Randolph" wrote:
>
> David,
>
> Get some competent professional help.


You can't get the words the 'obsolete syntax from the old Apple
compiler' over your lips, can you :-)

Stephen Peters

unread,
Feb 27, 2001, 4:15:39 AM2/27/01
to
David Stes <st...@pandora.be> writes:

> Stephen Peters wrote:
> >
> > Ah, John -- you missed David's clever attempt to make you look like
> > you wanted the `modern' syntax.
>
> You still write `modern'.

Yes, and I also put it in quotes. You might have noticed that some
people use quotes when they're directly copying text from somewhere
else -- such as the compiler flag being used by Apple.

> I'd greatly prefer you'd say 'java-style syntax'.

Well, we all have our crosses to bear. For example, I'd greatly
prefer that you not selectively edit other people's statements in an
effort to mislead readers. Apparently, I'm doomed to disappointment.

David Stes

unread,
Feb 27, 2001, 4:29:41 AM2/27/01
to
Stephen Peters wrote:
>
> For example, I'd greatly
> prefer that you not selectively edit other people's statements in an
> effort to mislead readers.


If there's any attempt to mislead people then it is by using words such
as 'modern'.

'modern' is a trick used by salespeople and marketing departements in an
effort to depict the people who 'still' use the 'old' way as 'obsolete'.

Michael Ash

unread,
Feb 27, 2001, 6:00:48 PM2/27/01
to
In article <3A9BC9F9...@pandora.be>, David Stes <st...@pandora.be>
wrote:

>Michael Ash wrote:
>>
>> The "obsolete syntax from the old Apple compiler" is activated using a
>> flag that contains the word "modern".
>
>Actually the modern syntax is the [] syntax.
>
>The bracket syntax is "modern" and the syntax that Apple proposed to
>replace the [] syntax is "obsolete".

Yes, we all know that, David. I think everybody realizes that we all
know that except you, as well.

Nobody is claiming that Apple's syntax is good or modern or anything
like that. The only thing we're claiming is that the compiler flag that
you use to turn it on contains the character string "modern". Do you
refute that?

>If Apple has some code that is still using their obsolete Java-style
>syntax, then they should convert it to the modern [] syntax

Given that it never caught on, I'd be surprised if they had any.

--
"From now on, we live in a world where man has walked on the moon.
And it's not a miracle, we just decided to go." -- Jim Lovell

Mike Ash - <http://www.mikeash.com/>, <mailto:ma...@mikeash.com>

David Stes

unread,
Feb 27, 2001, 6:22:41 PM2/27/01
to

On Tue, 27 Feb 2001, Michael Ash wrote:

> Nobody is claiming that Apple's syntax is good or modern or anything
> like that. The only thing we're claiming is that the compiler flag that
> you use to turn it on contains the character string "modern". Do you
> refute that?

If the compiler flag contains the character string "modern" then that
implies that Apple is trying to call it modern.

Hence : Apple considers [ myObject foo ] the "old" syntax

Hence : Apple considers myObject.foo() the "modern" or "future" syntax.


Donald A. Yacktman

unread,
Feb 27, 2001, 7:15:28 PM2/27/01
to
David Stes <st...@pandora.be> wrote:
>
>On Tue, 27 Feb 2001, Michael Ash wrote:
>
>> Nobody is claiming that Apple's syntax is good or modern or anything
>> like that. The only thing we're claiming is that the compiler flag that
>> you use to turn it on contains the character string "modern". Do you
>> refute that?
>
>If the compiler flag contains the character string "modern" then that
>implies that Apple is trying to call it modern.
>
>Hence : Apple considers [ myObject foo ] the "old" syntax

Actually, Apple calls it "classic" syntax.

>Hence : Apple considers myObject.foo() the "modern" or "future" syntax.

They have never called it "future", though they do call it "modern".

From Webster's Dictionary:

1mod*ern \'ma¨d-ern, ‹'ma¨d-(e-)ren\ adj

1a: of, relating to, or characteristic of a period extending
from a relevant remote past to the present time

b: of, relating to, or characteristic of the present or the
immediate past: CONTEMPORARY

2: involving recent techniques, methods, or ideas: UP-TO-DATE

3 cap: of, relating to, or having the characteristics of
the present or most recent period of development of a
language syn see NEW

I believe that this is the third definition in which they mean "modern" -- it
is a newer syntax, and was certainly developed more recently than "classic"
syntax. So calling it modern is certainly reasonable by that definition.

However, the name was invented by the marketing people as opposed to the
technical people and was obviously intended to have a more subtle effect.
Accuracy is never the top priority of marketers in my experience. I suspect
that they either wanted to get people to think that "classic" syntax is bad
and for old farts only in the hopes they could bury it forever or they wanted
the ones clamoring for Java to feel comfortable that this "new" syntax would
be around for a long time to assuage their fears of what they considered to
be a bizarre-looking syntax. Either way, I thought it a terribly stupid move
and I've always hated the name.

Frankly, though, I don't give a damn what Apple calls their new syntax. I,
and many other Apple developers, inissist upon and will continue to call it
for what it is: bulls*** syntax.

And I'm glad to hear that it is going to go away. As JCR says, GOOD
RIDDANCE. I won't miss it, and I can't imagine that anyone will.

Oh, and on the flipside, given how "modern" is an accurate name for this
syntax, I propose that we pull the same stunt in reverse. Let's make a
preprocessor that lets us write Java code using an Objective-C like syntax.
We can call it the "Modern Java Syntax". Then maybe I'd be more willing to
write Java code when occasion forces me, kicking and screaming, to do so.

Well, I like the idea anyway...

--
Later,
Don Yacktman
d...@misckit.com

Michael Ash

unread,
Feb 27, 2001, 9:49:18 PM2/27/01
to
In article <Pine.LNX.4.20.0102280013290.15695-100000@newt>, David Stes
<st...@pandora.be> wrote:

>On Tue, 27 Feb 2001, Michael Ash wrote:
>
>> Nobody is claiming that Apple's syntax is good or modern or anything
>> like that. The only thing we're claiming is that the compiler flag that
>> you use to turn it on contains the character string "modern". Do you
>> refute that?
>
>If the compiler flag contains the character string "modern" then that
>implies that Apple is trying to call it modern.

It implies that Apple *was* trying to call it modern. The name is
obviously a legacy holdover. As evidence for this view, I submit firstly
that nobody uses it, and secondly that it will be gone in the next
compiler release.

They screwed up. They realized it. They're ditching it. Get over it.

Martin Klocke

unread,
Feb 28, 2001, 2:59:57 AM2/28/01
to
Hi David,

David Stes schrieb:
>
> Martin Klocke wrote:
> >
> > What's that stuff you're inhaling/smoking/smelling/injecting?
>
> It's called "common sense" and you could use some portion of it too.

Yeah, that's why my unbelievably strong common sense told me to post the
recommendation on the Watzlawick book.
It's excellent!

Martin

P.S: It's not about who did what+ when.
It's just that all the people say "look, it's good that noone uses that
crappy syntax-proposal by Apple", and you keep going on why they dare to
call it modern.
Wow
That's what I call "The pursuit of unhappiness"

Stan Shebs

unread,
Mar 1, 2001, 10:15:46 AM3/1/01
to
Michael Ash wrote:
>
> >If Apple has some code that is still using their obsolete Java-style
> >syntax, then they should convert it to the modern [] syntax
>
> Given that it never caught on, I'd be surprised if they had any.

There is none. In fact, when I turned it up in my audit of Apple's
compiler patches, the original author of those changes was astonished
to see it in there - he thought that it had never been incorporated.
(The work had been done under contract.)

Stan Shebs
sh...@apple.com

Petteri Kamppuri

unread,
Mar 2, 2001, 9:44:03 AM3/2/01
to
Hi!

I'm new to this group and ObjC. I really want to learn ObjC and do some
serious programming with it when Mac OS X ships.

Doc O'Leary wrote:

> As has been pointed out by others, a Java-style syntax for ObjC has
> been proposed, judged lacking, and discarded.

I read through this whole thread, but found no comment on _what_ is
lacking in the new or "modern" or what ever syntax. Why do you think it
is bad?

Why does the messaging syntax be so different from calling functions (in
plain C) when they're essentially the same thing?

What is the benefit in writing [foo bar] instead of foo.bar()? Would the
current [foo bar] way still be better, even if you wouldn't have to care
about millions of lines of existing code and stuff like that?

--
petteri
mailto:petteri....@helsinki.fi
http://www.helsinki.fi/~pkamppur/

David Stes

unread,
Mar 2, 2001, 10:05:41 AM3/2/01
to
Petteri Kamppuri wrote:
>
> I'm new to this group and ObjC. I really want to learn ObjC and do some
> serious programming with it when Mac OS X ships.

You can already get some idea of the Objective-C language.

There is a compiler for Macintosh at :

http://users.pandora.be/stes/compiler.html

This is an Objective-C compiler for Macintosh System 7-8.

> I read through this whole thread, but found no comment on _what_ is
> lacking in the new or "modern" or what ever syntax. Why do you think it
> is bad?
>
> Why does the messaging syntax be so different from calling functions (in
> plain C) when they're essentially the same thing?
>
> What is the benefit in writing [foo bar] instead of foo.bar()? Would the
> current [foo bar] way still be better, even if you wouldn't have to care
> about millions of lines of existing code and stuff like that?


Perhaps you are right. However if you make such a fundamental change,
you can simply give the new language a new name.

In fact, perhaps you are interested in TOM. TOM is a language that
makes serious changes compared to Objective-C ... and consistently with
that fact, the language was given a new name.

Stan Shebs

unread,
Mar 2, 2001, 11:55:28 AM3/2/01
to
Petteri Kamppuri wrote:
>
> Doc O'Leary wrote:
>
> > As has been pointed out by others, a Java-style syntax for ObjC has
> > been proposed, judged lacking, and discarded.
>
> I read through this whole thread, but found no comment on _what_ is
> lacking in the new or "modern" or what ever syntax. Why do you think it
> is bad?

It's not so much that it's "bad", but that it's "different". It would
be like saying to C programmers that "=" and "==" were stupid choices,
and that assignment should be ":=" and equality should be "=". Such a
change could actually be made to work in a C compiler, but the cost to
programmers would be monumental, and the benefit negligible. Then
imagine the even greater confusion that would reign if the alternate
syntax were controlled by a -f flag to the compiler...

I wasn't around when Apple made the boneheaded decision to try to
introduce a new syntax, but believe me, I don't miss an opportunity
to ridicule it anyway. Experience shows that there are just some
things you can't change about a programming language once you've
started down the path; the people in charge were intelligent and
should have known that. My guess is that it happened at a low
point in Apple's fortunes, and was thus motivated by a sense of
desperation. It's a good lesson; when designing languages, do the
right thing, don't try to pander to the audience.

Stan Shebs
sh...@apple.com

Donald A. Yacktman

unread,
Mar 2, 2001, 12:02:35 PM3/2/01
to
Petteri Kamppuri <petteri....@helsinki.fi> wrote:
>Doc O'Leary wrote:
>> As has been pointed out by others, a Java-style syntax for ObjC has
>> been proposed, judged lacking, and discarded.
>
>I read through this whole thread, but found no comment on _what_ is
>lacking in the new or "modern" or what ever syntax. Why do you think it
>is bad?

Lots and lots... I'll get to that in a minute. ;-)

>Why does the messaging syntax be so different from calling functions (in
>plain C) when they're essentially the same thing?

They are NOT the same thing.

A message sent with [] is just that: a message. It is NOT a function call,
and if you view it as only a function call, then you are taking a narrow view
of what is happening and that will negatively impact the designs you produce.
You have to "unlearn" the bad habits you learned with C++ (and to a lesser
degree, Java) before you can take full advantage of the richness that
Objective-C can offer you.

To elaborate a bit on the message vs. function call thing a bit...

A message has a few key components to it:

1. receiver -- who gets the message
2. sender -- who sent the message
3. name -- the "selector" or method name
4. parameters
5. transport

Now, when you send a message, Objective-C chooses what code will be executed
based upon receiver and name components. However, because the messages can
be fully realized (ie, turned into actual objects) a lot about that message
suddenly becomes very indeterminant. For example, the object that actually
gets the message may not be the one to which you originally sent the message.
(Forwarding is one example. Proxy objects are a case where almost
_everything_ gets forwarded.)

It is even possible, like with NSProxy, to have objects which cause the
transport to be changed. Now, the _default_ transport is like a local
function call. But objects can alter that into remote function calls,
delayed function calls, or even trap a message and never send it, but instead
store it later for possible execution that may never happen (like for undo).

So when you send a message with [] you are doing something very different
than if you made a function call with ->(). The function call is immediate
and cannot be intercepted; that's the C semantic. Objective-C introduces a
type of call that is incredibly dynamic and flexible, and the [] syntax keeps
this fact in your mind clearly: they are two different beasts and should NOT
be notated the same way.

Note that with C++ they really are pretty much the same, so it's fine the way
it is there. With static binding, the semantic is just that of a function
call. But again, Objective-C's semantic is much more generalized, and the
syntax serves as a reminder.

>What is the benefit in writing [foo bar] instead of foo.bar()? Would the
>current [foo bar] way still be better, even if you wouldn't have to care
>about millions of lines of existing code and stuff like that?

That's a rather loaded question, and in the example you give above, there's
certainly no readability advantage, but remember that the underlying semantic
of an Objective-C message is different...reason enough to keep the [] syntax.

But there are yet some additional advantages to the Objective-C syntax beyond
just denoting a different underlying semantic. One is in code readability.
With well chosen method and variable names your code can read almost like
English sentences. Which of these would you prefer:

window = [[NSWindow alloc]
initWithContentRect:aRect
styleMask:(NSTitledWindowMask|NSResizableWindowMask)
backing:NSBackingStoreBuffered
defer:NO
screen:aScreen];

- or -

window = NSWindow.new(aRect, (NSTitledWindowMask|NSResizableWindowMask),
NSBackingStoreBuffered, NO, aScreen);

Well, the only advantage of the latter is how much typing you have to do.
But I've found that when I'm programming, only a small proportion of my time
is actually spent typing, and that other factors besides saving keystrokes
are far more important both short- and especially long- term. So I prefer
the former. Here are just some of the reasons why...

With the method name and parameters interleaved, it is easier to tell what
the parameters are for upon immediate inspection. Because it reads so
clearly, it becomes self documenting. If you return to this code a year from
now, or are debugging someone else's code you won't have to look up the docs
to see if the parameters are in the right order or to find out what they're
for. If you remember the method name, it already tells you what the
parameters are and what order they come in, so you have less to memorize when
learning the APIs.

This isn't even the best example in favor of Objective-C because all the
parameters are of a different type, so the compiler would still be of some
help in the ->() case. But if you had several parameters of identical
type...

Still, I think you can see why some of us strongly prefer this syntax. As a
further evidence of how this makes for readable, self documenting code when
you leverage it properly, let me offer a brief account of an experience I had
while in grad school.

We were assigned to write an optimizing compiler for a language we invented
in class, and it was supposed to do several optimizations, including some
global program optimizations. Realizing the magnitude of the project, I felt
that I would be able to better implement it in Objective-C; the rest of the
class used C or C++. So I forged ahead and finished it in about a week.

The code I created was clear in its intent, in part due to the Objective-C
language syntax as noted above, and in part because I was careful to choose
my method and variable names well. This clarity was of great assistance to
me whilst coding -- bugs and flaws in my reasoning were easy to spot as I
read back through my code.

The end result was that this clarity was greatly to my advantage. This was
the last assignment of the semester. We were given two weeks to complete it.
I finished in a week. Of a class of over thirty people, I was one of only
TWO to actually complete the assignment successfully and the other guy turned
his in a day late!

The TA, during grading, was also quite impressed with the language because
(a) he'd NEVER seen the language before (and never used Smalltalk) and (b) he
could understand the code completely, from just cursory inspection, even
though comments were sparse. That's something you rarely hear happening with
C and C++ code.

So when my company is developing software, I much prefer that we use
Objective-C over Java because I know that the guy who wrote something today
might not be the guy who needs to enhance or change it tomorrow. I want code
that is immediately accessible and easy to follow. Something that doesn't
require too much training. The language can be a tool to ease this into
happening; I find that Objective-C is so simple that I can spend my time
training my people in design principles and how to name methods and variables
effectively.

Objective-C doesn't guarantee that you'll get all these benefits, and you can
write crappy code in ANY language. It won't solve all your problems, and a
crappy design or a crappy job of naming things is crap in any language,
Objective-C included. (It's clarity makes it all the more obvious when code
is crap, though...) But if you want to be disciplined about it, Objective-C
makes it a little easier to succeed with the effort. And that is something
I've really come to appreciate.

The language is also not perfect, and could benefit from some minor
improvements -- but there's actually very little I'd consider worth changing.

So even though I've been spewing out some strong advocacy, let me temper it
with the disclaimers in the predeeding two paragraphs and further emphasize
that this is all my opinion. It has been built up over many years of
experience with many languages and quite a few code bases from the very small
to the very large, so for me it has a solid foundation. Your mileage, and
opinion, may vary quite a bit and that's quite understandable...but be sure
you give the Objective-C [] syntax a fair trial or you may miss out on what
has, for me at least, been a real gem.

David Stes

unread,
Mar 2, 2001, 12:12:00 PM3/2/01
to
Stan Shebs wrote:
>
. My guess is that it happened at a low
> point in Apple's fortunes, and was thus motivated by a sense of
> desperation.

Yeah, a desperate attempt to try to keep up an image of innovation.

They were trying to make it seem they had a clue about language and
compiler design.

We wouldn't easily believe this, but that's what they were trying to do
in their desperate situation.

Michael Ash

unread,
Mar 2, 2001, 5:32:44 PM3/2/01
to
In article <3A9FB18D...@helsinki.fi>, Petteri Kamppuri
<petteri....@helsinki.fi> wrote:

>I read through this whole thread, but found no comment on _what_ is
>lacking in the new or "modern" or what ever syntax. Why do you think it
>is bad?
>
>Why does the messaging syntax be so different from calling functions (in
>plain C) when they're essentially the same thing?
>
>What is the benefit in writing [foo bar] instead of foo.bar()? Would the
>current [foo bar] way still be better, even if you wouldn't have to care
>about millions of lines of existing code and stuff like that?

Sending a message and calling a function are radically different. They
may appear to end up doing the same thing, but the concepts aren't
nearly the same. When you call a function, you jump to a block of code,
giving that block certain parameters. You maybe get something back. When
you send a message, you're sending it to a specific object. You don't
know exactly what it will do, or where the code is, or anything like
that. Since ObjC messaging is highly dynamic, the method could come from
class A, class B, or class Z over here. The message could be captured,
sent across a network, evaluated a thousand miles away, and the result
returned to you.

A more practical reason is that parameter type and order is much easier
to see and remember in ObjC-style message syntax. Whenever I use C++
code, I'm constantly looking up the header file to see what order the
parameters are in. With ObjC, there's a big incentive to name your
messages so that the parameters are named in the message; if you know
the message, you know the parameters, and the order.

John C. Randolph

unread,
Mar 3, 2001, 10:36:10 AM3/3/01
to

David Stes wrote:
>
> Stan Shebs wrote:
> >
> . My guess is that it happened at a low
> > point in Apple's fortunes, and was thus motivated by a sense of
> > desperation.
>
> Yeah, a desperate attempt to try to keep up an image of innovation.

No, more like they were trying not to scare away all the C++ coders.

-jcr

Mathieu Chouinard

unread,
Mar 4, 2001, 6:45:46 PM3/4/01
to
David Stes wrote:

Please shut up.

Michael Hopkins

unread,
Mar 5, 2001, 6:14:13 PM3/5/01
to

I second that

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

_/_/_/ _/_/_/ _/_/_/ ACS Consultancy
_/ _/ _/ _/ _/
_/_/_/_/ _/ _/_/_/ Information Sciences for Industry
_/ _/ _/ _/
_/ _/ _/_/_/ _/_/_/ Telephone/Fax: 01732~463519 (UK)

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

`All models are wrong, but some are useful' - George Box

strobe anarkhos

unread,
Mar 11, 2001, 7:41:02 AM3/11/01
to
In article <3AA41DC6...@netmatters.co.uk>, Michael Hopkins <mhop...@netmatters.co.uk> wrote:

> Mathieu Chouinard wrote:
> >
> > David Stes wrote:
> >
> > >
> > > On Mon, 26 Feb 2001, John C. Randolph wrote:
> > >
> > >> > > Not likely. Apple floated the idea of a new syntax for Obj-C that
> > >> > > looked like
> > >> > > Java, and we made sure that the so-called "modern syntax" got put up
> > >> > > against the wall and shot through the head.
> > >> >
> > >> > It's not quite dead yet! - try cc -fmodern-objc-syntax on your OS X
> > >> > system.
> > >>
> > >> Glad to hear it.
> > >
> > > Is this truly what we want ? I could accept the idea of an alternative
> > > syntax, but why then has it be called "modern objc syntax" ?
> > >
> > > The name "java style objc syntax" would be more appropriate.
> > >
> > >
> > Please shut up.
>
> I second that
>

Third

Piercarlo Grandi

unread,
Apr 16, 2001, 5:10:20 PM4/16/01
to
>>> On Fri, 02 Mar 2001 22:32:44 GMT, Michael Ash <ma...@mikeash.com> said:

[ ... ]

I just noticed this oldish thread, and started to follow it, and then I
read a couple of bizarre claims including this one:

mail> Sending a message and calling a function are radically different.
mail> They may appear to end up doing the same thing, but the concepts
mail> aren't nearly the same. When you call a function, you jump to a
mail> block of code, giving that block certain parameters. You maybe get
mail> something back. When you send a message, you're sending it to a
mail> specific object. [ ... ]

This is a fairly good description of what happens in actor model
languages, e.g. PLANNER, or more recently Act++.

But Objective-C is not an actor model language; it is a traditional
imperative OO language, in which the above description makes no sense.

In Objective C something like '[thingie selector: arg]' is just a
dynamically selected function call, where the function is 'selector:' in
the class of 'thingie', and 'arg' is the argument list. No more, no
less.

This is a very common howler, which appears in many laughable textbooks
too; I think it is just very unfortunate that when Smalltalk-76 (the
language described in the classic Scientific American article) evolved
into Smalltalk-80 the actor model terminology was retained; Smalltalk-76
was in many ways an actor model language, Smalltalk-80 and languages
inspired by it like Objective-C are not. Smalltalk-80 was rather more
based on Interlisp and Simula-67 than PLANNER and the actor model.

The concept of function calling in Smalltalk-80 and Objective-C and C++
and practically every well known OO language around has nothing to do
with message sending semantics and has the same semantics as in any
language that supports 'virtual' (in the sense of Simula-67/C++)
function calls.

It is just traditional OO, nothing as fancy and obscure as actor model
semantics, where one sends messages to actor objects.

Erik M. Buck

unread,
Apr 16, 2001, 8:46:37 PM4/16/01
to
In C++ the "receiver" of a message must be known at compile time. In
Objective-C the receiver can NOT be known at compile time. This is a huge
distinction that eliminates the need for IDL, COM, SOM, and 90% of the pages
in the seminal "Design Patters Book". C++ is an abomination of a
language. The comments regarding Smalltalk/Objective-C not having a
messaging system are silly and only true if we accept the most restrictive
and ridiculous definition of messaging.


Michael Ash

unread,
Apr 16, 2001, 9:04:42 PM4/16/01
to
In article <yf3puec...@sabi.ClaraNET.co.UK>,
pg...@sabi.Clara.co.UK (Piercarlo Grandi) wrote:

>But Objective-C is not an actor model language; it is a traditional
>imperative OO language, in which the above description makes no sense.

I'm curious. I know basically nothing about this "actor model". What is
different in such a language compared to the semantics and so forth in
ObjC?

Marcel Weiher

unread,
Apr 17, 2001, 1:11:53 PM4/17/01
to
pg...@sabi.Clara.co.UK (Piercarlo Grandi) writes:

>The concept of function calling in Smalltalk-80 and Objective-C and C++
>and practically every well known OO language around has nothing to do
>with message sending semantics and has the same semantics as in any
>language that supports 'virtual' (in the sense of Simula-67/C++)
>function calls.

Not quite true. Apart from the issue of C++ receivers/methods having
to be known at compile-time, Objective-C retains enough information that
any message send can be captured and provided with as much fancy
semantics as you want. Optimizing for the commin case of a synchronous
message send within the same address space doesn't change the generic
nature of message sending.

Marcel
--

Java and C++ make you think that the new ideas are like the old ones.
Java is the most distressing thing to hit computing since MS-DOS.
- Alan Kay -

Steven D. Majewski

unread,
Apr 17, 2001, 1:51:39 PM4/17/01