<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Objective-C</title>
	<atom:link href="http://nslog.com/2003/11/29/objectivec/feed" rel="self" type="application/rss+xml" />
	<link>http://nslog.com/2003/11/29/objectivec</link>
	<description>The Weblog of Erik J. Barzeski</description>
	<pubDate>Mon, 13 Oct 2008 20:10:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Joachim Bengtsson</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6167</link>
		<dc:creator>Joachim Bengtsson</dc:creator>
		<pubDate>Mon, 02 Oct 2006 08:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6167</guid>
		<description>Hate 6:



I find this init to be both easy and sane:

-(id)init;

{

    if(![super init])

        return nil;

    myInitialization...

    return self;

}



(Okay, very late to the discussion, it seems :-P)</description>
		<content:encoded><![CDATA[<p>Hate 6:</p>
<p>I find this init to be both easy and sane:</p>
<p>-(id)init;</p>
<p>{</p>
<p>    if(![super init])</p>
<p>        return nil;</p>
<p>    myInitialization...</p>
<p>    return self;</p>
<p>}</p>
<p>(Okay, very late to the discussion, it seems :-P)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andy</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6166</link>
		<dc:creator>andy</dc:creator>
		<pubDate>Wed, 11 Aug 2004 12:03:40 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6166</guid>
		<description>If you think that a method is a function with some data added, you're really too stuck in your C++ mindset and haven't grasped the most basic OOP concept.

In ObjC, you can catch method calls that cannot be handled and do something else with it, that's totally unthinkable in C++. Additionally, since Mac OS X 10.1, you can mix ObjC and C++ in a single source file using ObjC++.</description>
		<content:encoded><![CDATA[<p>If you think that a method is a function with some data added, you're really too stuck in your C++ mindset and haven't grasped the most basic OOP concept.</p>
<p>In ObjC, you can catch method calls that cannot be handled and do something else with it, that's totally unthinkable in C++. Additionally, since Mac OS X 10.1, you can mix ObjC and C++ in a single source file using ObjC++.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William Herold</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6165</link>
		<dc:creator>William Herold</dc:creator>
		<pubDate>Tue, 10 Aug 2004 23:35:37 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6165</guid>
		<description>...coming to this thread really, really late... :)



I have to agree with several comments above - where you come from determines how you feel about Objective-C. 



I'm new to Macintosh development but I've been writing Windows software using C &#38; C++ for over ten years. I must admit I chose to work with Carbon over Cocoa largely becuase of hate #1 (and also because I'd like to share classs with a GTK application). Perhaps it's just an old dog refusing to learn new tricks, but the syntax seems convoluted to me. Methods are, ultimately, just functions with hiden member data passed to them so I fail to understand why they should have a different syntax. 



I understand the NeXT legacy and I appreciate language diversity, but Apple is doing themselves a disservice by ignoring millions of C++ developers.</description>
		<content:encoded><![CDATA[<p>...coming to this thread really, really late... <img src='http://nslog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I have to agree with several comments above - where you come from determines how you feel about Objective-C. </p>
<p>I'm new to Macintosh development but I've been writing Windows software using C &amp; C++ for over ten years. I must admit I chose to work with Carbon over Cocoa largely becuase of hate #1 (and also because I'd like to share classs with a GTK application). Perhaps it's just an old dog refusing to learn new tricks, but the syntax seems convoluted to me. Methods are, ultimately, just functions with hiden member data passed to them so I fail to understand why they should have a different syntax. </p>
<p>I understand the NeXT legacy and I appreciate language diversity, but Apple is doing themselves a disservice by ignoring millions of C++ developers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Barthelemy</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6164</link>
		<dc:creator>Mike Barthelemy</dc:creator>
		<pubDate>Mon, 08 Dec 2003 17:10:07 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6164</guid>
		<description>Some points on Jon Rentzsch's original message:



&lt;b&gt;Hate 6:&lt;/b&gt;



You don't have to overwrite self in init.



It is perfectly fine and actually preferred to write init more like the following:



- (YourObject *)init;

{

    YourSuperObject *superobject;



    superobject = [super init];



    if (superobject != nil) {

    }



    return (YourObject *)superobject;

}



Somewhere along the line people figured out that the compiler and practice of overwriting the self pointer didn't matter.  Thus in the effort to save themselves from creating another variable they started writing the code as you showed.  In reality, I write my init methods as a slightly shorter version of the above, mostly to save me typing:



- (YourObject *)init;

{

    id rc = [super init];



    if (rc != nil) {

    }



    return self;

}



Of-course this all gets back to writing more code than we really should have to.  I also assume that the compiler optimizes my init to be fundamentally similar to your init.



&lt;b&gt;Hate 11:&lt;/b&gt;



You can actually write your own class unloader.  It isn't too hard to do this.  The problems start when you want to reload the classes you previously unloaded.  You have to save all of the information yourself and reconstitute it into the class hierarchy, since the classes were never really unloaded from memory just dereferenced.  (There are other issues which I am not bothering to address, obviously, but I have written a class unloader and reloader and know it can be done.)  Thankfully there is enough documentation of the runtime system for someone to do this if they are adventurous.



&lt;b&gt;Hate 15:&lt;/b&gt;



Since I have been a NeXTstep developer since 0.8 beta, you bet I like the syntax.  As you basically say in a roundabout way, there is nothing wrong with the syntax other than it isn't similar to the C++ style messaging syntax.  Of course there would be problems if Apple tried to rewrite the syntax to look something like foo.bar(key:value, key2:value2, key3: value3) since it would interfere directly with the parsing of arguments of C and C++.  [Yes, I know that the current Objective-C arguments are not named.]  I prefer square brackets primarily because it helps make the Objective-C code jump out from the standard C and C++ code which I have to interact with.



You missed a really big hate about Objective-C: no class variables!  I do know the workarounds, but would like to see Objective-C get real class variables.



I agree with the other posters that messaging nil is sometimes a good thing.  I don't like having to track down that one instance of a nil object which isn't supposed to be nil either though.  However, I can't think of a good way to allow me to have my cake and eat it as well so I will cope with having to finding those unwanted nil objects.



Finally, WebObjects, in Java _sucks_ compared to the Objective-C version.  I could easily write the 15 things I hate about Java coming from the Objective-C world.  (I could probably come up with 10 that I like as well, but the hate side wins regardless.)  G*d-d*mn helper-class hell.  Why Gosling thinks he invented an object-orientated language, when you *have to* write objects which are totally meaningless in-and-of-themselves, I will never know.  Java definitely makes me write more code that I shouldn't have to than Objective-C does.



Mike Barthelemy</description>
		<content:encoded><![CDATA[<p>Some points on Jon Rentzsch's original message:</p>
<p><b>Hate 6:</b></p>
<p>You don't have to overwrite self in init.</p>
<p>It is perfectly fine and actually preferred to write init more like the following:</p>
<p>- (YourObject *)init;</p>
<p>{</p>
<p>    YourSuperObject *superobject;</p>
<p>    superobject = [super init];</p>
<p>    if (superobject != nil) {</p>
<p>    }</p>
<p>    return (YourObject *)superobject;</p>
<p>}</p>
<p>Somewhere along the line people figured out that the compiler and practice of overwriting the self pointer didn't matter.  Thus in the effort to save themselves from creating another variable they started writing the code as you showed.  In reality, I write my init methods as a slightly shorter version of the above, mostly to save me typing:</p>
<p>- (YourObject *)init;</p>
<p>{</p>
<p>    id rc = [super init];</p>
<p>    if (rc != nil) {</p>
<p>    }</p>
<p>    return self;</p>
<p>}</p>
<p>Of-course this all gets back to writing more code than we really should have to.  I also assume that the compiler optimizes my init to be fundamentally similar to your init.</p>
<p><b>Hate 11:</b></p>
<p>You can actually write your own class unloader.  It isn't too hard to do this.  The problems start when you want to reload the classes you previously unloaded.  You have to save all of the information yourself and reconstitute it into the class hierarchy, since the classes were never really unloaded from memory just dereferenced.  (There are other issues which I am not bothering to address, obviously, but I have written a class unloader and reloader and know it can be done.)  Thankfully there is enough documentation of the runtime system for someone to do this if they are adventurous.</p>
<p><b>Hate 15:</b></p>
<p>Since I have been a NeXTstep developer since 0.8 beta, you bet I like the syntax.  As you basically say in a roundabout way, there is nothing wrong with the syntax other than it isn't similar to the C++ style messaging syntax.  Of course there would be problems if Apple tried to rewrite the syntax to look something like foo.bar(key:value, key2:value2, key3: value3) since it would interfere directly with the parsing of arguments of C and C++.  [Yes, I know that the current Objective-C arguments are not named.]  I prefer square brackets primarily because it helps make the Objective-C code jump out from the standard C and C++ code which I have to interact with.</p>
<p>You missed a really big hate about Objective-C: no class variables!  I do know the workarounds, but would like to see Objective-C get real class variables.</p>
<p>I agree with the other posters that messaging nil is sometimes a good thing.  I don't like having to track down that one instance of a nil object which isn't supposed to be nil either though.  However, I can't think of a good way to allow me to have my cake and eat it as well so I will cope with having to finding those unwanted nil objects.</p>
<p>Finally, WebObjects, in Java _sucks_ compared to the Objective-C version.  I could easily write the 15 things I hate about Java coming from the Objective-C world.  (I could probably come up with 10 that I like as well, but the hate side wins regardless.)  G*d-d*mn helper-class hell.  Why Gosling thinks he invented an object-orientated language, when you *have to* write objects which are totally meaningless in-and-of-themselves, I will never know.  Java definitely makes me write more code that I shouldn't have to than Objective-C does.</p>
<p>Mike Barthelemy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Canfield</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6163</link>
		<dc:creator>Steven Canfield</dc:creator>
		<pubDate>Mon, 08 Dec 2003 05:12:24 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6163</guid>
		<description>It's silly because I don't know Python, (I know PHP though), and I've never once wished for changes to OBJ-C, just changes to the framework. I guess that's not a very good answer, but that's all I've got.</description>
		<content:encoded><![CDATA[<p>It's silly because I don't know Python, (I know PHP though), and I've never once wished for changes to OBJ-C, just changes to the framework. I guess that's not a very good answer, but that's all I've got.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon H</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6162</link>
		<dc:creator>Jon H</dc:creator>
		<pubDate>Mon, 08 Dec 2003 01:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6162</guid>
		<description>I think one's acceptance of the braces can be easier if you're coming from Pascal or C and Objective-C is your first OO language.



In that context, it's not strange to find that method calls have a different syntax than function calls. They're different things, after all, especially in a language like Objective C with dynamic binding.



When you're learning OO, I also think it's probably useful that the different syntax keeps the concepts of method and function separate. That way you can know "here I'm using a C function, not OO" and "here I'm using a method".



But if you're coming to Objective-C from a language which uses parens for both functions and methods, then it probably does look strange.



But yeah, I'm an old NeXT user. For what it's worth, Smalltalk has always looked weird to me. But Objective-C was my first OO language, and one of my first languages of any kind.



- Jon



PS: regarding the expressiveness (or not) of message calls, consider the case where a Java constructor invokes another constructor, and all you see is



this(foo, bar, baz) or

this(foo, baz), or

this(foo, bar).



and you lose what little information might have been provided in the method name.</description>
		<content:encoded><![CDATA[<p>I think one's acceptance of the braces can be easier if you're coming from Pascal or C and Objective-C is your first OO language.</p>
<p>In that context, it's not strange to find that method calls have a different syntax than function calls. They're different things, after all, especially in a language like Objective C with dynamic binding.</p>
<p>When you're learning OO, I also think it's probably useful that the different syntax keeps the concepts of method and function separate. That way you can know "here I'm using a C function, not OO" and "here I'm using a method".</p>
<p>But if you're coming to Objective-C from a language which uses parens for both functions and methods, then it probably does look strange.</p>
<p>But yeah, I'm an old NeXT user. For what it's worth, Smalltalk has always looked weird to me. But Objective-C was my first OO language, and one of my first languages of any kind.</p>
<p>- Jon</p>
<p>PS: regarding the expressiveness (or not) of message calls, consider the case where a Java constructor invokes another constructor, and all you see is</p>
<p>this(foo, bar, baz) or</p>
<p>this(foo, baz), or</p>
<p>this(foo, bar).</p>
<p>and you lose what little information might have been provided in the method name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Tsai's Weblog</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6168</link>
		<dc:creator>Michael Tsai's Weblog</dc:creator>
		<pubDate>Sun, 07 Dec 2003 22:03:13 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6168</guid>
		<description>&lt;strong&gt;A Balanced and Fair Look at Objective-C&lt;/strong&gt;

Jonathan Rentzsch has written a great article about what he loves and hates about Objective-C. I&#8217;ve wanted to write this article for a long time, but now Rentzsch has saved me the time and also done a better job than I probably would have. Now I...
</description>
		<content:encoded><![CDATA[<p><strong>A Balanced and Fair Look at Objective-C</strong></p>
<p>Jonathan Rentzsch has written a great article about what he loves and hates about Objective-C. I&rsquo;ve wanted to write this article for a long time, but now Rentzsch has saved me the time and also done a better job than I probably would have. Now I...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bbum</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6161</link>
		<dc:creator>bbum</dc:creator>
		<pubDate>Fri, 05 Dec 2003 23:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6161</guid>
		<description>Sorry. That wasn't fair.



Why is it silly?</description>
		<content:encoded><![CDATA[<p>Sorry. That wasn't fair.</p>
<p>Why is it silly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bbum</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6160</link>
		<dc:creator>bbum</dc:creator>
		<pubDate>Fri, 05 Dec 2003 07:54:32 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6160</guid>
		<description>Troll.</description>
		<content:encoded><![CDATA[<p>Troll.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Canfield</title>
		<link>http://nslog.com/2003/11/29/objectivec#comment-6159</link>
		<dc:creator>Steven Canfield</dc:creator>
		<pubDate>Wed, 03 Dec 2003 01:18:30 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2003/11/29/objective-c/#comment-6159</guid>
		<description>I like Obj-C. PyObjC seems silly.</description>
		<content:encoded><![CDATA[<p>I like Obj-C. PyObjC seems silly.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
