O'Reilly logo

Real-World Functional Programming with Examples in F# and C# by Jon Skeet, Tomas Petricek

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

Chapter 11. Refactoring and testing functional programs

This chapter covers

  • Refactoring functional programs
  • Reasoning about code using immutability
  • Writing unit tests for F# programs
  • Caching results using lazy values

One theme of this book is that functional programming makes it easier to understand code just by reading it. This is particularly important when you need to modify an unfamiliar program or implement behavior by composing existing functions or when refactoring existing code. Functional programming makes refactoring easier thanks to both clarity and modularity: you can make improvements to the code and be confident that the change doesn’t break other parts of the program.

As with many things in functional programming, the idea ...

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