Space shuttle style coding
Written by Stefan Judis
- Published at
- Updated at
- Reading time
- 1min
I learned about a new coding style today: the space shuttle.
It's described in the kubernetes source code:
This controller is intentionally written in a very verbose style. You will notice:
- Every 'if' statement has a matching 'else' (exception: simple error checks for a client API call)
- Things that may seem obvious are commented explicitly
We call this style 'space shuttle style'. Space shuttle style is meant to ensure that every branch and condition is considered and accounted for - the same way code is written at NASA for applications like the space shuttle.
I love it! Usually I'm not working on projects bringing people to space, but treating critical code with the same care seems like a good idea. 😅
If you enjoyed this article...
Join 5.5k readers and learn something new every week with Web Weekly.
Reply to this post and share your thoughts via good old email.