# Space War

DevFeed: [Space War](<https://devfeed.tech/articles/space-war-21798.md>)

Original publisher: [Read original article](<http://blog.cleancoder.com/uncle-bob/2021/11/28/Spacewar.html>)

Published: 2021-11-28T00:00:00Z

Content type: article

Language: en

Sources: [Robert C. Martin](<https://devfeed.tech/sources/robert-c-martin.md>), [The Clean Code Blog](<https://devfeed.tech/sources/the-clean-code-blog.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [GUI](<https://devfeed.tech/topics/gui.md>), [Code](<https://devfeed.tech/topics/code.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [clojure](<https://devfeed.tech/tags/clojure.md>), [code](<https://devfeed.tech/tags/code.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [gui](<https://devfeed.tech/tags/gui.md>), [programming](<https://devfeed.tech/tags/programming.md>), [project](<https://devfeed.tech/tags/project.md>), [space](<https://devfeed.tech/tags/space.md>)

## AI overview

The article describes the author's return to Space War, a game first written in 1978 and revisited in a newer version started in 2018. The newer system is an animated, GUI-driven application written entirely in Clojure, using Quil as a shim for the Processing GUI framework. The author discusses how functional design, organization, and extensive tests made the codebase easy to understand after several years.

## Source excerpt

For the last month I've been spending a lot of time working on Space War. I know, I know, I should have been working on Clean Code Episode 67: Legacy Code, and Euler 5, and Countest and Curmugeon 3. I should have been working on a blog, or a new book, or... But I couldn't let go of Space War. It kept calling me. The first time I wrote Space War was in 1978. I wrote it in Alcom, which was a simple derivative of Focal, which was an analog of Basic for the PDP-8. The computer was an M365 which was an augmented version of a PDP-8 and was proprietery to Teradyne, my employer at the time. The UI was screen based, using character graphics, similar to curses. Screen updates took on the order of a second. All input was through the keyboard. We used to play it on one machine while waiting for a compile on another. Forty years later, in September of 2018, I started working on this version of Space War. It's an animated GUI driven system with a frame rate of 30fps. It is written entirely in Clojure and uses the Quil shim for the Processing GUI framework. My justification for writing it was so that I could use it as the case study for my cleancoders.com videos on Functional Programming. Once that series of videos was complete, I set Space War aside and started working on other things. Then, a month ago, the program called to me. I don't know why. Perhaps it was because I'd left it in a partially completed state. Perhaps it was because I had just finished Clean Craftsmanship and I needed a way to decompress. Or, perhaps it was just because I felt like it. Whatever the reason, I loaded up the project and started goofing around with it. Now I'm sure you've had that feeling of trepidation when you pick up a code base that you haven't seen in three years. I certainly felt it. I mean, what was I going to find in there? Would I be able to get my bearings and understand the code? Or would I flail around aimlessly for weeks? I needn't have worried. The code base was nicely organized. The