Chapter 13. Refactoring

This chapter covers

  • A drag-and-drop example
  • Adding some features
  • Contrasting refactoring between OOP and FRP code

In your job as a programmer, you’ll often add a feature or fix a bug by adding extra code to a class or method. As the code gets longer, it can get messier. In this chapter, we’ll illustrate that process by example.

As the Agile software development methodology emphasizes, when you start to smell that “code smell” of untidy code, it’s usually a good idea to refactor the code by breaking the class or method into smaller pieces. This is important because messy code is complex code, and we’ve argued that complexity can compound. We’ve also argued that this should be less of an issue in FRP due to its compositionality, ...

Get Functional Reactive Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.