Re: Obj-C vs Java
Re: Obj-C vs Java
- Subject: Re: Obj-C vs Java
- From: Bernard van Gastel <email@hidden>
- Date: Mon, 23 Jul 2001 23:29:11 +0200
Thanks. I wasn't aware of the static issue when subclassing (though I
have 2 years Java experience, guess I have never run into it). I am a
bit confussed about class methods. What is the diffenence with static
Java methods (not counting the subclassing issue)?
I have a cool Java networking app (ok, I think it's cool), and I can
convert the networking code to Obj-C for peformance (because of the
superior peformance) and the rest of the app in Java for compatiblity
and easy development (only have to write code once).
Bernard
Op maandag 23 juli 2001 om 23:18 schreef Enrique Zamudio:
- is Obj-C a better OO language than Java?
I would say Definitely!
- which language is more powerful?
ObjC
- which language is faster to develop? (Java, because of less
debugging with memory leaks???)
well, maybe there are less memory leaks, but in my experience you end up
writing more code in Java than inObjC.
- what are the special down sides of Java and Obj-C?
downsides of Java:
- you can't send messages to null (this raises an exception)
- There is no abstract object type (like the id type in ObjC)
- because of the previous point, you have to do a lot of type casting.
- inheritance is kind of weird (there are no class methods; only static
methods but since they're static, subclasses don't inherit them).
- slow because of the byte-code and the VM (although I think there are
workarounds for this)
- compiles a lot slower than ObjC.
downsides of ObjC:
- not portable (the source may be portable but you have to recompile in
every platform you want to run your apps)
- you have to be more careful with memory management (releasing,
autoreleasing, etc)
- you have to be careful on the use of id's (you might point a variable
to an object of the wrong class sometimes, or send it a message that it
won't really respond to and the compiler will not tell you anything if
another object responds to it).
- not so many object libraries as Java has.
I think that the best thing you can do is give ObjC a try and see if you
like it more than Java (or if you NEED to use it, because of some
performance issue or something).
Hope this helps,
eZL
Bernard van Gastel
- - - - -
"Nuclear weapons can wipe out life on Earth, if used properly."
-David Byrne