{"id":8995,"date":"2014-06-17T10:11:05","date_gmt":"2014-06-17T14:11:05","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8995"},"modified":"2015-01-31T09:16:40","modified_gmt":"2015-01-31T14:16:40","slug":"swift-objective-c-without-the-smalltalk","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/06\/17\/swift-objective-c-without-the-smalltalk\/","title":{"rendered":"Swift: Objective-C Without the Smalltalk"},"content":{"rendered":"<p><a href=\"https:\/\/medium.com\/@owensd\/swift-d3c212c35fd8\">David Owens II<\/a> has some criticisms along this line that differ from those I mentioned <a href=\"http:\/\/mjtsai.com\/blog\/2014\/06\/13\/instantiating-classes-by-name-in-swift\/\">before<\/a> (via <a href=\"https:\/\/twitter.com\/nuoji\/status\/478815181867614208\">Christoffer Lern&ouml;<\/a>):<\/p>\r\n<blockquote cite=\"https:\/\/medium.com\/@owensd\/swift-d3c212c35fd8\"><p>Gone is the dynamic nature of ObjC; it has instead been replaced by a rigid, generic based type system. I know the world of C++, Java, and C# programmers have rejoiced. Myself, having worked in Visual Studio building tools for .NET and Windows developers for many years and leaving that for the world of Cocoa and ObjC, I am greatly saddened by this turn of events.<\/p>\r\n<p>I do not think we got &ldquo;ObjC without the C&rdquo;, rather, we got something much more like C# that compiles on clang and bridges into Cocoa a bit haphazardly.<\/p>\r\n<p>[&#8230;]<\/p>\r\n<p>Yes, generics can be useful in particular cases. However, they are not helpful, ironically, in the generic use case. I would argue that simply sticking with a stronger-type base instead of fully type-safe and generic based language would have been a more pragmatic route to take.<\/p>\r\n<p>[&#8230;]<\/p>\r\n<p>I have to wonder, what is the pragmatic goal of Swift? From where I sit, it gets all of the defaults wrong because the defaults should have been about the interaction with the Cocoa API. Until there are native Swift versions of those, all of code looks and feels much messier and far less elegant than what we have today.<\/p><\/blockquote>\r\n<p><a href=\"https:\/\/openradar.appspot.com\/radar?id=5646946899329024\">Christoffer Lern&ouml;<\/a>:<\/p>\r\n<blockquote cite=\"https:\/\/openradar.appspot.com\/radar?id=5646946899329024\"><p>I realize that it\u2019s a vain hope that this bug report will be anything than summarily dismissed, but I feel I have to make the attempt nonetheless.<\/p>\r\n<p>[&#8230;]<\/p>\r\n<p>My conclusion is that dynamic dispatch must be a first class citizen in order to make Swift suitable for UI programming. Also, the generics must be much simplified and permissive in order to not obstruct and complicate the day-to-day programming work.<\/p><\/blockquote>\r\n<p>Update (2014-06-17): See <a href=\"https:\/\/twitter.com\/owensd\/status\/478935852626628608\">more<\/a> <a href=\"https:\/\/twitter.com\/mpweiher\/status\/478948405046411264\">about<\/a> <a href=\"http:\/\/inessential.com\/2014\/06\/17\/c_in_sheeps_clothing\">the<\/a> JSON example and also <a href=\"http:\/\/edgecasesshow.com\/093-the-culture-didnt-change-first.html\">Edge Cases<\/a> on Swift and C++ culture.<\/p>\r\n<p>Update (2014-06-22): <a href=\"https:\/\/medium.com\/swift-programming\/swift-and-json-reborn-b6f4f232e35e\">David Owens II<\/a> has a further update on the JSON example.<\/p>","protected":false},"excerpt":{"rendered":"<p>David Owens II has some criticisms along this line that differ from those I mentioned before (via Christoffer Lern&ouml;): Gone is the dynamic nature of ObjC; it has instead been replaced by a rigid, generic based type system. I know the world of C++, Java, and C# programmers have rejoiced. Myself, having worked in Visual [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[168,46,966,54,71,901],"class_list":["post-8995","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-blocks","tag-languagedesign","tag-message-passing","tag-objective-c","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=8995"}],"version-history":[{"count":7,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8995\/revisions"}],"predecessor-version":[{"id":10612,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8995\/revisions\/10612"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}