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

Droidcon Berlin: Hype Driven Development

Droidcon Berlin: Hype Driven Development

Ever wondered what it would take to combine all the experimental features of a language you love (Spoilers... It's Kotlin!) into one big bundle?

I'm a lover of new and shiny stuff, so let me share with you my experience of using everything shiny, and new, in my pet project, to show you how to *not* do all the things you might want to do with yours!

JetBrains Compose for Desktop, Unstable Coroutines APIs, version catalogues, Gradle composite builds, multiplatform navigation support, multiplatform paging, GraphQl, Firebase Cloud Functions, Molecule, Mosaic, what could go wrong?!

This isn't a fairytale story, when making use of unstable technology, it's not always tested with other unstable technologies; I'm going to tell you of all the things I could have done better, so that you don't need to make the same mistakes!

Ash Davies

July 06, 2022
Tweet

More Decks by Ash Davies

Other Decks in Technology

Transcript

  1. Ash Davies
    Senior Android Developer @ Snapp Mobile
    Android & Kotlin GDE Berlin
    Droidcon Berlin - Jul 22’ 󰎲 ☀ 🍻
    Hype Driven Development
    How I learned to stop worrying and love the failures
    @askashdavies

    View Slide

  2. “Be careful not to do that thing I
    knowingly did despite my own advice”
    - Every one of my talks, ever.

    View Slide

  3. Hype Driven Development
    Decision-Making
    @askashdavies

    View Slide

  4. Hype Driven Development
    Design-Decisions
    @askashdavies

    View Slide

  5. ● Language: Kotlin, Java, Scala, or Swift
    ● Dependencies: Dagger, DI, or Koin
    ● Threading: Coroutines, RxJava, or Java
    ● Serialization: Gson, Moshi, Jackson, or KotlinX
    ● Network: Retrofit, OkHttp, or Ktor
    ● Image Loading: Coil, Glide, or Picasso
    Design Decisions
    Common Tools

    View Slide

  6. Decision Paralysis
    Hype Driven Development

    View Slide

  7. Advantages:
    ● Low engineering complexity.
    ● Staffing needs are minimal
    ● Timeline is manageable
    Disadvantages:
    ● Doesn’t solve the problem
    Design Decisions
    Option 1: Do Nothing

    View Slide

  8. Decision Fatigue
    Hype Driven Development

    View Slide

  9. How I learned to stop worrying and love the failures
    Hype Driven Development
    @askashdavies

    View Slide

  10. ● Stakeholder influence, feature driven requirements
    ● Reaction to issues in the codebase (ie. tech debt)
    ● New tech, promises faster, easier solutions
    ● Not limited to engineering (CEO Driven Development)
    Hype Driven Development
    Decision Making

    View Slide

  11. Law of the Instrument
    “Birmingham Screwdriver”
    “I suppose it is tempting, if the only tool
    you have is a hammer, to treat everything as
    if it were a nail.”
    - Abraham Maslow

    View Slide

  12. ● Enticement to use a product or service, usually monetised for enterprise
    ● Seemingly benevolent, promises developer interests
    ● Trustworthy whilst goals are aligned
    Hype Driven Development
    Community Influence

    View Slide

  13. ● Heavy social media utilisation (Twitter, Reddit, etc)
    ● Human psychology (Argumentum ad novitatem)
    ● Promise to make life easier, better, faster, stronger…
    Hype Driven Development
    Community Influence

    View Slide

  14. ● Dependent on third party development commitment
    ● Libraries sometimes need years to evolve and mature
    ● Very difficult to revert if results are undesired
    ● More likely to produce poor quality code
    ● Often new learning curve introduced
    ● Investment of unknown future
    Hype Driven Development
    Risks of using immature software

    View Slide

  15. Hype Driven Development
    Risk-Management
    @askashdavies

    View Slide

  16. @Deprecated(
    message = "CoroutineScope.rxCompletable is deprecated in favour of top-level rxCompletable",
    level = DeprecationLevel.ERROR,
    replaceWith = ReplaceWith("rxCompletable(context, block)")
    )
    public fun CoroutineScope.rxCompletable(
    context: CoroutineContext = EmptyCoroutineContext,
    block: suspend CoroutineScope.() -> Unit
    ): Completable = rxCompletableInternal(this, context, block)
    Hype Driven Development 󰤇
    Risk Management

    View Slide

  17. @RequiresOptIn(message = "This API is experimental. It may be changed in the future without notice.")
    @Retention(AnnotationRetention.BINARY)
    @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
    annotation class MyDateTime // Opt-in requirement annotation
    @MyDateTime
    class DateProvider // A class requiring opt-in
    Hype Driven Development 󰤇
    Risk Management

    View Slide

  18. ● Annotations, experimental, deprecated, Opt-In
    ● Coding for disposability
    ● Isolated API surface
    ● Coding workshops
    ● Feasibility investigations (timeboxed)
    Hype Driven Development
    Risk management

    View Slide

  19. Hype Driven Development
    Solutions looking for a problem

    View Slide

  20. ● New technology might not be appropriate for your project
    ● Be cautious of finding problems that don’t exist
    ● If it ain’t broke, don’t fix it.
    Hype Driven Development
    Solutions looking for a problem

    View Slide

  21. YAGNI
    You Aren’t Going to Need It

    View Slide

  22. ● Early adoption of inevitable software (sometimes)
    ● Contribute bug reports or resolutions upstream
    ● New features provide potential market growth
    ● Knowledge sharing in the development community
    Hype Driven Development
    What is the benefit of experimental

    View Slide

  23. Inevitability
    Hype Driven Development

    View Slide

  24. ● Depends on company and team priorities
    ● Development community benefits everybody
    ● Early adopters guide and provide contributions
    ● Development cost absorption
    Hype Driven Development
    Is it worth it?

    View Slide

  25. ● Not a good idea to follow hype in a production codebase
    ● Still eager to try out new technologies
    Hype Driven Development
    How to get away with it anyway…

    View Slide

  26. ● Many engineers maintain a playground repository
    ● Many examples of new tech in Google repos
    ● Many open source projects needing maintainers
    ● Contribute to a project that can make use of it
    Hype Driven Development
    Open Source to the rescue!

    View Slide

  27. ● Majority of mobile applications are a user friendly facade for API data
    ● There are many open APIs available providing niche data sets
    Hype Driven Development
    Use cases for playground project…

    View Slide

  28. Case Study
    🧪 github.com/ashdavies/playground
    # ae2d602 | AGP- 7.0.4 | Compose - 1.2.0-alpha01-dev667 | Kotlin 1.6.10
    @askashdavies

    View Slide

  29. ● Takes conference data from open source ASG contributions
    ● Built heavily around Compose for Desktop
    ● Backed by Cloud Functions and Firebase Firestore
    ● Shared models across platforms
    ● Quasi-monorepo for side projects
    Hype Driven Development
    Case Study ashdavies/playground

    View Slide

  30. androidstudygroup.github.io/conferences/
    @askashdavies

    View Slide

  31. [{
    "name": "droidcon-berlin-2021.md",
    "path": "_conferences/droidcon-berlin-2021.md",
    "sha": "9361834b3e310ffd8992c1020eb868ebb56c564a",
    "size": 239,
    "url": "https://api.github.com/repos/AndroidStudyGroup/conferences/contents/_conferences/droidcon-berlin-2021.md?ref=gh-pages",
    "html_url": "https://github.com/AndroidStudyGroup/conferences/blob/gh-pages/_conferences/droidcon-berlin-2021.md",
    "git_url": "https://api.github.com/repos/AndroidStudyGroup/conferences/git/blobs/9361834b3e310ffd8992c1020eb868ebb56c564a",
    "download_url": "https://raw.githubusercontent.com/AndroidStudyGroup/conferences/gh-pages/_conferences/droidcon-berlin-2021.md",
    "type": "file",
    "_links": {
    "self": "https://api.github.com/repos/AndroidStudyGroup/conferences/contents/_conferences/droidcon-berlin-2021.md?ref=gh-pages",
    "git": "https://api.github.com/repos/AndroidStudyGroup/conferences/git/blobs/9361834b3e310ffd8992c1020eb868ebb56c564a",
    "html": "https://github.com/AndroidStudyGroup/conferences/blob/gh-pages/_conferences/droidcon-berlin-2021.md"
    }
    }]

    View Slide

  32. ---
    name: "Droidcon"
    website: https://www.berlin.droidcon.com/
    location: Berlin, Germany
    date_start: 2022-07-06
    date_end: 2022-07-08
    ---

    View Slide

  33. GraphQL
    docs.github.com/en/graphql

    View Slide

  34. query conferences {
    repository(owner: "AndroidStudyGroup", name: "conferences") {
    events: object(expression: "HEAD:_conferences") {
    ... on Tree {
    entries {
    data: object {
    ... on Blob {
    oid
    text
    }
    # ...
    }

    View Slide

  35. "data": {
    "repository": {
    "events": {
    "entries": [
    {
    "data": {
    "oid": "9a2a79fe414cf02fd0904c02ef7ce416344d747d",
    "text": "---\nname: \"360|AnDev\"\nwebsite: http://360andev.com/\nlocation: Denver, Colorado, USA\n\n
    date_start: 2016-07-28\ndate_end: 2016-07-29\n\ncfp:\nstart: 2016-01-27\nend: 2016-04-29\nsite: http://360andev.com
    /call-for-papers/\n---\n"
    },
    /* ... */
    },

    View Slide

  36. Case Study
    ashdavies/playground

    View Slide

  37. Case Study
    ashdavies/playground

    View Slide

  38. TypeScript
    ashdavies/playground

    View Slide

  39. Multiplatform
    ashdavies/playground

    View Slide

  40. Kotlin for JavaScript
    kotlinlang.org/docs/js-overview
    kotlin {
    js { nodejs() }
    jvm()
    }
    val dyn: dynamic = ...
    // 'whatever' is not defined anywhere
    dyn.whatever(1, "foo", dyn)
    dyn.whatever(*arrayOf(1, 2, 3))
    dyn.foo().bar.baz()

    View Slide

  41. Case Study ashdavies/playground

    View Slide

  42. Case Study ashdavies/playground

    View Slide

  43. Case Study
    ashdavies/playground
    Kotti

    View Slide

  44. Case Study
    ashdavies/playground
    CENSORED
    Py

    View Slide

  45. Kotlin all the things
    An experiment in creating a mobile app and
    firebase cloud functions in Kotlin
    – Andrew Reitz
    andrewreitz.com/tech_blog/kotlin-multiplatform-android-firebase

    View Slide

  46. Case Study ashdavies/playground

    View Slide

  47. Case Study ashdavies/playground
    Py

    View Slide

  48. Coming Soon…
    ashdavies/playground
    Compose
    Multiplatform

    View Slide

  49. ● Using Firebase AppCheck API for multiplatform REST API access
    ● Combine dependencies in composite build plugins and version catalogues
    ● Mosaic library for Compose Desktop [Success]
    Hype Driven Development
    One of many failures…

    View Slide

  50. ● Not everybody can, wants, or should spend time outside of work on pet projects
    ● Some are fortunate to have time for research, and community involvement
    ● Advocate for time to evaluate feasible technology, timeboxed, hack-week, etc
    ● Propose solutions for internal tooling, don’t forget the business case 🤑!
    ● Develop for disposability when in production (see “Everything is an API”)
    Hype Driven Development
    Work and life balance

    View Slide

  51. ● HDD is high risk for production environments
    ● Satisfy dev thirst in a safe environment
    ● Use learnings to advise feasibility
    ● Share learnings with the community
    Hype Driven Development
    Conclusion

    View Slide

  52. “Every existing thing is born without
    reason, prolongs itself out of weakness
    and dies by chance.”
    - Jean-Paul Sartre

    View Slide

  53. Ash Davies
    Android & Kotlin GDE Berlin
    @askashdavies
    Thanks!
    @askashdavies
    Kotti
    Follow for more cat pics!

    View Slide

  54. Hype Driven Development
    Links
    ● “Feature” [monkeyuser.com]
    ● Hype Driven Development [blog.daftcode.pl/hype-driven-development-3469fc2e9b22]
    ● Instant Gratification Monkey [waitbutwhy.com]
    ● Kotlin All the Things [andrewreitz.com/tech_blog/kotlin-multiplatform-android-firebase]
    ● Untitled [goose.game]

    View Slide