Dev Diary – 01 // Our Choice To Keep The Quality Code High: NDepend
- 13/12/2021
- 0 Comment(s)
Today begins our small dev diary about Goblin Soup and its projects we are talking for now only about “Role Master – Tabletop Simulator” which will go to Kickstarter in the first months of 2022!
Let’s talk about the art of programming. Art, because creating software is more than writing a series of “IF” and “ELSE” in the middle of some “FOR” loops;
code development, as I like to say: “it is not a pure science, but it contains an artistic component hidden from the eyes of most” and it is for this same reason that we can dance in logic like a novelist; use different styles and tricks to tell the story in our code, a story that has one goal: to solve the problem we are writing about.
<< Romantic eh? >>
Precisely for this reason, in software development we can run into a very serious problem, which manifests itself slowly, as a terminal disease, that is the loss of control of the code, physiology and inevitable just like the aging process.
Within Goblin Soup we have made a choice and we want to write high-quality and maintainable code in the future, even if very small, our value is already in the seed!
Developing is an art as well as a science, as I said and there are “tricks” or better “best practices” to follow to obtain a good resilient, readable, and easily maintainable code.
As we know, often, between saying and doing … there is something called “reality”; we, therefore, decided to adopt a static code analysis software called NDepend!
In one sentence, NDepend is a tool that analyzes your code and reports what is wrong and what can be improved, to avoid what is called “technical debts”. But what are they and why does NDepend help us keep the code in order? We will get there.
Currently, I am using NDepend in the first instance to analyze all the server-side code of Role Master – Tabletop Simulator, which is made up of 36 different Projects! The client component (ie the videogame) is not among these 36 components.
When I started NDepend for the first time, I was a little overwhelmed by the number of options available. However, I learned pretty quickly how to use its core functions with the right approach.
The first thing that struck me is that NDepend has found “code smell” which I didn’t think I produced as I was so attentive to quality.
If you wonder how NDepend finds these anomalies, simple, through a code Query LINQ tool that allows us to “reason” about the code and then identify its quality or even produce statistics.
This tool, believe me, went very deep and discovered things that I hadn’t noticed
The good news is that our work has received a very good rating!
Today was a very good day, thanks to all of you
Today begins our small dev diary about Goblin Soup and its projects, obviously we are talking for now only about “Role Master – Tabletop Simulator” which will go to Kickstarter in the first months of 2022!
Let’s talk about the art of programming. Art, because creating software is more than writing a series of “IF” and “ELSE” in the middle of some “FOR” loops;
code development, as I like to say: “it is not a pure science, but it contains an artistic component hidden from the eyes of most” and it is for this same reason that we can dance in logic like a novelist; use different styles and tricks to tell the story in our code, a story that has one goal: to solve the problem we are writing about.
<< Romantic eh? >>
Precisely for this reason, in software development we can run into a very serious problem, which manifests itself slowly, as a terminal disease, that is the loss of control of the code, physiology and inevitable just like the aging process.
Within Goblin Soup we have made a choice and we want to write high quality and maintainable code in the future, even if very small, our value is already in the seed!
Developing is an art as well as a science, as I said and there are “tricks” or better “best practices” to follow to obtain a good resilient, readable and easily maintainable code.
As we know, often, between saying and doing … there is something called “reality”; we therefore decided to adopt a static code analysis software called NDepend!
In one sentence, NDepend is a tool that analyzes your code and reports what is wrong and what can be improved, to avoid what are called “technical debts”. But what are they and why does NDepend help us keep the code in order? We will get there.
At the moment I am using NDepend in the first instance to analyze all the server-side code of Role Master – Tabletop Simulator which is made up of 36 different Projects! Obviously the client component (ie the videogame) is not among these 36 components.
When I started NDepend for the first time, I was a little overwhelmed by the number of options available. However, with the right approach I learned pretty quickly how to use its core functions.
The first thing that struck me is that NDepend has found “code smell” which I didn’t think I produced as I was so attentive to quality.
If you are wondering how NDepend does find these anomalies, simple, through a tool called Code Query LINQ that allows us to “reason” about the code and then identify its quality or even produce statistics.
This tool, believe me, went very deep and discovered things that I hadn’t noticed
The good news is that our work has received a very good rating!
As we can see the 13,751 lines of code of the server component of Role Master – Tabletop Simulator are well written also if it’s not perfect, the system tells us that the estimate to reach an “A” is only 2 days!! Wow! This estimation’s close to reality, this is so amazing!
Code Query LINQ is really powerful and gives us the ability to create our own development rules, Goblin rules 🙂 Awesome! this gives us another advantage, which is to help future colleagues who will be hired after the Kickstarter to work while always maintaining control of what we are planning together without more effort.
In this screenshot, it is not evident but thanks to this tool we can track changes from one analysis to another. Thanks to this you can observe the trends, for example how many problems have been added/solved since the last analysis. Handy when working in a team.
Another crucial aspect when developing code in very large projects is to avoid circular dependencies the code to be testable does not have to be circular, that is, A which depends on B which depends on C which depends on A …. this is the hell!
Thanks to this tool we are warned if such architectural errors occur. Fiuuuffff!
If you are a developer try this product, especially if we were carrying out a personal project like we are doing. Static code analysis tools like NDepend will help you tremendously in achieving your goal. Without any hesitation, I can recommend NDepend, which is excellently documented.