{"id":20301,"date":"2018-01-26T07:50:46","date_gmt":"2018-01-26T12:50:46","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=20301"},"modified":"2018-06-05T21:21:44","modified_gmt":"2018-06-06T01:21:44","slug":"tim-cook-on-coding","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/01\/26\/tim-cook-on-coding\/","title":{"rendered":"Tim Cook on Coding"},"content":{"rendered":"<p><a href=\"https:\/\/www.thestar.com\/news\/gta\/2018\/01\/22\/tim-cook-surprises-kids-taking-coding-lessons-at-apple-store-in-eaton-centre.html\">Josh McConnell<\/a> (via <a href=\"https:\/\/apple.slashdot.org\/story\/18\/01\/25\/1340236\/tim-cook-coding-languages-were-too-geeky-for-students-until-we-invented-swift\">Slashdot<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.thestar.com\/news\/gta\/2018\/01\/22\/tim-cook-surprises-kids-taking-coding-lessons-at-apple-store-in-eaton-centre.html\">\n<p>Cook surprised a class of Grade 7 students in Toronto&rsquo;s east end as they learned how to program robots to dance on tables using Apple&rsquo;s Swift programming language, recently introduced by the company as a low-barrier-to-entry way of coding.<\/p>\n<p>&ldquo;Swift came out of the fundamental recognition that coding languages were too geeky. Most students would look at them and say, &lsquo;that&rsquo;s not for me,&rsquo; &rdquo; Cook said as the preteens participated in an Apple-designed &ldquo;Everyone Can Code&rdquo; workshop, which helps children learn how to build mobile apps, at the Apple Store in Toronto&rsquo;s Eaton Centre.<\/p>\n<p>&ldquo;That&rsquo;s not our view. Our view is that coding is a horizontal skill like your native languages or mathematics, so we wanted to design a programming language that is as easy to learn as our products are to use.&rdquo;<\/p>\n<\/blockquote>\n\n<p>I like Swift. But, having programmed in probably more than a dozen languages, I would not classify Swift as easy to learn. It&rsquo;s at the end with the harder ones like C++. It&rsquo;s complicated enough that I&rsquo;m not sure there&rsquo;s anyone, even among those creating it, who fully understands all the nooks and crannies. It&rsquo;s definitely a geeky language.<\/p>\n\n<p>Now, maybe Cook meant that the basics are easy to pick up. I suppose that&rsquo;s true, but I would&rsquo;t say that the basics are easier in Swift than in, say, Python. Playgrounds notwithstanding, Swift does not feel like a clean, easy teaching language to me; it&rsquo;s more of a pragmatic tool for professionals.<\/p>\n\n<p>Consider the simple example of removing an object from an array. In Python, it&rsquo;s <code>list.remove(object)<\/code>. In Objective-C it&rsquo;s <code>[array removeObject:object]<\/code>. (Yes, I&rsquo;m aware these behave differently.) There&rsquo;s <a href=\"https:\/\/stackoverflow.com\/questions\/40859066\/removing-object-from-array-in-swift-3\">no method<\/a> that does this in Swift 4. There&rsquo;s currently an <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/master\/proposals\/0197-remove-where.md\">enhancement proposal<\/a> in review, but it looks like even then you would need to pass a closure rather than an object. I&rsquo;m not saying that&rsquo;s necessarily the wrong design&mdash;in fact it&rsquo;s very pragmatic&mdash;but it&rsquo;s certainly not the one that&rsquo;s easiest to learn.<\/p>\n\n<p>See also: <a href=\"https:\/\/www.kirkville.com\/the-tech-industrys-tunnel-vision-about-coding-and-language\/\">Kirk McElhearn<\/a>, <a href=\"http:\/\/morrick.me\/archives\/8068\">Riccardo Mori<\/a>.<\/p>\n\n<p>Update (2018-01-26): See also: <a href=\"https:\/\/twitter.com\/nicklockwood\/status\/956915354848190464\">Nick Lockwood<\/a> and <a href=\"https:\/\/twitter.com\/bob_burrough\/status\/956994793116086272\">Bob Burrough<\/a>.<\/p>\n\n<p>Update (2018-06-05): <a href=\"https:\/\/twitter.com\/nicklockwood\/status\/1003917407323291648\">Nick Lockwood<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/nicklockwood\/status\/1003917407323291648\">\n<p>Tim Cook once again repeated the claim that Apple built Swift as a way to make programming easy to learn for everyone.<\/p>\n<p>I like Swift a lot, but it is by far the most complex and nuanced language I have ever used. It will take me a decade to fully master it.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Josh McConnell (via Slashdot): Cook surprised a class of Grade 7 students in Toronto&rsquo;s east end as they learned how to program robots to dance on tables using Apple&rsquo;s Swift programming language, recently introduced by the company as a low-barrier-to-entry way of coding. &ldquo;Swift came out of the fundamental recognition that coding languages were too [&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":"2018-06-06T01:21:46Z","apple_news_api_id":"c84c9be5-70ad-486d-bd98-ac09c819de9b","apple_news_api_modified_at":"2018-06-06T01:21:47Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AyEyb5XCtSG29mKwJyBnemw","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":[],"tags":[235,46,71,901,60],"class_list":["post-20301","post","type-post","status-publish","format-standard","hentry","tag-education","tag-languagedesign","tag-programming","tag-swift-programming-language","tag-timcook"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20301","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=20301"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20301\/revisions"}],"predecessor-version":[{"id":21681,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20301\/revisions\/21681"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=20301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=20301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=20301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}