FRP at Kickstarter and Kotlin
If you’ve browsed the code for our open source iOS or Android apps, you may have noticed that we try to follow Functional Reactive Programming (FRP) patterns wherever possible. For an introduction to FRP, I recommend this explainer from Dan Lew. It’s a paradigm that we have followed in our mobile apps for years now and has helped us write clear code with minimal bugs. One of the main benefits of this pattern is it allows us to push all of our mutation and complex logic into ViewModels, which are then thoroughly tested. We are able to keep our views very simple and test as much of our code as possible while avoiding a reliance on manual UI testing. Gina Binetti and Lisa Luo, who have contributed to both Android and iOS apps at Kickstarter, gave a great talk on the benefits of FRP at the 2016 Functional Swift Conference:
Which brings us to this year! I joined the Android team earlier this year after working for over two years on the backend and payments teams at Kickstarter, and the discipline from our mobile engineers in following FRP has allowed me to ramp up on the codebase very quickly. In addition to FRP, the Android team at Kickstarter is pretty excited about Kotlin, the new programming language from JetBrains that runs on the JVM (as well as elsewhere!). We have already started adding a few Kotlin classes to our Android app, but we haven’t converted any core functionality to Kotlin because of some worries about our dependencies.
I was also fortunate enough to speak at Functional Swift Conference 2017 in Berlin, Germany. For my conference talk I decided to try to push our use of Kotlin a bit further by adding a simple screen to our Android app using our established FRP patterns. Warning: it’s a lot of live coding, but hopefully it can be a good introduction to FRP and/or Kotlin. Enjoy: