News for hackers. Stuff that matters.
Re:Java Was Strongly Influenced by Objective-C by bad_user on Thursday February 11, 2010 @06:32PM (#1119108)
Sure you can ... object.sendMessage(messageName) ;) Or for already built classes ... see java.lang.reflect.Method

Personally if I were to choose, I'd trade some syntactic sugar for a decent garbage-collector. But that's just me :)

Re:Java Was Strongly Influenced by Objective-C by ryanpetrich on Thursday February 11, 2010 @06:53PM (#1119152)
Message forwarding is not syntactic sugar!
Re:Java Was Strongly Influenced by Objective-C by ekiru on Thursday February 11, 2010 @11:03PM (#1119721)
It is. In Objective C: [obj doFoo] would be analogous to this in a Java-like language: MethodSpec s = new MethodSpec("doFoo"); (obj.hasMethod(ms) ? obj.performMethod(ms) : obj.handleMissingMethod(ms)

However, people associate "syntactic sugar" with a connotation of not being a significant difference. Many very useful tools in programming are merely syntactic sugar. For, while, and similar control flow structures are just syntactic sugar over either continuations or gotos.

Message passing OO is syntactic sugar. As evidence, look at the object system the Gtk folks made for themselves in C, or the various object systems Perl programmers have made for themselves.

The example of object systems in Perl illustrates another point about syntactic sugar: having a language which makes it possible for programmers to add their own syntactic sugar within the language is incredibly powerful. Moose is a great system, and Perl's flexible syntax is what makes it possible(although I don't really know Perl well enough to know how it's implemented, its syntax is very pleasant). CLOS is another example of the power of languages which allow programmers to add their own syntactic sugar.

Syntactic sugar can be very good. Message forwarding not only is a very useful piece of syntactic sugar, but also allows the creation of certain types of very convenient syntactic sugar to a language.

Re:Java Was Strongly Influenced by Objective-C by glhaynes on Thursday February 11, 2010 @08:53PM (#1119477)
Objective C 2.0's garbage collector works just fine tyvm
Re:Java Was Strongly Influenced by Objective-C by allenbrunson on Thursday February 11, 2010 @10:47PM (#1119687)
... but not on the iphone, sadly.