111: Effective Java v3 – Item #5 – Prefer Dependency Injection to Hardwiring Resources

In this mini-fragment episode, Donn talks about Item #5 of the Effective Java (Third Edition) book – Prefer Dependency Injection to Hardwiring Resources.

Please note, this episode references the third edition of the Effective Java book that recently came out. Previously we were doing the entire series on version 2, but we are now upgrading to version 3 of the book. We will not be re-doing any of the existing lessons, but if one was inserted in the mix, then we will do that lesson.

This is the case with Item #5. We did Item #5 previously for v2 of the book, but v3 introduced a new Item 5 (and bumped the previous Item 5 up to 6).

TLDR; Item #5 is new in the third edition of the Effective Java book. So listen closely. :)

Listen on:

Download directly

Links

Sponsors

  • Mapbox – Android developers don’t have to settle for a default same-map-no-matter-what option in their Android app. Mapbox offers complete map design control, allowing you to create beautiful custom maps to meet the needs of your Android users.

Check them out today at mapbox.com/android

Contact

110: BuddyBuild and CI/CD services

In this episode of Fragmented, we talk about CI, CD and CD services. That’s Continuous Integration, Continuous Delivery, and Continuous Deployment. BuddyBuild a beloved 3rd party service of ours (and previous sponsor) is sunsetting their Android service, so Donn and KG discuss alternatives and the options they’ve been keeping an eye on.

Listen on:

Download directly

Show Notes

Differences between CI/CDs services

differences between CI/CD/CD

Options for CI Services

Sponsors

Contact

109: Learning Kotlin – Sequences the new Iterables

In this episode of Fragmented, we go back to learning some Kotlin and look at the Iterable like data structure introduced called “Sequences”. What is a sequence? How is it different from Iterable? When should I use it?

Download directly

Show Notes

Eager/Lazy

Eager evaluation:

val lst = listOf(1, 2)
val lstMapped: List<Int> = lst.map { print("$it "); it * it }
print("before sum ")
val sum = lstMapped.sum()

// prints "1 2 before sum"

Lazy evaluation:

val seq = sequenceOf(1, 2)
val seqMapped: Sequence<Int> = seq.map { print("$it "); it * it }
print("before sum ")
val sum = seqMapped.sum()

// prints "before sum 1 2"

Source stackoverflow.com answer

Intermediate and terminal operations

Notice that at each chain operation, a new temporary list is created:

data class Person(val name: String, val age: Int)

fun main(args: Array<String>) {
    val people = 
        listOf(Person("Chris Martin", 31), 
               Person("Will Champion", 32),
               Person("Jonny Buckland", 33),
               Person("Guy Berryman", 34),
               Person("Mhris Cartin", 30))

    println(people
            .filter { it.age > 30 } // new temp. list
            .map {                  
                it.name.split(" ").map {it[0]}.joinToString("")
            }  // new temp. list
            .map { it.toUpperCase() }) // new temp. list
}

Using a sequence:

println(people
        .asSequence()  // convert to sequence
        .filter { it.age > 30 } // lazy eval (intermediate op)
        .map {                  
            it.name.split(" ").map {it[0]}.joinToString("")
        }  // lazy eval (intermediate op)
        .map { it.toUpperCase() }  // lazy eval (intermediate op)
        .toList() // terminal operation
       )

Without a terminal operation, Sequences won’t print anything:

val seq = sequenceOf(1, 2, 3)
println(seq) // prints address
println(seq.toList()) // [1, 2, 3]

You can’t pick an index from a sequence:

println(seq[0]) // throws ERROR "No get method providing array access"
println(seq.toList()[0]) // 1

Sponsors

Contact

108: State of React Native for Android with Ryan Salva

In this episode Donn talks to React Native magician Ryan Salva. React native and cross-platform development is typically one of our most requested topics so we kick the new year off with React Native. Ryan and Donn dive into the state of React Native today for mobile development, how it’s matured since inception, what kinds of apps are suited to be built with React Native, what kinds aren’t, what are the benefits to using React Native, some tips like pushing updates without having to upload to the play store every time and so much more.

Listen on!

Download directly

Show Notes

Misc

Noteworthy quotes from this episode:

As developers, we are empowered to break things; it’s our god given right!

.

Javascript is a beautiful disaster

Sponsors

Contact