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.

of

Why Kotlin makes Java null and void Slide 1 Why Kotlin makes Java null and void Slide 2 Why Kotlin makes Java null and void Slide 3 Why Kotlin makes Java null and void Slide 4 Why Kotlin makes Java null and void Slide 5 Why Kotlin makes Java null and void Slide 6 Why Kotlin makes Java null and void Slide 7 Why Kotlin makes Java null and void Slide 8 Why Kotlin makes Java null and void Slide 9 Why Kotlin makes Java null and void Slide 10 Why Kotlin makes Java null and void Slide 11 Why Kotlin makes Java null and void Slide 12 Why Kotlin makes Java null and void Slide 13 Why Kotlin makes Java null and void Slide 14 Why Kotlin makes Java null and void Slide 15 Why Kotlin makes Java null and void Slide 16 Why Kotlin makes Java null and void Slide 17 Why Kotlin makes Java null and void Slide 18 Why Kotlin makes Java null and void Slide 19 Why Kotlin makes Java null and void Slide 20 Why Kotlin makes Java null and void Slide 21 Why Kotlin makes Java null and void Slide 22 Why Kotlin makes Java null and void Slide 23 Why Kotlin makes Java null and void Slide 24 Why Kotlin makes Java null and void Slide 25 Why Kotlin makes Java null and void Slide 26 Why Kotlin makes Java null and void Slide 27 Why Kotlin makes Java null and void Slide 28 Why Kotlin makes Java null and void Slide 29 Why Kotlin makes Java null and void Slide 30 Why Kotlin makes Java null and void Slide 31 Why Kotlin makes Java null and void Slide 32 Why Kotlin makes Java null and void Slide 33 Why Kotlin makes Java null and void Slide 34 Why Kotlin makes Java null and void Slide 35 Why Kotlin makes Java null and void Slide 36 Why Kotlin makes Java null and void Slide 37 Why Kotlin makes Java null and void Slide 38 Why Kotlin makes Java null and void Slide 39 Why Kotlin makes Java null and void Slide 40 Why Kotlin makes Java null and void Slide 41
Upcoming SlideShare
What to Upload to SlideShare
Next

0 Likes

Share

Why Kotlin makes Java null and void

Why using Kotlin instead of Java, especially for Android, is a great idea. Presented at Brighton Mobile Feb 2018

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Why Kotlin makes Java null and void

  1. 1. Kotlin makes Java Null and Void @chetbox
  2. 2. Who is this guy?
  3. 3. Firebase +
  4. 4. You can use Kotlin in production today
  5. 5. fun main(args: Array<String>) { println("Hello, world!") }
  6. 6. Optional types
  7. 7. var name: String? = … val name: String = …
  8. 8. println(name!!) println(name.length)
  9. 9. @NonNull @Nullable
  10. 10. Classes
  11. 11. class Foo { }
  12. 12. class MyModel( foo: Int, val bar: Int, private var baz: Int )
  13. 13. data class LatLng( val lat: Double, val lng: Double )
  14. 14. Java interop
  15. 15. class Foo { companion object { fun bar() { … } } }
  16. 16. // From Kotlin Foo.bar()
  17. 17. // From Java Foo.Companion.bar()
  18. 18. Functional programming
  19. 19. listOf(1 to "one", 2 to "2", null) .filterNotNull() .map { (a, b) -> "$a" == b }
  20. 20. inline fun log(f: () -> String) { println(“${time()}: ${f()}“) ) log(readMsg) log { “Got value: ${readMsg()}” }
  21. 21. Extension functions
  22. 22. fun List<Location>.totalDistance() = zipWithNext() .fold(0f) { total, (current, next) -> total + current.distanceTo(next) }
  23. 23. How do I convert my Java project to Kotlin?
  24. 24. IntelliJ is your Sensei Converting “var” to “val” “when” clauses Optional types Idiomatic Kotlin
  25. 25. It looks like you’re pasting Java code. Shall I convert it to Kotlin for you?
  26. 26. Kotlin > Java Shorter code ✂ Null safety Easy Java interop ↔ First-class IDE support from IntelliJ Lot of libraries are now being written in Kotlin Official Android examples in Java and Kotlin
  27. 27. Kotlin vs. Swift
  28. 28. func double( _ numbers: [Int] ) -> [Int] { return numbers.map { 2 * $0 } } let numbers: [Int] = 1 ... 10 print(double(numbers))
  29. 29. fun double( numbers: List<Int> ) : List<Int> { return numbers.map { 2 * it } } val numbers = 1 .. 10 println(double(numbers))
  30. 30. fun double( numbers: List<Number> ) = numbers.map { 2 * it } val numbers = 1 .. 10 println(double(numbers))
  31. 31. val numbers = 1..10 println(numbers.map { 2 * it })
  32. 32. Learn more Talk: Kotlin in Production Talk: Life is Great and Everything Will Be Ok, Kotlin is Here Swift is like Kotlin Christina Lee - Pinterest Jake Wharton - Google Kotlinlang Slack Fragmented podcast Talking Kotlin podcast
  33. 33. Questions? Or find me on Twitter: @chetbox

Why using Kotlin instead of Java, especially for Android, is a great idea. Presented at Brighton Mobile Feb 2018

Views

Total views

524

On Slideshare

0

From embeds

0

Number of embeds

12

Actions

Downloads

0

Shares

0

Comments

0

Likes

0

×