How to write good software without getting stuck

I have been working on my personal project for many years, an operating system created from scratch. As you can imagine, this is a rather complicated material. The problem is that I worked a lot from scratch. This means that at some point (quite advanced, I had read / write to the hard drive and some basic networks), everything was too confusing, and I decided to drop it all out the window and try again. In those years when I learned how to make code more enjoyable, I read Robert Martin's Clean Code - A Handbook of Agile Software Craftsmanship, and that helped a lot. I learned to make functions smaller, organize things in classes (I used C, now C ++) and namespaces, corresponding error handling with exceptions and testing. However, this new approach is stuck in the fact that I spend most of the time to checkthat everything is going well; that the code is well-read; it's easy, well-commented, and verified. Basically, I have not taken any appropriate step since a few months. When I see my well-written code, it’s hard to add new functionality and think “where should I put this? Have I already used this piece of code? What would be the best way to do this?” and too often I put off work.

So here is the problem. Do you know any strategy for writing code that makes you write working, tested, pleasant code without spending 90% of your time thinking how to make it work, check, and good?

Thanks in advance.

+5
source share
3 answers

Do you know any strategy for writing code that makes you write working, tested, pleasant code without spending 90% of your time thinking how to make it work, check, and good?

Yes, here .

Seriously, no. It is impossible to write good code without hesitation.

, : " ? ? ?" .

" ". " " . .

+9

. (Robert Martin ) .

, , :

" ! , . . , , ".

+4

TDD ( ). , .

, . , , ( , ); " ".

In addition, TDD allows you to focus on developing exactly what you need, and not more, so it tends to lead to a more pleasant and simple design (especially in interfaces, since you need to think about interfaces before you start coding, so "thought" controls the interfaces, not "no matter what happens when I code it."

However, keep in mind that using automated tests for the OS may give some technical problems!

+1
source

All Articles