A software design principle represents set of guidelines that helps us avoid writing bad code.
Programming guidelines are useful for team environments. These guidelines help us communicate code to other
programmers. With guidelines, it’s as though the written code has been written by a single programmer. On top of that
guidelines help us create more features with fewer lines of code.
Why are design principles important?
Design principles allow our code to be reusable anywhere in the application.
On top of that, design principles help us write efficient code as well. They give us a template that can be used
in other programming languages as well.
Hello and welcome to another episode of The Godot basics tutorial series. In this episode, we will be doing a soft introduction into design principles. So a software design principle represents a set of guidelines that help us avoid having a bad design.
Basically, they help us avoid writing bad code. Now, why exactly are design principles important. They are again guidelines to help us communicate code to other programmers. Design principles also help us write more features with fewer lines of code.
On top of that, some design principles allow us to reuse our code. They allow us to reuse our functions among multiple classes; on top of that design, principles help us write efficient code and do more with less. And I'm going to repeat it again. But it is worth mentioning that design principles give us a template for writing code, and this template is transitional among different types of programming languages.
Yes that means that design principles can be used in different game engines.
We can use it in Godot, and we can use it in unity.
Now I'm going to introduce three different design principles you should look into when you feel ready.
That is dry and kissed principle. The dry principle is just an acronym it means don't repeat yourself and the KISS principle is an acronym for Keep It Simple silly. So today. A little bit into the DRY principle states that we should not be repeating our code lines. You don't have to worry about this as a beginner but keep this as something you should try later in your coding adventures. Try to notice if you are repeating lines of code. Now the second principle you should look into is the kiss. Basically, the KISS principle is quite vague, but essentially it means that there are many ways to write code that solves a problem. You should use a code solution that is easy to read.
In this case the less lines of code you use to solve a problem.
And if that code is readable, you are most likely keeping in line with the KISS principle.
As a beginner, you shouldn't try to do this just yet.
You should be focusing on solving the problem first, and as a beginner, it should not matter how you solve that problem. Just make sure you are solving a problem in this case. In this series, make sure you try to solve the game problem first and then worry about implementing the principles. However, when you feel ready and comfortable with programming, the second principle you should learn is the KISS principle. Lastly, you should also look into the solid principle now.
So it is a more advanced set of design principles that help dictate how to write classes functions and interfaces in Godot. We do not have interfaces. Instead, we have the inheritance. And so, the solid principle can also be applied to inheritance.
Now the solid principle is a set of five different design principles.
We won't go over them in this episode. However, when you feel more comfortable, make sure to add the SOLID principles to your list of what to tackle next. Now, as you get better, try to learn the solid principle.
After the dry and kissed principle, I have a series on basics of programming designs. After this series, go ahead and look at the design principles series.
On top of that, you should also be reading articles and watching other videos and other programming languages.
It doesn't matter what language the design principles are teaching you in because they can be applied among many different programming languages. I hope you learned a lot.
If you have any questions or concerns, please feel free to leave them in the comments section below.
Thank you so much for your time.
I look forward to seeing you in the next episode. Have an amazing day.