Member-only story
On the menu: spaghetti code!
How you can improve legacy code, making it maintainable and easier to understand
I originally wrote this story in 2017, but never published it. The year is now 2023 and I finally managed to edit and publish this. It’s amazing to look back at how I approached things 5 years ago. I didn’t know about Kotlin or Rust, and was in a different phase of my life. Today I’d probably write it a little bit differently. I still hope you enjoy it and find something useful.
Norway, Feb ‘23
Have you come across some really ugly code in your career? Have you read the source and thought “how on earth could anyone ever have understood this?” And when your customer asked to add a new feature to this legacy, have you wondered how you could do this, based on a codebase like that?
If your answer is yes, you might already know the term “Spaghetti Code”. Even though there are many “Cookbooks” for various programming languages, developers should stick to keeping Spaghetti in the kitchen.
What this story is about
In this story, we will create some game code step by step and observe it evolving into spaghetti code. You will learn how to “unnoodle” your code, and how to make sure everything works as expected, even if you change old legacy. And, of…