• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Obj-C vs Java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj-C vs Java


  • Subject: Re: Obj-C vs Java
  • From: John Hörnkvist <email@hidden>
  • Date: Sun, 22 Jul 2001 13:48:14 +0200

On Sunday, July 22, 2001, at 11:35 AM, Bernard van Gastel wrote:

Hi

I was reading in the Java Dev List about Cocoa-Java development. Some people where very harsh on Java, while others on Obj-C. I don't know Obj-C (I have 2 years experience in Java) but I like to know the differences so I can make a balanced decision about the primary language I am going to use for OS X dev. I like the idea of Cocoa-Java though (because I have already Java experience).

- is Obj-C a better OO language than Java?

That depends on what you're trying to use it for. Objective-C is more dynamic than Java, which makes it even more object oriented.

Some think this is better, some beg to differ.

- which language is more powerful?

Objective-C allows you not only to extend, but also to amend. This makes some things easier to do in Objective-C.

For example, there was once a bug in the NSAffineTransform class; its invert method didn't invert the matrix. Since NSAffineTransform was an Objective-C class, it was trivial to make a category on it and override the faulty method.

Objective-C also includes all of C, allowing easy access to legacy code and libraries.

- which language is faster to develop? (Java, because of less debugging with memory leaks???)

Objective-C because of Categories? Or because Objective-C leads to faster Cocoa applications with a smaller memory footprint (no Java VM), so you don't have to spend time optimizing?

- what are the special down sides of Java and Obj-C?

Java: too strict.
Objective-C: too lenient.

The type system of Objective-C is "weak" enough that it allows you to do almost anything. This is great news for experienced and careful programmers, but can cause problems if you are a beginner.

(For any strongly typed static language, there will be correct programs that cannot be expressed in the type system. With a weakly typed language such programs will usually just generate warnings, not refuse to compile.)

I don't think either language is objectively better than the other. However, the frameworks were written in Objective-C, and most of the really experienced folks have far more experience with Objective-C/Cocoa than with Java/Cocoa. (The exception is some of the WebObjects developers.) Because of this, you'll most likely have an easier time getting Cocoa related help when using Objective-C.

Regards,
John Hornkvist

--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com


  • Follow-Ups:
    • Re: Obj-C vs Java
      • From: Chris Gehlker <email@hidden>
References: 
 >Obj-C vs Java (From: Bernard van Gastel <email@hidden>)

  • Prev by Date: NSArray and NSDictionnary
  • Next by Date: Re: Accessing Java from Obj-C
  • Previous by thread: Obj-C vs Java
  • Next by thread: Re: Obj-C vs Java
  • Index(es):
    • Date
    • Thread