Keeping frontend code cleanly decoupled is challenging at the best of times. Rich user interfaces often depend on complex interactions between program state, control values, and AJAX requests, which makes it hard to write correct and testable code.
One technique for handling this complexity that is gaining favor in some circles is Functional Reactive Programming, which provides powerful tools for manipulating and composing streams of events and values that change over time.
Using the working example of a simple Flight mobile web app, this talk will introduce the fundamentals of functional reactive programming and show how it can greatly simplify complicated UI logic.
Trying to deal with realtime data and user interaction in the browser with callback after callback after callback quickly leads to madness. This is because application state is being modified all over the place by different callbacks, which makes applications complex and hard to reason about.
In this talk I’ll introduce the concepts of FRP and Bacon, and show how much nicer it is to work with than callbacks for realtime code. It will be a very visual talk using some visualisations of event streams that I am working on (http://latentflip.github.com/bac…) as well as some live code examples.