News for hackers. Stuff that matters.
Re:Non-Apple's Mistake by fr0man on Friday April 16, 2010 @04:47PM (#1271890)
You loathe Java but you like Objective-C? Madness.
Re:Non-Apple's Mistake by astrange on Friday April 16, 2010 @05:00PM (#1271925)
I have the same opinion and I don't see anything weird about it.

They're both OO languages without many features compared to C++ or something, but Obj-C is dynamic and much more flexible (see NSProxy, NSArray class clusters, etc.) whereas Java is not at all.

Plus Obj-C is actually C, so you can write "if (!i)" without the compiler deciding you're too stupid to handle implicit type conversions.

By the way, I've noticed that people (who don't seem to use it often) complain about the extremely long method names in Obj-C, but if you count by the number of tokens instead it can be pretty terse. And I think that's how reading natural language is supposed to work, anyway…

Re:Non-Apple's Mistake by cpr on Friday April 16, 2010 @07:12PM (#1272228)
That's one of Cocoa (Touch)'s strengths, actually, and part of the 'secret sauce': Ozer and crew have developed a really good set of naming conventions over the years, and use them well.

I like the long names. It's very Smalltalk-like, and Xcode completion mostly takes the pain out of it.

Re:Non-Apple's Mistake by cubicle67 on Friday April 16, 2010 @09:17PM (#1272398)
how'd you do the upside-down exclamation mark?
Re:Non-Apple's Mistake by jodrellblank on Saturday April 17, 2010 @01:17AM (#1272662)
The letter i?
Re:Non-Apple's Mistake by cpr on Friday April 16, 2010 @04:53PM (#1271907)
Yes, because Obj-C is truly just Smalltalk with C-style control structures. Maybe I'm damaged, because I've used Smalltalk in a previous existence, and loved it.

Java is not a dynamic language.

Re:Non-Apple's Mistake by ajross on Friday April 16, 2010 @05:57PM (#1272059)
For what definition of "dynamic language" is that statement true? Both languages do late binding of methods to objects, Java merely happens to smear on a layer of typesafety above it.

Frankly, the two languages are semantically all but identical, modulo the ability of Obj-C to fall back to a "bare memory" data model when you want to.

Re:Non-Apple's Mistake by astrange on Friday April 16, 2010 @06:25PM (#1272126)
They certainly don't bind methods to objects at the same time - Obj-C does it when you send the message. You can send and catch messages with no methods attached to them, or that weren't even declared in the first place (at the expense of a compiler warning).

Of course there are other differences, but the most important one is just that the class library is much better - UI doesn't rely on inheritance, there's no class named LinkedHashMap (see http://ridiculousfish.com/blog/archives/2005/12/23/array/), and there _is_ a class named NSMutableArray.

Re:Non-Apple's Mistake by catch23 on Friday April 16, 2010 @06:38PM (#1272162)
You can do mixins fairly easily in ObjC, but in Java, you'd essentially have to resort to runtime bytecode rewriting. Take a look at what popular libraries like Hibernate, Spring, AspectJ use under the covers to perform their magic.
Re:Non-Apple's Mistake by amock on Friday April 16, 2010 @04:57PM (#1271918)
If this isn't a sarcastic comment, what does loathing Java have to do with Objective-C?