10 Oct 2016 YOW! Connected 2016: The typed-functional future of UI platforms
I just spent a couple of days at the YOW! Connected conference and had a great time, despite nursing a bit of a cold. There were a tonne of great talks at the conference covering a wide range of topics, but in this post I’m going to briefly reflect on one specific trend that interested me at the event: the way in which UI platforms are advancing to adopt modern languages, and are even influencing each other in the process. The end-result: they’re all moving towards languages that are both functional and statically typed.
Full disclosure: This year I was a member of the programme committee for the conference. So in writing this post, there’s a bit of a risk that I’m creating an echo chamber for myself. All I can really say in my defence is that I hadn’t consciously made these connections in advance – it was only afterwards that I saw a trend!
Manuel Chakraverty’s talk ‘A Type is Worth a Thousand Tests’ exemplified this, and also won my vote for best talk title of the conference. It was an engaging introduction to the power of Swift’s type system. As a JS developer I have to write a lot of tests to have confidence that my code isn’t going to die at any moment. Manuel’s main point was that a type system can take some of the burden off of you, especially when it is seen as a design tool which can disallow code that would cause your system to go into an invalid state.
I was a Java developer for 10 years so I was already aware of the benefits of a static type system. The problem with Java’s type system is that it’s overly verbose, and using higher-level type abstractions is clunky, to the point that it’s not really practical.
Newer languages let you use types far more concisely, and a modern type-inference engine can infer a lot from your code. Modern type systems also let you use far more powerful type abstractions. The end result is that you’ll still need to write tests, but not nearly so many, as the compiler will do much more of the leg-work for you. I like to think of it as another tool for the code-quality toolbox.
Unidirectional Data Flow
It was appropriate that Manuel’s talk was immediately followed by Sam Ritchie’s ‘Unidirectional Data Flow for Mobile‘. It was exciting to see how Sam has evolved the work he presented with me last year as part of our ‘Rethinking MVC with React Native and ReactiveCocoa‘ talk at YOW 2015.
In that talk, I spoke about how the underlying programming model of React allows us to write UI code that is easier to comprehend and reason about by letting us describe components within our UIs as functions whose output will always be the same for a particular set of inputs. Mutable state can be tightly controlled, and even in some cases completely eliminated.
Whilst acknowledging that his work was still very much in-progress, Sam nevertheless impressed me with what he has managed to accomplish so far. He also continued his hilarious/appalling tradition of inserting the worst puns and dad-jokes he can find into his conference presentations. Nice work Sam!
Kotlin and Anko
Whilst an officially-sanctioned language revolution is leading to all sorts of innovation in the iOS development space, an unofficial revolution is happening over in Android-land. I wonder whether a similar wave of innovation will follow in its wake.
Disillusioned with the verbosity of Java – especially pre-version 8 – Android developers are now looking at Kotlin as a viable alternative, especially since it went to version 1.0 at the start of the year. Such is the level of interest that we had at least 5 proposals for Kotlin related talks at YOW! Connected this year.
Sadly, to avoid skewing the programme too much, we could only pick two of them. First was an introductory talk entitled ‘Kotlin: The Pragmatic Language for Android‘ by Mike Gouline. I didn’t go to this talk because I’m already familiar with the basic principles of Kotlin. However, I think the title of the talk summarises perfectly the appeal of this language for Android developers. It’s modern, accessible and practical.
Linking it all together
So wrapping all of this up, I see two interesting things happening with UI development at the moment:
- All of the platforms are moving towards typed-functional languages of one form or another. Furthest along the track is iOS with Swift. Who’s coming next is a matter of debate: the web community is seeing increased adoption of TypeScript and Flow, whilst Android developers seem to be getting pretty excited about Kotlin and the frameworks that it enables.
Whilst purists may argue about how ‘functional’ each of these new languages is, the real question is this: are they ‘functional enough’ to enable new functional paradigms for building UIs? Generally speaking, I think the answer is yes. The future of UX development will be both functional and typed, irrespective of which platform you use.