Skip to Content
Hands-On Reactive Programming with Python
book

Hands-On Reactive Programming with Python

by Romain Picard
October 2018
Intermediate to advanced
420 pages
10h 26m
English
Packt Publishing
Content preview from Hands-On Reactive Programming with Python

Keeping side-effects as small as possible

In functional and reactive applications, side-effects must be present only in drivers. For debugging purposes, traces can be added in the pure code with the do_action operator.

The code in drivers should be as small as possible, limited to the part that is the side-effect. If a driver contains a side-effect and additional logic, then the additional logic should be moved out of the driver into some pure code. This has several benefits:

  • The driver is easier to test, since it does fewer things. This is good because testing side-effects is more complex than testing pure functions.
  • The resulting logic is now independent of the driver. It means that is can be used with other drivers, implementing similar ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Programming with Design Patterns

Python Programming with Design Patterns

James W. Cooper

Publisher Resources

ISBN: 9781789138726Supplemental Content