Do you love Go? If so, why? Could it be better? Can you write your code better today?
Go is simple yet powerful, its compiler is fast and cross-platform, and it makes concurrent programming easy. Go also provides useful tooling and has a great development community. Perhaps Go could be better. (We'll explore that question in some depth.) This book will help you write better code using the functional programming (FP) style of coding. Let's get started!
In this chapter, I will share the benefits of pure FP as well as its performance implications in Go by working through Fibonacci sequence code samples. Starting with a simple imperative implementation, you will explore functional implementations and learn some test-driven development and benchmark techniques along the way.
The goal of this chapter is to:
- Become grounded in the theory of FP
- Learn how to implement functional solutions
- Determine what type of FP will best fit your business requirements