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
  2. “Be careful not to do that thing I knowingly did

    despite my own advice” - Every one of my talks, ever.
  3. • 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
  4. Advantages: • Low engineering complexity. • Staffing needs are minimal

    • Timeline is manageable Disadvantages: • Doesn’t solve the problem Design Decisions Option 1: Do Nothing
  5. How I learned to stop worrying and love the failures

    Hype Driven Development @askashdavies
  6. • 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
  7. 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
  8. • 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
  9. • 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
  10. • 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
  11. @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
  12. @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
  13. • Annotations, experimental, deprecated, Opt-In • Coding for disposability •

    Isolated API surface • Coding workshops • Feasibility investigations (timeboxed) Hype Driven Development Risk management
  14. • 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
  15. • 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
  16. • 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?
  17. • 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…
  18. • 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!
  19. • 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…
  20. Case Study 🧪 github.com/ashdavies/playground # ae2d602 | AGP- 7.0.4 |

    Compose - 1.2.0-alpha01-dev667 | Kotlin 1.6.10 @askashdavies
  21. • 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
  22. [{ "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" } }]
  23. query conferences { repository(owner: "AndroidStudyGroup", name: "conferences") { events: object(expression:

    "HEAD:_conferences") { ... on Tree { entries { data: object { ... on Blob { oid text } # ... }
  24. "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" }, /* ... */ },
  25. 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()
  26. 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
  27. • 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…
  28. • 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
  29. • 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
  30. “Every existing thing is born without reason, prolongs itself out

    of weakness and dies by chance.” - Jean-Paul Sartre
  31. 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]