Space shuttle style coding (#note)

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 ‘els…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

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:

  1. Every 'if' statement has a matching 'else' (exception: simple error checks for a client API call)
  2. 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. 😅


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate Updates
APA

Stefan Judis | Sciencx (2024-08-14T10:45:00+00:00) Space shuttle style coding (#note). Retrieved from https://www.scien.cx/2024/08/14/space-shuttle-style-coding-note/

MLA
" » Space shuttle style coding (#note)." Stefan Judis | Sciencx - Wednesday August 14, 2024, https://www.scien.cx/2024/08/14/space-shuttle-style-coding-note/
HARVARD
Stefan Judis | Sciencx Wednesday August 14, 2024 » Space shuttle style coding (#note)., viewed ,<https://www.scien.cx/2024/08/14/space-shuttle-style-coding-note/>
VANCOUVER
Stefan Judis | Sciencx - » Space shuttle style coding (#note). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/14/space-shuttle-style-coding-note/
CHICAGO
" » Space shuttle style coding (#note)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2024/08/14/space-shuttle-style-coding-note/
IEEE
" » Space shuttle style coding (#note)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2024/08/14/space-shuttle-style-coding-note/. [Accessed: ]
rf:citation
» Space shuttle style coding (#note) | Stefan Judis | Sciencx | https://www.scien.cx/2024/08/14/space-shuttle-style-coding-note/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.