Feeds:
投稿
コメント

Archive for the ‘プログラミング’ Category

n-LINDA-LIUKAS-large570

プログラミングをギークの手から開放

Programming for the rest of us (girls) …

Swift も扱うのだろうか・・・

フィンランド発プログラミング女子「レイルズガールズ」 世界で拡散中 ネット業界にもダイバーシティ | ハフィントンポスト

Rails Girls Shiojiri, 6-7 March 2015 | Rails Girls

Rails Girls Official site | Rails Girls

Kicking Off Our First Community Spotlight with Linda Liukas | New Relic blog

プログラミング女子を世界に増やす!IT大国フィンランドから舞い降りた美人伝道者|ダイヤモンド・オンライン

広告

Read Full Post »

GettyImages.Stream.app

[Stream アプリ:AppleInsider

最も充実したデジタルコンテンツのライブラリとして知られる Getty Images が、自社コンテンツの検察ツール Stream を公開している。

これはすべて Swift だけで書かれたアプリだという。

Daniel Eran Dilger が開発者とのインタビューをまとめているが、Swift のケーススタディとしてたいへん興味深い。 

Apple’s new Swift programming language takes flight with Getty Images, American Airlines, LinkedIn, and Duolingo | AppleInsider

     *     *     *

すべては WWDC から始まった

Getty Images が「Stream」を開発したそもそもの始まりは、同社のアプリ開発部門のマネージャー Raphael Miller が昨年の WWDC で2日間のハッカソン(hackathon)に参加したことだった。その結果 Getty Images のデジタルライブラリを検索する iOS・OS X アプリ Stream が生まれた。

     *     *     *

さまざまな開発者

経験を積んだ Objective-C の上級開発者はもちろんすぐ Swift を使えるようになったが、そうでない若い開発者 — 1〜2年程度の C# 経験者や Java を習っただけの大学出たて — にとってはとくに取っつきやすいのが注目されたと Miller はいう。Ruby に習熟したウェブ開発者もまた、これまでとはシンタックスが異なる Objective-C より Swift の方が使いやすそうだったとも。

新規開発者にとっても Swift をアップルプラットフォームのデフォルト言語にすれば、Mac の Cocoa や iOS の Cocoa Touch API を理解し、習熟しやすくなるという。

     *     *     *

少ないコードで多くのことを

Miller は Swift のことを「より高性能な(pretty performant)」言語だという。開発者の生産性を高められることが主たるメリットだ。冗長な Objective-C にくらべ、Swift の簡潔さは「少ないコードでより多くのことをやる」ことが可能で、「日常的なことをすばやく片づけられる」という。この点は Ruby の開発者にとってとくに魅力的だ。その結果「少ないコードでより多くのプログラミングができる」からだ。新しいコンセプトのプロトタイプを素早く作るのに Ruby が使われることが多い。

     *     *     *

コンシューマアプリの分野

開発者の生産性を高めるという Swift のメリットはコンシューマ分野でとくに重要だ。新しい機能でアプリを新鮮に保ち、目に見える機能強化を行なう必要があるからだ。Swift なら「素早く片づけて」、新しい機能を求めるユーザーの要求に素早く答えられる。

     *     *     *

エラーを省き効率的

また Swift は一般的なエラーを含むコードのコンパイルを許さない。「早い段階でどこが間違っているのか教えてくれる」と Miller はいう。開発者には「コードを入力している段階でなぜうまく動かないのか教えてくれる。」このため欠陥を含んだコードをコンパイルすることで無駄な時間を使わずに済むのだ。

     *     *     *

すべてのアプリを Swift 化

Miller によれば、初期の Swift は「かなり未完成」だったが、「リリースの度に良くなった。」 コンパイラの問題や Objective-C と Swift をミックスする問題により「まだ Xcode がクラッシュすることも時々ある。」 しかし Swift だけで書かれた Stream の成功を見て、彼のチームは「Getty Images のアプリをすべて Swift コードに変換しようとしている。」すべてのアプリの 50 〜 60% を Swift 化することを目標に掲げていると。

     *     *     *

社内の関心を呼んだ

Getty Images としては Android アプリの開発も、クロスプラットフォームの計画もないという。だから移植の問題もない。しかし Swift の社内ワークショップを開いたことで社内の他の開発者たちも注目している。マイクロソフトの C# を使うバックエンド API プログラマーや Ruby に馴染んだウェブ開発者などがそうだ。

Swift のおかげで「みんながやってくる」ようになったと Miller はいう。とくにモバイル開発への興味がそうさせるのだと。Objective-C のシンタックスが近づきにくいのと違って、Swift はモバイルアプリのスキルを身につけようとする既存のデベロッパにとって「シンタックス的にこわくない」ので親近感が増すのだという。

     *     *     *

アップルに望むこと

Swift について将来アップルに何を望むかと尋ねられた Miller は、「サンプルコードがもっとあると有難い」という。「これはよくある問題だが Objective-C ではこうやるのを Swift ではこうやる」と教えてくれるようなサンプルコードだ。また異なるタスクについて Swift を使うメリットを教えてくれる費用対効果分析も。

Asked what he’d like to see from Apple related to Swift in the future, Miller said, “it would be nice to see more sample code” demonstrating, “here’s a common problem, here’s how you’d do it in Swift vs Objective-C,” and outlining a cost benefit analysis of using Swift for different tasks

「Objective-C はこれまで長い間使われてきたので最適事例も多々ある。」 Swift については最適事例はまだ集積されていない。理想的には、「Swift を設計した連中」が Swift の効果的利用法をいちばんよく知っているのだから・・・

“Objective-C has been around so long, the best practices are out there,” Miller stated. For Swift, there’s less best practice architecture available, and ideally the best insight on how to use Swift most effectively would come from “from guys who designed it.”

     *     *     *

実際に自社アプリを開発した者のことばなので具体的で説得力がある。

この記事をまとめた Daniel Eran Dilger は、この他にも American Airlines や LinkedIn、Duolingo のケースも触れているので、類似の分野の開発者にとってはこれまた参考になりそうだ・・・

Read Full Post »

stanford_swift

[Developing iOS 8 Apps with Swift by Stanford:iTunes U

恒例のスタンフォード大 iOS コース。

今年のウリは発表されたばかりの Swift だ。

工学部の Paul Hegarty 教授によるコースがさっそく iTunes U で無料公開されている。

Developing iOS 8 Apps with Swift – Download Free Content from Stanford | iTunes

始まったばかりで、最初の2講義(各1時間)がビデオとスライド付きでアップロードされている。

新しいプログラミング言語で iPhone や iPad のアプリを作ろうというひとには見逃せないチャンス!

それにしても名門スタンフォード大の人気コースが世界のどこからでもタダで受講できるのだからじつに素晴らしいご時世になったものだ。

各国語のつぶやきを見ても、世界各地の期待と興奮が伝わって来るようだ・・・

Read Full Post »

lang.rank_.plot_.q1151-e1421252765953

[プログラミング言語のランキング:RedMonk

アップルの新しいプログラミング言語 Swift は「流星のような伸び」(meteoric growth)を見せていると、Stephen O’Grady はいう。

The RedMonk Programming Language Rankings: January 2015 | tecosystems

     *     *     *

類を見ないランキングの伸び

第3四半期のランキングに初めて登場したとき「Swift は大変人気の出る言語になるだろう、しかも急速に・・・」と述べた。それでもなお、Swift の経験している伸びはランキング史上でも類を見ないものだ。一度に順位が5つも10もジャンプし、トップ20に近づき、あるいはトップ20入りするような急激な伸びをすると、その後はランキングの上昇が困難になるものだ。なのに Swift は、第3四半期の68位から今期第4四半期には22位へと、46段階もジャンプした。・・・この劇的なランキングの伸びを見ると、今年の第3四半期にはトップ20の仲間入りをしてもおかしくない。

As was said during the Q3 rankings which marked its debut, “Swift is a language that is going to be a lot more popular, and very soon.” Even so, the growth that Swift experienced is essentially unprecedented in the history of these rankings. When we see dramatic growth from a language it typically has jumped somewhere between 5 and 10 spots, and the closer the language gets to the Top 20 or within it, the more difficult growth is to come by. And yet Swift has gone from our 68th ranked language during Q3 to number 22 this quarter, a jump of 46 spots. […] Given this dramatic ascension, it seems reasonable to expect that the Q3 rankings this year will see Swift as a Top 20 language.

     *     *     *

ちなみにトップ20のリストは次のようなものだ。

プログラミング言語のトップ20

1 JavaScript
2 Java
3 PHP
4 Python
5 C#
5 C++
5 Ruby
8 CSS
9 C
10 Objective-C
11 Perl
11 Shell
13 R
14 Scala
15 Haskell
16 Matlab
17 Go
17 Visual Basic
19 Clojure
19 Groovy

     *     *     *

トップ10は比較的固定して動かないそうだが、Swift と第10位の Objective-C との関係がどうなっていくか、これはなかなかの見ものだろう・・・

Read Full Post »

fb-year-1

Inadvertent Algorithmic Cruelty | Eric’s Archived Thoughts

Yes, my year looked like that. True enough. My year looked like the now-absent face of my little girl. It was still unkind to remind me so forcefully.

And I know, of course, that this is not a deliberate assault. […]

But for those of us who lived through the death of loved ones, or spent extended time in the hospital, or were hit by divorce or losing a job or any one of a hundred crises, we might not want another look at this past year.

Empathy isn’t a corporate slogan | Om Malik

Well, That Escalated Quickly | Eric’s Archived Thoughts

Read Full Post »

obama_hour_of_code

[President Obama Meets with Students at an “Hour of Code” Event | The White House

海の向こうではオバマ大統領が子供たちにまじってコンピュータサイエンス教育週間の「Hour of Code」に参加した。

初めてのコンピュータコードだそうだ・・・

President Obama writes his first line of Javascript | Mashable

     *     *     *

初めてコンピュータコードを書いたオバマ大統領

President Obama writes his first line of Javascript

大統領は Javascript でプログラムコードを書いた。また「アナと雪の女王」で Elsa の動きを表わすのに使われたグーグルのプログラム言語「Blocky」でもコードを書いた。

The president wrote his code in Javascript, as well as Google’s “Blocky” programming language — it made Elsa from Frozen move from one point to another.

大統領は正しくプログラミングできたようだ。ただその説明はいささか回りくどいものだった。

Although the president’s coding was apparently correct, his explanation of code seemed a little convoluted.

「このゼロとワンという2つの数字 — イエスかノーという意味だけど、これらが電子的メッセージに翻訳されてコンピュータで動くんだよ」と。

“You take these zeroes and ones, you take two numbers — yes or no — those can be translated into electrical messages that run through the computer,” he said.

幸いなことに Code.org の設立者 Hadi Partovi が代わって説明してくれた。

Thankfully, Code.org’s co-founder Hadi Partovi was helpful enough to explain it for him.

「あなたはコンピュータに命令したのです。この命令は英語によく似ています。」

“You just give the computer commands and they’re much closer to English.”

     *     *     *

なんとも微笑ましい光景だ。

プログラミングを基礎教育に取り入れようとする試みに大統領が参加すること自体が羨ましい・・・

     *     *     *

追記:Hour of Code の参考資料

Hour of Code に併せて iTunes Store では様々なプログラミングリソースが公開されている。この機会にぜひ覗いてみよう。

Read Full Post »

code

[Hour of Code:アップル

コードを学ぼう。世界を変えよう。

Learn to code. Change the world.

12月8日から14日はコンピュータサイエンス教育週間です。期間中Appleは各国のApple Storeで行うワークショップや様々なスペシャルイベントを通じて、コンピュータサイエンス教育を推進するCode.orgをサポートします。12月11日には、コンピュータプログラミングの基礎を学べる1時間の無料ワークショップ「Hour of Code」を開催しますので、ぜひご参加ください。

Computer Science Education Week is December 8–14. We’re supporting Code.org by hosting workshops and other special events at your local Apple Store. Join us on December 11 for the Hour of Code, a free one-hour introduction to the basics of computer programming.

     *     *     *

プログラミングの基礎を学べる1時間の無料ワークショップ「Hour of Code」がアップルストアで開催

Apple to host workshops for Hour of Code at Apple Retail Stores around the world | The Loop

世界各地のアップルストアで、今年で2回目となる「Hour of Code」ワークショップが開催される。

これは幼稚園から高校までの児童・生徒(K-12)を対象とする「コンピュータサイエンス教育週間:Computer Science Education Week」(12月8日〜14日)に併せて開催されるもので、あらゆるひとにプログラミングの基礎を学んでもらおうとする試み。

Hour of Code の活動は、特に女子生徒や少数民族を念頭において、2014 年末までに1億人の児童・生徒に広げることを目標としており、Code.org の活動をサポートするものだ。

コンピュータサイエンス教育週間の期間中は、世界各地のアップルストアでワークショップやスペシャルイベントが開催される。

・Apple Store, Ginza:東京 — 12月8日(月)午後7時

Flask 小川秀子氏、堀内敬子氏によるワークショップ

・Apple Store, Shinsaibashi:大阪 — 12月12日(金)午後7時

BASE 鶴岡裕太氏によるワークショップ

詳しくはこちら

Read Full Post »

swift-hero

[新言語 Swift:image

Cocoa の優れた教師と考えられている Aaron Hillegass の意見とそれに対する反論が興味深い・・・

Big Nerd Ranch: “iOS Developers Need to Know Objective-C” by Aaron Hillegass: 11 June 2014

     *     *     *

iOS デベロッパにとって Objective-C の知識は必要だ

アップルが Swift を発表したとき、少なからぬひとびとが「万歳! これで Objective-C を習わなくても iOS デベロッパになれる!」というのを聞いた。そんなひとに3つのことをいいたい。

When Apple announced Swift, I heard a few people say “Hurray! Now I can be an iOS developer without learning Objective-C!” I have three messages for these people:

・もし iOS デベロッパになりたいのなら、やはり Objective-C の知識が必要だ
・Swift は Objective-C より学習がカンタン
・いったん Objective-C を習得すれば、Swift の学習がカンタンになる

– If you want to be an iOS developer, you will still need to know Objective-C.
– Objective-C is easier to learn than Swift.
– Once you know Objective-C, it will be easy to learn Swift.

しかしはっきり告白しておきたいが、Swift に対して自分は大きな愛情を抱いている。シンタックスは美しい。Swift のコンパイラはたくさんエラーを見つけてくれる。みんなが Swift でコードを書くようになったらアプリの信頼性は格段に増すだろう。enum 型コンストラクタは素晴らしい。iOS および Mac OS X エコシステムにとって Swift は大きな前進だ。それはさりながらしかし・・・

Before I proceed, let me preface this with a confession of love for Swift. The syntax is lovely. The Swift compiler will catch so many errors for us; I’m certain that when everyone is coding in Swift the reliability of apps will improve considerably. The enum construct is gorgeous. Swift is a major step forward for the entire iOS and Mac OS X ecosystem. But…

     *     *     *

まず John Gruber のコメント。

Daring Fireball: “Aaron Hillegass: ‘iOS Developers Need to Know Objective-C’” by John Gruber: 11 June 2014

時間の問題だ

第1点と第3点については合意するが、第2点については確信が持てない。真の問題は時間なのだ。現在の時点でいえば、本格的な Mac および iOS デベロッパが Objective-C の知識を必要とすることは議論の余地がないだろう。しかし1年後はどうか? 2年後、5年後はどうか? いずれかの時点で、「Objective-C を学ぶ必要はあるのか?」という問いに対する答えは「ノー」になるだろう。それがいつかは分からないけれど・・・

Points 1 and 3 I agree with. Point 2, I’m not so sure about. But the real question is time. I don’t think anyone would dispute that a serious Mac or iOS developer needs to know Objective-C today. But what about a year from now? Two years? Five? At some point, the answer to “Do I need to learn Objective-C?” will be “No.” I don’t know when that will be.

自分は Swift の先行きについてには楽観的だ。それは新規のデベロッパに対するアピールが大きいからではない(それもいずれは利いてくるだろうが)。そうではなく、すでに Objective-C とアップルのフレームワークを熟知した膨大な数のデベロッパにアピールすると思うからだ。

I’m bullish on Swift’s uptake not because I think it will appeal to new developers (although eventually I think that will help too), but because I think it appeals to the huge base of developers who already know Objective-C and Apple’s frameworks.

     *     *     *

その点について Marco Arment がもっと詳しく述べている。

Marco.org: “iOS Developers Need to Know Objective-C” by Marco Arment: 12 June 2014

数年もすれば Swift だけの時代に

Aaron Hillegass の意見に同意するが、それはあくまで短期間での話だ。今後1、2年の iOS 開発については、多分 Objective-C の知識を持つべきだろう。しかし数年後には Swift だけでも問題なくなるだろう。

I agree with Aaron Hillegass, but only short-term. If you want to develop for iOS in the next year or two, you should probably know Objective-C. But in a few years, I don’t think it’ll matter if you only learn Swift.

     *     *     *

今後数年で大きく変化

Swift はまだ若い言語なのでアップルでさえ Swift コードを含むアプリはたったひとつしか出していない。WWDC アプリがそうだ。先週多くのアップルエンジニアの話を聞いたが、私たち同様彼らも Swift の存在すら知らなかった。Swift は最先端の言語なので、今後数年で大きく変化するだろう。更に重要なことは、フレームワークも一般に受け入れられている最適手法も今後10年間で劇的に変わるだろうということだ。時がたって、今年書かれた Swift コードを後から振り返ればゾッとするだろう。

Swift is so young that even Apple has only shipped one app — the WWDC app — that contains any Swift code so far. I talked to many Apple engineers last week who hadn’t even learned of Swift’s existence until the rest of us did. The language is bleeding-edge and likely to change rapidly over the next couple of years, and more importantly, the frameworks and commonly accepted best practices are likely to change dramatically over the next decade. In time, we’re going to look back in horror at the Swift code we write this year.

     *     *     *

Objective-C は C や C++、アセンブリー言語並みになる

だからといって Objective-C の理解が iOS デベロッパにとって長期間必要条件だという意味ではない。今でも多くのひとが C についてほとんど知らないまま(C++ については何も知らないまま)Objective-C だけでたくさんのアプリを毎日のように書いている。

But that doesn’t mean that Objective-C proficiency will be a requirement for iOS developers for very long. Plenty of people write plenty of apps every day in Objective-C without knowing most of C or any C++.

いずれ Objective-C の知識が C や C++、アセンブリー言語のそれと同じようになる時期がくるだろう。それはアプリケーションコードの下部にある配管構造のように、殆どの現役デベロッパにとって知る必要もなければ、いじる必要もないものになるだろう。5年もすれば間違いなくそうなると思う。もしかしたら2、3年後かも知れない。

The time will come when knowing Objective-C will be like knowing C, C++, or assembly — it’ll be a plumbing layer beneath your application code that almost all working developers will never need to know or interact with. And I bet that time is less than five years away — possibly just two or three.

     *     *     *

Swift だけで済む時代は意外に早く来るかもしれないということか・・・

★ →[原文を見る:Original Text

Read Full Post »

BpY05PdCEAA_pET

[Beats のヘッドホンをつけた Marco:photo

Tumblr や Instapaper を開発した Marco Arment が、Brent Simmons とは違ってしばらく Swift については静観したいといっている。

Marco.org: “FCModel and Swift” by Marco Arment: 08 June 2014

     *     *     *

オープンソースの FCModel

Objective-C で何年も書いてきて、やっと言語の理解とスキルに自信が持てるようになった。そして自分は SQL に近い Core Data の軽量代替版としてとして「FCModel」(多目的一般レイヤーモデル)をオープンソースで出した。数少ないが確かなユーザーに支えられ、貴重な貢献やバグフィックスをもらっている。

After years of writing Objective-C, I was finally confident enough in my skills and understanding of the language to write and open-source a general-purpose model layer, FCModel, as a lightweight Core Data alternative that’s closer to SQL. It has attracted a small but solid audience, with many invaluable contributions and bugfixes.

一見したところ FCModel は Swift でもなんとか動くようだ。しかし自分としては近い将来これを移植する計画はない。

Apparently, it somewhat works with Swift. But I don’t plan to port it in the near future.

     *     *     *

しばらく経験を積みたい

Swift は新しい言語で、振る舞いも新しく、そして最も重要なことだが新しい規格と可能性を持った言語だ。自分としては Swift の FCModel のようなものが出来るようになるまで知識と経験を積みたい。しかし:

Swift is a new language with new behaviors and, most importantly, new standards and expectations. I expect to accumulate enough Swift knowledge and experience to be able to make something like FCModel for it, but:

・少なくとも1年はこの問題に取り組む自信も時間も自分にはないだろう
・旧来システムと上位互換性のない変更になることは間違いなさそうだ
・Swift の規格とスタイルに合わせるためには FCModel の使用、振る舞い、および実装について大幅な変更を加える必要があるかもしれない

– I probably won’t have the confidence (or time) to tackle that problem for at least a year.
– I’d almost certainly make backwards-incompatible changes.
– FCModel’s usage, behavior, and implementation may require major changes to fit into Swift’s standards and style.

     *     *     *

それまでの間は

それまでの間は、SwiftModel(名前は何であれ)は必要はないかもしれない。iOS 8 および 10.10 にはいくつかの重要な利点があるので、それさえ使えばいいかもしれない。もしかしたら誰かがそれまでに Swift のための優れた SQLite 実装モデルを出すかもしれない。

By that time, SwiftModel (or whatever) may not need to exist. Core Data in iOS 8 and 10.10 matched some of its major advantages, so maybe we’ll all just use that. Or maybe someone else will come up with a better SQLite model implementation for Swift by then.

     *     *     *

すぐ Swift への移植するつもりはない

自分は FCModel で膨大なアプリを書いている。だからしばらくは Objective-C にこだわって、はっきりと分かる形で互換性のある Swift への移植をすぐやるつもりはない。

I just wrote a huge app with FCModel, so I’m sticking with it for a while in Objective-C, but I don’t intend to port it to Swift soon, or in a recognizable or compatible form.

     *     *     *

過去に蓄積のあるものほど移行には慎重になるということか・・・

デベロッパにとっては悩み多き季節になりそうだ。

★ →[原文を見る:Original Text

Read Full Post »

flapp-bird-swift

[Flappy Bird クローン:image

新しいプログラミング言語 Swift の関心が高まっている。

アップルのプログラマーが Flappy Bird のクローンを4時間で書いたそうだ・・・

iMore: “Developer builds Flappy Bird clone in Swift with 4 hours experience” by John Callaham: 04 June 2014

     *     *     *

Swift で簡単にゲームが作れる

WWDC 2014 キーノートでアップルの新しいプログラミング言語 Swift が発表された。アップルのプログラマーのひとりが人気のモバイルゲーム「Flappy Bird」のクローンを Swift で書いた。Swift を使えば簡単にゲームが作れるというワケだ。

As part of its WWDC 2014 keynote address, Apple introduced Swift, their new programming language. Now one of the company’s own programmers has created a clone of the popular mobile game Flappy Bird with Swift to show how easy it is to make a game with the language.

     *     *     *

4時間で Flappy Bird のクローン

プログラマーの名前は Nate Murray。月曜日に公式に発表されるまで Swift の経験はまったくなかったという。彼は Flappy Bird のクローンを書きはじめ、FlappySwift と名付けた。たった4時間で実働バージョンが出来たという。そのソースコードは GitHub で公開されている。

The programmer, Nate Murray, claims he had no prior experience in using Swift before Apple officially announced the language on Monday. He then starting working on the Flappy Bird clone, which he naturally calls FlappySwift, and said he was able to create a working version of the game in just four hours. He’s released the source code for the game on the GitHub site.

     *     *     *

Swift のオンラインコース

Swift の最終バージョンは、OS X 10.10 および iOS 8 と一緒に今秋にリリースの予定だ。近い将来 Murrary はオンラインの Swift 開発コースを提供する予定だ。

Apple plans to release the final version of Swift sometime this fall, alongside the launch of OS X 10.10 and iOS 8. Murrary plans to offer an online Swift development course in the near future.

     *     *     *

楽しみ・・・

それまではこの FlappySwift で勉強しよう。

★ →[原文を見る:Original Text

Read Full Post »

Older Posts »