Re[15]: Философический вопрос про автоматический вывод типов
От: xbit Россия  
Дата: 11.02.06 01:15
Оценка:
Привожу неболшую главу с книги "Refactoring: Improving the Design of Existing Code":

What Is Refactoring?
Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure. It is a disciplined way to clean up code that minimizes the chances of introducing bugs. In essence when you refactor you are improving the design of the code after it has been written.

"Improving the design after it has been written." That's an odd turn of phrase. In our current understanding of software development we believe that we design and then we code. A good design comes first, and the coding comes second. Over time the code will be modified, and the integrity of the system, its structure according to that design, gradually fades. The code slowly sinks from engineering to hacking.

Refactoring is the opposite of this practice. With refactoring you can take a bad design, chaos even, and rework it into well-designed code. Each step is simple, even simplistic. You move a field from one class to another, pull some code out of a method to make into its own method, and push some code up or down a hierarchy. Yet the cumulative effect of these small changes can radically improve the design. It is the exact reverse of the normal notion of software decay.

With refactoring you find the balance of work changes. You find that design, rather than occurring all up front, occurs continuously during development. You learn from building the system how to improve the design. The resulting interaction leads to a program with a design that stays good as development continues.


Это к тому, что такое рефакторинг, а вообще и тут я не со всем согласен. Например:

...we believe that we design and then we code... ...Refactoring is the opposite of this practice...

Очень важное значение имеет первоначальное проектирование, то самое design and then we code. А далее все, как тут описано.

ЗЫ: это все мое личное ИМХО
Нас не догонят!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.