Writing Better Code

Writing maintainable code is an art form that should be practiced by every developer because if the code we write can not be maintained then there will come a point where it won’t be useful anymore and discarded and then all of our efforts will have been wasted. In this article we’ll look at ways to keep our code maintainable.

The Developer's Dilemma

There are two main ideas to keep in mind and should follow in order to keep our code maintainable:

1) Complexity is the enemy! 

2) Fragility is the enemy!

The problem we face as developers is that when we are speaking in terms of these two opposing forces, there is a inverse relationship between them.  Creating more flexibility to reduce fragility in our code requires more complex code. 

原文地址:https://www.cnblogs.com/smallfa/p/1358873.html