Subscribe. Follow. Stalk.

Monday, June 24, 2013

Java vs Objective C

I often get the question: What is the difference between Java and Objective C? Well, I then give the same explanation I've given people over and over again... :/

They really are quite similar. Once you know one the other one comes to you quite easily. But they do have their own quirks.

  • Java is static. Objective C is dynamic. Basically, Java is a control freak bureaucracy that makes sure everything at compile time is ready to go. I won't say the same about Objective C
  • Objective C is based on C. Pretty obvious, but has some pretty annoying implications. Pointer problems, memory leaks and whatever else that you hate about C will likely apply here.
  • Objective C classes need more than one file (header + implementation). Kind of annoying at best. Really annoying at worst.
  • Objective C has categories. Remember how I said Objective C was dynamic? Well, you can even add methods to pre existing classes w/o the need to subclass
  • Java is garbage collected. Honestly, the time saved from finding annoying memory bugs is worth the overhead for GC.
  • Java can be compiled and run anywhere. I don't really care for this one, but it is a difference between the two.

No comments:

Post a Comment