当前位置:网站首页>Reread reconstruction

Reread reconstruction

2020-11-09 10:50:00 InfoQ

{"type":"doc","content":[{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" New version with JavaScript Language as an example , Rethinking and improving many refactoring techniques in the first release , Combined with the author's many years of new views and thinking , It brings us a more abundant and perfect reconstruction system ."}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Refactoring is one of the essence of agile practice , In our agile based company, we should have the basic skills at your fingertips . Although its basic ideas are not out of date for a long time , But the first edition 《 restructure 》 After all, the release of is already 20 Years ago , During this period, numerous new programming ideas have sprung up in the software development industry 、 Language 、 Tools 、 Frame, etc , Now go back to the first edition , It's not just paper books that are hard to buy , Some of the knowledge is also a bit disconnected . New version with JavaScript Language as an example , Rethinking and improving many refactoring techniques in the first release , Combined with the author's many years of new views and thinking , It brings us a more abundant and perfect reconstruction system ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Read through this book , A lot of places resonate with me , At the same time, it also gives me a new perspective on daily practice , And there are new conclusions on some issues . Here's an excerpt of some important points , And share my understanding , Learn with you ."}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/b7\/c5\/b71de8324547407486903d57382f19c5.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"《 restructure 》"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" Several key points of refactoring "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The several reconstruction points mentioned in the book are worth everyone's attention when practicing refactoring :"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Refactoring should not change the observable behavior of the original program "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Treat adding new features and refactoring as two different things , It's like two hats , In the development process, we often change the two hats "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Small steps to refactor , Move forward more safely , Make the code work most of the time "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Garbage picking refactoring : When you find a piece of garbage , Don't want to stray too much , At the same time, I don't want to leave the garbage in place ; If it's easy to refactor at this point , It's done immediately , Otherwise, record it , We'll reconstruct it later "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The vast majority of refactorings are opportunistic , It's not a single task "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" The only purpose of refactoring is to make it faster , Create more value with less work ; Refactoring doesn't come from “ Neat code ”“ Good engineering practice ” And moral demands , It's purely economic "}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":" Self testing code is the cornerstone of refactoring , It's also a key part of continuous integration . If you want to “ agile ” To live up to its name , We must do these three practices well – Self test code 、 Continuous integration 、 restructure ( Self test code and refactoring together make up TDD)"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":" The combination of various basic reconstruction techniques , To achieve advanced refactoring purposes "}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢