Thursday Mar 10, 2022
Episode 4, Clean Code Part 4
Hi there my fellow gamedevs and welcome back to the All Things Unity Podcast. In this episode our adventure for in clean code comes to and end. Sort of… at least…
We are going to dive into the next four chapters of the book. Oh yes, again four chapters. We are going to look at chapter 10 Classes and find out what Uncle Bob has to say about those. We will discuss one of the often returning topics in this book, the Single responsibility principle. We will talk about coupling and cohesion of classes and much more.
Then we also discuss chapter 11, Systems. This is an important chapter to understand and since nice systems design will have big positive impact on your Unity3D application. In unity we are dependent on a really specific startup sequence of loading scenes and awake or start calls. In this chapter we dive into Uncle bob’s advise how to make nice systems, and I’ll try to convert this advise into something tangible you can apply in a unity3D context.
Then we have yet another chapter to discuss and this is chapter 12, Emergence. Uuh.. What? Well with Emergence Uncle bob means that your code, your system evolves and grows. From a tiny little system a larger system emerges and you as a professional game developer need to be able to manage that in a clean way. So in this short 5 page chapter Uncle Bob will give you some advise on how to take on that challenge and slay the spaghetti monster.
And at last, we talk about the last chapter we can meaningfully cover in a podcast, and that is chapter 13, Concurrency. And Concurrency is one of these topics I do not want to bother starting or junior developers with but it is the last chapter in the book we can cover nicely in a podcast format. The rest of the book are case-studies and refactoring examples. There’s also a chapter about code smells with a lot of examples but that’s also difficult to cover in a podcast. So to make this series complete I’m gonna cover the concurrency chapter anyway.
Concurrency is really cool and it can result in some massive performance boosts in your game. But it can also be your worst nightmare and melt your brain into a sludge. Writing concurrent code requires a different mind set since you need to separate the what from the when. We are going to explore all of that in the latter part of this episode.
I also mention a couple of things again:
My blogs about SOLID: https://hamersoft.com/?s=solid
The AbstractFactoryPattern (design pattern): https://www.tutorialspoint.com/design_pattern/abstract_factory_pattern.htm
Moore’s Law: https://www.intel.com/content/www/us/en/history/virtual-vault/articles/moores-law.html
The next episodes is going to be about alternatives about clean code and making some comparisons to clean code. As I said in the 0th episode, I’m not saying clean code is the best, the only way to go. I’ve also read and learned a lot from books like the original Pragmatic programmer, Code complete and A Philosophy of Software Design. I’ve read them all but I think the Clean code book is the easiest one to get started with since it has great advise for juniors, lot’s of code examples and even these case-study chapters.
In the episode I mention that I will spend one episode talking about alternatives but I after quickly having reviewed the contents of these books I can tell you that I will make at least three episodes that dive into these books individually. Because there’s so much good information in there I can’t really do the book, or the author justice by spending like 15 minutes on each of them. So expect at least 3 more episodes in this series :)
I hope you learned something today and join me on the next episode!
And as always, remember; With Unity, we can do great things.
Comments (0)
To leave or reply to comments, please download free Podbean or
No Comments
To leave or reply to comments,
please download free Podbean App.