Build Your Own Spreadsheet

Look behind the curtain and learn how one of the most used tools in the world works.

And learn more about test-driven development in the process!

Image of the book cover

Build Your Own Spreadsheet is a text-based pairing session that takes you from design mockups to a fully functioning spreadsheet that supports formulas! It shows a practical example of test-driven development with TypeScript and React.

In the book you'll pair up with me, Christoph, and together we'll discuss several aspects of the test-driven development cycle. We come across trade-offs, refactorings and how to deal with tensions of new requirements that break expectations of older tests. We also discuss when it's good to stick to the process of writing tests first and when other techniques can be more helpful.

Available in PDF and ePub!

Clicking the button above will open a popup. Purchases go through Gumroad, but you don't need an account there.

Powered by Buttondown.

Not sure yet?

Please download and read the example chapters to get a sense of what the rest of the book is like. The example chapters cover the initial project setup and the first three tests of the spreadsheet that is built throughout the book.

But don't just take my word for it… Here's what others are saying:

Want to get better at TDD and React/Typescript? Grab this book where you'll be pair programming with an experienced engineer.

I've had the pleasure of pairing with @ChristophGockel in the past. Can't recommend it enough. You'll learn a lot while having tons of fun.
August 3rd
I can only recommend the book. It's a very good read and the project example makes everything really easy to understand. So it's not just pure theory. If you've always wanted to delve into the world of TDD, this is a really good guide. (translated)
August 6th
Christoph is very good with:
- Javascript/Typescript ✅
- TDD ✅
- Pairing ✅
- Spreadsheets ✅
- Teaching ✅

This is an instabuy 🚀
August 2nd

What's Inside

Have you read about test-driven development and are now wondering how to write anything real with it?

Or maybe you're experienced with it already but now getting into React and want to learn more about approaches and tools to test-drive a non-trivial React component.

Fear not, Build Your Own Spreadsheet has you covered either way!

This is the full table of contents:

Table of contents page 1 of 2 Table of contents page 2 of 2

The spreadsheet in the book is going to be built with TypeScript and React. For testing, we'll use Vitest as our test runner and React Testing Library for the React specific testing.

After the main spreadsheet component is built, the book continues to test-drive spreadsheet formulas. All the way from the lexical analysis of user input, to parsing it and interpreting formulas like =A3 * 42. Basic arithmetic is supported (including operator precedence) and you can also reference other cell values!

You can try it yourself below, where the final version of the spreadsheet is available!

What is Required?

In order to get the most out of the book, a basic level of JavaScript and React is helpful. Not required, but knowing React, JSX and core hooks like useState will be used without a longer explanation of how they work. But even when you're at the beginning of your React journey, I think from the context of how we're building the component, you'll be able to follow along. If you're unsure, please check the example chapters you can download.

What we're Building

This is the final component that we're building in the book. Go ahead and double-click a cell to change its value and see what it does!

Supported Features include:

  • Displaying tabular data.
  • Highlighting of the currently selected cell.
  • Double-clicking of a cell to edit its content.
  • Basic keyboard support to confirm or cancel editing(Enter/Escape key).
  • Formulas containing arithmetic (+,-,*,/).
  • Formulas that concatenate strings (&).

About the Author

Image of the author, Christoph

Hi, I'm Christoph!
This picture of me was taken at a Global Day of Coderetreat some time ago, but as you can see, we can't escape Spreadsheets. They're everywhere!

Since an early age I've been curious about how stuff works. I loved disassembling and reassembling things like my bicyle as a kid and slowly progressing further to other appliances like telephones and radios. Often times, however, the reassembling part came with mixed results of success I have to admit. But that didn't stop my curiosity.

When I started to learn more about computers (and eventually programming) I was amazed by how flexible and powerful spreadsheets can be.

Fast forward a couple of years and I thought I could share my curiosity about spreadsheets by helping explain some core concepts in the form of a book.

If you're still unsure whether this is for you, please check out the example chapters you can download for free.

I hope you enjoy it,

Handwritten name Christoph

Frequently Asked Questions

I bought the book, but what happens when there's an update? How do I get access to the latest version of the book and its source code?
First of all, thank you for purchasing! Every update I provide to the book will be available free of charge. You can always find the latest download content in your Gumroad library. Alternatively, if you don't have an account with Gumroad, you can continue to use the “Download the Book” link you received in the confirmation email of your purchase. Additionally, I will also email all customers when there's been an update to the content. If all else fails, please reach out to me via email.
£15+ is a lot from where I come from. What about purchasing power parity (PPP)?
That is totally understandable and I am committed to provide discounts for this. I use ParityDeals to automate the handling of voucher codes. When you visit from a country that is eligible for a discount you'll automatically see a banner appear at the top of this page providing you with the necessary code to be used during checkout. In case you run into problems with that, please don't hesitate to reach out to me via email or Twitter.
I don't like the book. It's not what I was expecting and I'd like a refund.
I'm sorry to hear that! But I respect it. Please get in touch with me via email and I'll issue a refund. No questions asked.
The JavaScript ecosystem is moving so fast. How up to date is the content of the book and do I need to expect having to deal with lots of outdated dependencies?
It really is moving fast, I agree! The good thing is that the essence of the book is timeless. Meaning that the primary lessons have stood (and likely will continue to stand) the test of time. Test-driven development, quick iterations and refactoring are language and ecosystem independent.

However, this doesn't explain what the content of the book is like. The first edition was released in 2021 and used Parcel, React 17 and Jest.
Most of this tooling has been superseded by now (at the time of writing this in 2024).
So it was time to brush up the content and code. In April 2024 the updated version has been released, using React 18 together with Vite and Vitest. This brings the book and the accompanied code closer to what the majority of developers would be using in a new project.

If you purchase the book now, you automatically will get the latest version of it. If you have purchased the book in the past, you can download the updated version from Gumroad free of charge.