Preview

Functional Programming Spacewar

Clean Code: Functional Programming, Episode 55

Robert "Uncle Bob" Martin
1 hour 27 minutes • 1.30GB • Dec 2018

Spacewar! How cool is this? Did you ever think that you would be combing through the innards of a real-time, interactive video game written in Clojure? Well, you are now!

This game is thousands of lines of Clojure code. It has Klingons, Romulans, Starbases, and The Enterprise. You must save the Federation.

This episode and the two that follow will lead you through the design and implementation of a functional and interactive GUI program. It is 100% functional: no cheating, no mutated variables, and not even any Transactional Memory; just plain old functional programming.


You should probably follow along and grab the code. If you want to play the game, you can find the ClojureScript version in your web browser here.

Robert "Uncle Bob" Martin

Robert "Uncle Bob" Martin

A software professional since 1970, Robert has spent the last 40 years contributing toward the betterment of the field, from kickstarting the Agile Alliance to authoring landmark books about Agile Programming, Clean Code, and more.