Writing clean code is an art form. If you care about software development and being a good coder, your number one aim should be to write good code. Clean code means different things for different people. In this section, I will cover some of my tips for writing code that I think is clean
Test Driven Development is a technique that will help you craft better software. When I started out I didn't really get TDD. I'd write a handful of unit tests on a project, those tests we're all a bit useless and I never saw the benefit. If you're in the same camp then this section will help explain the benefits of unit testing. In this section, you will learn about the frameworks I use, how to write tests for hard to test code and how to structure your tests so they are not so brittle.
My approach to TDD maybe slightly more pragmatic. I admit in most situations I don't start off writing a test first. When I'm designing something I prefer to work in iterations. My initial iteration might be to get something working (usually within a few hours max). After I have a better understanding of the project, I'll start to refactor it into a better design.
It's this phase that I'll start to write my tests. Using tools like dotCover, or, statistical analysis tools, like sonrQube . I use software to help iterate my design until I' happy with the code coverage. This approach is probably more pragmatic than some of the purist TDD material you may bump into. The main reason why I think TDD is so beneficial is that it forces you to write better code. If a method isn't testable, you are forced to decouple it, so that it is. It's this process of forcing you to re-design things regularly that will help you write better code. Having high coverage does mean that you cab higher confidence when releasing your new code to your production environment but for me, this is more of an additional benefit, rather than the main star. If all this sounds good to you, I recommend you get going today.