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

Kotlin In the real world

Kotlin In the real world

- What you should know before starting a Kotlin project -

Android Makers Paris 2017

Rémi Pradal

April 13, 2017
Tweet

More Decks by Rémi Pradal

Other Decks in Programming

Transcript

  1. By OCTO & The Refiners
    What you should be aware of before
    starting a Kotlin project
    Rémi Pradal
    Android Makers 2017
    K TLIN IN
    THE REAL
    WORLD

    View Slide

  2. Android developer discovering Kotlin – Circa 2015

    View Slide

  3. View Slide

  4. CAN I USE KOTLIN ON A
    LEGACY PROJECT?
    IS KOTLIN
    MATURE ENOUGH
    FOR A BIG PROJECT?
    MULTIPLE LANGUAGES MIX
    BEST PRACTICES?

    View Slide

  5. By OCTO & The Refiners
    Testability

    View Slide

  6. “Design and document for inheritance
    or else prohibit it”
    - Effective Java Item 17, Joshua Bloch

    View Slide

  7. KOTLIN DESIGN ENFORCES
    « FINAL BY DEFAULT »
    DESIGN
    How can I create my mock easily ?

    View Slide

  8. OPEN WHAT
    YOU NEED
    TO MOCK
    Introduces test
    related characteristics
    in production code
    OPEN ALL
    THE THINGS
    Useful for POKO
    used by a library
    Not specific to the
    test workspace
    USE
    INTERFACES
    Complies with the
    interface segregation
    principle
    Can add many
    boilerplate code

    View Slide

  9. By OCTO & The Refiners
    Code quality tooling

    View Slide

  10. View Slide

  11. By OCTO & The Refiners
    Interoperability

    View Slide

  12. Great Interoperability
    Usable today in a legacy project. But...

    View Slide

  13. COMPLEXIFY
    ONBOARDING
    DIFFERENT LANGUAGE
    PARADIGMS
    LANGUAGE
    MULTIPLICITY
    IN A PROJET
    MAY LEAD TO
    INTEROPERABILITY
    BOILERPLATE
    ISOLATE THE
    DIFFERENT CODE
    BASES PER FEATURE
    OR TECHNICAL
    LAYER

    View Slide

  14. By OCTO & The Refiners
    Language longevity

    View Slide

  15. KOTLIN IS NOT
    GOOGLE’S SWIFT

    View Slide

  16. TAKEAWAYS
    Embrace
    language’s
    design
    specificities
    Code quality
    tools are not
    as
    advanced
    as Java’s
    Try to keep
    your
    codebase
    coherent
    when mixing
    Java & Kotlin
    Remember
    you are not
    using
    Android’s
    official
    language

    View Slide

  17. View Slide