Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Scalaと過ごした5ヶ月間

3,245 views

Published on

市ヶ谷Geek★Night #3の発表資料です
http://ichigayageek.connpass.com/event/18810/

Published in: Software
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Scalaと過ごした5ヶ月間

  1. 1. Scalaと過ごした5ヶ月間 Demand Side Science(株) 岡田遥来
  2. 2. もくじ • 自己紹介 • Demand Side Science(株)について • Scalaの学習 • Scalaと仲良くなるためにやったこと
  3. 3. $ whoami • 岡田遥来 • Scalaエンジニア • 2015/03∼ Demand Side Science(株) • 前職ではC#(Windowsアプリ), Railsなど • 趣味でiPhoneアプリ
  4. 4. $ whoami • ジャズトランペット • 「カンタス村田とサンバマシーンズ」で
 FUJI ROCK’10 ROOKIE A GO-GO出場
  5. 5. DSSについて • 2012/11 設立 • 社員10名 • 3PAS, アドベリ, DSPなど
  6. 6. DSSの開発環境 • すべてのプロダクトでScalaを使用 • Webアプリ(Play, Spray) • 入札サーバ(Finagle) • ログ集計など各種バッチ
  7. 7. DSSの開発環境 • IDE • IntelliJ IDEA : 7名 • Eclipse(Scala IDE) : 2名 • Emacs + Ensime : 1名 _人人人人人_ > Ensime <  ̄Y^Y^Y^Y ̄
  8. 8. Scala • Martin Odersky教授により設計 • オブジェクト指向 • 関数型のエッセンス • JVMで動く • Javaのライブラリをシームレスに使える
  9. 9. Scala • アドテク業界で採用例が多い印象 • Cyber Agent, Smart News, 
 Septeni, Fringe81, … • 競合言語 • Java, Groovy, Ruby, …
  10. 10. Scalaの会社に入って • Scala未経験からのスタート • シンタックスシュガーが多く、一通り読める ようになるのに苦労
  11. 11. 例. Dispatchのコード import dispatch._, Defaults._ val svc = url(“http://api.hostip.info/country.php") val country = Http(svc OK as.String) • HTTPクライアント • http://dispatch.databinder.net/Dispatch.html
  12. 12. import dispatch._, Defaults._ val svc = url(“http://api.hostip.info/country.php") val country = Http(svc OK as.String) もやっとする svcはReq型だが、ReqにOKメソッドはない スペース区切りで3つキーワードが並んでいる
 どう結合してるのか一見わかりづらい
  13. 13. import dispatch._, Defaults._ val svc = url(“http://api.hostip.info/country.php") val country = Http(svc OK as.String) 解説 RequestHandlerTupleBuilderにOKメソッ ドが定義されている as.Stringを引数としてOKメソッド呼び出し • 引数が一つのメソッドは、ドットと括弧無しで呼びだせる(中置記法) • ReqからRequestHandlerTupleBuilderへのimplicit conversionが行われている
  14. 14. Scalaの学習に使った資料 • Scala School! • Ninety-Nine Scala Problems
  15. 15. Scala School! • http://twitter.github.io/scala_school/ • http://seratch.hatenablog.jp/entry/ 20120218/1329531294 (瀬良さんによる日本語訳) • コンパクトにまとまっている • 最低限のScalaの言語仕様を一通りおさえられる
  16. 16. Scala School!
  17. 17. Ninety-Nine Scala Problems • http://aperiodic.net/phil/scala/s-99/ • 再帰の練習によい
  18. 18. Ninety-Nine Scala Problems object P05 { def reverse[A](lst: List[A]): List[A] = { @tailrec def reverseIter[A](l: List[A], result: List[A]): List[A] = l match { case Nil => result case head :: tail => reverseIter(tail, head :: result) } reverseIter(lst, Nil) } }
  19. 19. もっとScalaと仲良くなる
  20. 20. ScalaにはREPLがある • REPL(Read–eval–print loop) • 対話的にコードを実行する環境 • Ruby(irb)とかPythonとかLISPにもある scala> final val b = "b" b: String("b") = b scala> def foo(c: b.type) = c foo: (c: String("b"))String scala> foo("c") <console>:10: error: type mismatch; found : String("c") required: String("b") foo("c") ^
  21. 21. みんなでREPL • 社内のチャットボットに
 ScalaのREPLを導入(弊社水谷)
  22. 22. よかったこと • 「これうまい書き方ある?」みたいな議論が
 盛んになった
  23. 23. みんなでベンチ • amemiyasanはベンチマークもとれる • 業務中にベンチマークを競ったり
  24. 24. 結果 • とくにコレクションの理解が進んだ • 性能特性(List, Vector, Queue, …) • 「推測するな、計測せよ」の文化が根付いた
  25. 25. あめみやさんデモ
  26. 26. まとめ • Scalaは仲良くなると面白い • 言語機能が多いので、色々覚えてくると組 み合わせる楽しみがある • Scalaと(会社の人とも)仲良くなるには、みん なでREPLおすすめです
  27. 27. ご清聴ありがとうございました Demand Side Scienceは
 本物のScalaプログラマを募集しています
 
 recruit@demand-side-science.jp

×