O'Reilly logo

Reactive Programming with Swift 4 by Navdeep Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Railway-oriented programming

Railway-oriented programming comes into the picture when we need to bring functional concepts in error handling within our code base.

In general programming, a developer spends most of their time thinking about "the happy path," that is, when everything goes according to plan and is just done right, and they don't spend enough time thinking what will happen if things go wrong; that's what railway-oriented programming is all about. In an imperative world, when things go wrong, or in other words the code throws some kind of error, there is a certain way of handling those errors and the process is called exception handling. In this section, we will cover how to handle errors and exceptions in a functional way.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required