Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scala vs Ruby

Scala vs Ruby

2015-06-25 第2回SpeeeTeckParty LT資料

Hirokazu Nishioka

June 25, 2015
Tweet

More Decks by Hirokazu Nishioka

Other Decks in Programming

Transcript

  1. def fizzbuzz(i: Int): String = (i % 3, i %

    5) match { case (0, 0) => "FizzBuzz" case (0, _) => "Fizz" case (_, 0) => "Buzz" case _ => i.toString } // ίϯύΠϧOK ! def fizzbuzz(i: Int): String = (i % 3, i % 5) match { case (0, _) => "Fizz" case (_, 0) => "Buzz" case (0, 0) => "FizzBuzz" case _ => i.toString } [error] /src/main/scala/App.scala:5: unreachable code [error] case (0, 0) => "FizzBuzz" ScalaͷίϯύΠϧ࣌νΣοΫೳྗʢҰྫʣ ※ "-Xfatal-warnings"ίϯύΠϥΦϓγϣϯ࢖༻
  2. ΞυϗοΫͳػೳ௥Ճ • Ұੲલ͸ΦʔϓϯΫϥε(Ruby)ͷಛݖͩͬͨ • Scala΋Ͱ͖ΔΑʂ → ܕΫϥε (+ ϚΫϩ) •

    ϥΠϒϥϦͷػೳ͕ίʔυʹγʔϜϨεʹ༥ ߹͢Δ • ϦϑΝϨϯε͕ݟ೉͍͆