Re: If Object-C is "the" language, then why is no one using it?
Re: If Object-C is "the" language, then why is no one using it?
- Subject: Re: If Object-C is "the" language, then why is no one using it?
- From: Graham Lee <email@hidden>
- Date: Sun, 17 Nov 2002 11:43:59 +0000
Niels Peter Strandberg wrote:
Im not trying to tell you anything about Object-C. because im just
learning it.
Same here :-)
In my lack of knowledge, please allow me to ask this question! If
Object-C is "the" language, then why is no one using it? (compared to
java, c, c++ - object-c is not used in large numbers)
It's used a fair old bit in the GNU world. BTW your argument about ObjC
being used less than C is a bit flaky, gievn that C is a valid subset of
ObjC :-). Anyway, it's all horses for courses really - people (usually)
use whatever language is best suited to the task in hand. Java and C++
are very popular because they've been heavily pushed by Sun on the one
hand and Borland/MS on the other. People use all sorts of silly (no
flame war intended) languages - RMS makes FSF scripters use Guile, emacs
programmers use Lisp, etc. People use Python, Perl, Ruby, Modula-2,
Haskell, Z, Pascal, Fortan, Cobol....on the face of it ObjC actually has
a *huge* user base given that an entire open API spec (OpenStep) is
based on it, and this is used by arguably the largest desktop Unix OS in
the world.
What that tells me is that Object-C is only alive because of Apple! And
Apple seams to abandon it in favor for Java.
Apple didn't, AFAICT, abandon ObjC for Java. When they bought NeXT in
1997, it became clear that Apple's NeXT OS (sorry!) would be based on
OpenStep. At the time Java was a huge buzzword, everyone wanted to
program in Java[1]. So Apple put a number of engineers onto writing a
bridge between the Java and ObjC APIs. It's very slow (partly because
Java is byte-compiled, but also because although Apple were very clever
in creating this bridge, it necessarily creates a performance hit), and
almost all texts I've seen on Cocoa programming (including
Garfinkel+Mahoney, Hillegass, Feiler, the Apple techpubs website)
mention Java as an afterthought. Hillegass goes as far as to deprecate
use of Java in a Cocoa app. Interestingly you can create a Cocoa
framework for essentially any language you want - AFAIK there's one
available for Python in the official distro. But ObjC is the language
it all runs on in the end, and the language it's best to use *in this
environment*.
Objective-C is, IMHO, still alive because the FSF managed to pull a huge
coup in getting NeXT to agree to using the GCC in NeXTStep. So there's
been a free implementation of ObjC almost since Cox first published his
book.
[1]Historical footnote: At this point, what we now call Mac OS X was
known as Rhapsody. Because of the success of Java/C++, Apple tried to
re-engineer the syntax of ObjC to look like C++ (so [[GLObject alloc]
init]; looks like (GLObject.alloc).init;). Have you ever seen any
ObjC++? Can you imagine what *that* looks like in "modern syntax" ObjC?
:-) Also, at this point, Rhapsody was still being joint-developed on
x86, M68k and PPC.
I love the Java language, but I hate the speed of the VM, and the lack
of a strong native GUI support + other stuff.
I think you're confusing the API with the language here (correct me if
I'm wrong). It's possible to use a NSMenu from within a Cocoa-Java
application, and then you get true native GUI. You could also use
javax.swing components, then you'd get the Java implementation of the
GUI. BTW you could probably also write an ObjC program that sends a
call off to a java program for the GUI - don't ask why, but you could.
Im not a .NET fan (and im not going to use it), but MS is doing things
with C# that Sun should have done with Java.
What, you mean like imitating Java? Sun couldn't have done that :-)
Maybe if Apple made cocoa work on Windows, Object-C would bloom.
Try and find (if you can) some software called "Yellow Box". This does
what you want. However, if Apple were to actively support all their OS
X software (or even bits of it) on Windows, many (more) people would see
no reason to pay #2000 for a PowerMac when they could pay #500 for a PC
that runs the same development environment/software/OS/whatever reason
they want to give. Given that Apple make *all* of their money from
hardware sales, this probably would not suit them at all.
Why not do like GCJ, Do your programming in Java, and skip the VM, and
compile to native ppc, using the cocoa framework?
Because then your program isn't genuine Java, and if Sun do something
strange with their API/VM/language/whatever, then your code no longer
acts as defined in the language spec. Which is bad.
Just some thoughts!
Same here! :-)
All the best,
GL
--
Graham Lee, Wadham College, OX1 3PN.
Please send any attached documents as PDF, PostScript, HTML, RTF or
(better) plain text. If you send me a PowerPoint presentation I won't
read it. I will send you a reply on a Z88 EPROM card.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.