{"id":11282,"date":"2015-05-21T09:56:10","date_gmt":"2015-05-21T13:56:10","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=11282"},"modified":"2015-06-12T12:51:36","modified_gmt":"2015-06-12T16:51:36","slug":"which-features-overcomplicate-swift","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/05\/21\/which-features-overcomplicate-swift\/","title":{"rendered":"Which Features Overcomplicate Swift?"},"content":{"rendered":"<p><a href=\"https:\/\/www.quora.com\/Which-features-overcomplicate-Swift-What-should-be-removed\/answer\/Rob-Rix\">Rob Rix<\/a> (<a href=\"https:\/\/twitter.com\/rob_rix\/status\/599831379359195137\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.quora.com\/Which-features-overcomplicate-Swift-What-should-be-removed\/answer\/Rob-Rix\"><p>It&rsquo;s even harder to separate out the opportunity cost&mdash;how many of the language&rsquo;s <i>other<\/i> complexities and inconsistencies would have been reconciled if they hadn&rsquo;t had to focus on interoperability with a fundamentally unsafe language and runtime with which they share an address space?<\/p>\n<p>While this overwhelms the language&rsquo;s design, it&rsquo;s hardly the only example of complexity.<\/p>\n<p>[&#8230;]<\/p>\n<p>Crucially, the vast majority of this is <i>incidental<\/i> complexity, not <i>essential<\/i> complexity. Swift is a crescendo of special cases stopping <i>just<\/i> short of the general; the result is complexity in the semantics, complexity in the behaviour (i.e. bugs), and complexity in use (i.e. workarounds).<\/p><\/blockquote>\n<p>Update (2015-05-23): <a href=\"http:\/\/blog.metaobject.com\/2015\/05\/i-am-jealous-of-swift.html\">Marcel Weiher<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=9594091\">Hacker News<\/a>, <a href=\"http:\/\/www.reddit.com\/r\/programming\/comments\/370z1c\/i_am_jealous_of_swift\/\">Reddit<\/a>):<\/p>\n<blockquote cite=\"http:\/\/blog.metaobject.com\/2015\/05\/i-am-jealous-of-swift.html\"><p>Or the whole idea of having every arithmetic operation be a potential crash point, despite the fact that\nproper <a href=\"http:\/\/en.wikipedia.org\/wiki\/Numerical_tower\">numeric towers<\/a> have been around for many decades and decently optimized (certainly no slower than unoptimized Swift).<\/p><p>And yet, Rob for example writes that the main culprit for Swift&rsquo;s complexity is Objective-C, which I find\nsomewhat mind-boggling.  After all, the requirement for Objective-C interoperability couldn&rsquo;t exactly\nhave come as a last minute surprise foisted on an existing language.  Folks: if we&rsquo;re designing a\nreplacement language for Apple&rsquo;s Cocoa frameworks, Objective-C compatibility needs to be designed\nin from the beginning and not added in as an afterthought.  And if you don&rsquo;t design your language\nto be at odds with the frameworks you will be supporting, you will discover that you can get a\nmuch cleaner design.<\/p><p>[&#8230;]<\/p><p>The situation is even more bizarre when it comes to performance.  For example, here&rsquo;s a talk \ntitled <a href=\"http:\/\/realm.io\/news\/swift-summit-joseph-lord-performance\/\">How Swift is Swift<\/a>.\nThe opening paragraph declares that &ldquo;Swift is designed to be fast, very fast&rdquo;, yet a few \nparagraphs (or slides) down, we learn that debug builds are often 100 times slower than\noptimized builds (which themselves don&rsquo;t really rival C).<\/p><\/blockquote>\n<p><a href=\"https:\/\/news.ycombinator.com\/item?id=9594482\">bontoJR<\/a>:<\/p>\n<blockquote cite=\"https:\/\/news.ycombinator.com\/item?id=9594482\"><p>I like Swift because constantly challenges my skills as engineer, I have to find workarounds to apply all the concepts I know about functional programming, but... this is the current feeling, I don&rsquo;t know if in a long run this would persist, I can&rsquo;t image to fight against the language like I have to do sometimes, would make me still happy in 2-3 years, maybe some day I would get tired.<\/p><\/blockquote>\n<p>Update (2015-06-11): <a href=\"http:\/\/blog.metaobject.com\/2015\/06\/steve-jobs-on-swift.html\">Marcel Weiher<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=9675997\">comments<\/a>):<\/p>\n<blockquote cite=\"http:\/\/blog.metaobject.com\/2015\/06\/steve-jobs-on-swift.html\">\n<p>Apple used to be very much about going that distance, and I don&rsquo;t think Swift lives up to that standard. That doesn&rsquo;t mean it&rsquo;s all bad or that it&rsquo;s completely irredeemable, there are good elements. But they stopped at sophisticated complexity. And &ldquo;well, it&rsquo;s not all bad&rdquo; is not exactly what Apple stands for or what we as Apple customers expect and, quite frankly, deserve. And had there been a Steve in Dev Tools, he would have said: do it again, this is not good enough.<\/p>\n<\/blockquote>\n<p>Update (2015-06-12): <a href=\"http:\/\/movq.us\/2015\/06\/11\/swift\/\">Adam Knight<\/a>:<\/p>\n<blockquote cite=\"http:\/\/movq.us\/2015\/06\/11\/swift\/\"><p>Swift is kind of like when you&rsquo;re a kid and you fill the bag of jelly beans with all your favorite flavors and then reach in and have a handful all at once. Each was a good idea, but together it lacks anything that made any single piece good.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Rob Rix (tweet): It&rsquo;s even harder to separate out the opportunity cost&mdash;how many of the language&rsquo;s other complexities and inconsistencies would have been reconciled if they hadn&rsquo;t had to focus on interoperability with a fundamentally unsafe language and runtime with which they share an address space? While this overwhelms the language&rsquo;s design, it&rsquo;s hardly the [&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":[46,71,901],"class_list":["post-11282","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11282","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=11282"}],"version-history":[{"count":5,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11282\/revisions"}],"predecessor-version":[{"id":11476,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11282\/revisions\/11476"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=11282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=11282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=11282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}