Refactoring note-the bad taste of the Code (below), refactoring the taste of the note code
This article is in the study of the summary, welcome to reprint but please note the Source: http://blog.csdn.net/pistolove/article/details/42083495
In the refactoring note-the bad taste of the Code (I), 11 of the 22 bad tastes are introduced. This article will introduce th
Today there are a few asp.net with JavaScript tutorial articles. Now look at those JavaScript scripts that are not well written and overly complex. Now extract them and refactor them.
before a:
Copy Code code as follows:
function Selectedall (CB) {
cb.checked = cb.checked? False:true;
var gv = document.getElementById (' var rc = gv.rows.length;
for (var i = 1; i var input = gv.rows[i].cells[0].getelementsbytagname ("input");
if (Input[0].type = = "checkbox" input[0].che
What is refactoring? Improve the design of the code after it has been written.Refactoring classification: Physical structure, class hierarchy, class internal structure.
Name
Shortcut keys
Literal translation
Function range
Describe
Rename
Alt + Shift + R
You can rename any variable, class, method, package name, folder, and all the places you use will be modified uniformly.
"Refactoring to improve the design of existing code" reading notes and Experience first chapter reconstructs the first step of refactoring a case, establishing a reliable set of test environments for the code that is about to be modified. Processes and methods have a secondary impact on the outcome of the project, and the primary impact is people
Without a reliable test environment, do not refactor the code
Discretion refactoring series [13] -- remove intermediate classes and discretion refactoring
Sometimes we may write some "ghost" classes in our applications. "ghost" classes are also called intermediate classes. These intermediate classes may not do anything, but simply call other components. These intermediate classes do not actually work, they increase the layer of the application and increase the complex
[Programming Basics]-method overloading, rewriting, refactoring, and basic programming refactoring
Method overload:
Method overloading refers to defining multiple methods with the same name in a class, but each method must have different parameter types or number of parameters.
By using method overloading, you can meet more situations. For example:
If Cat is not overloaded and there is no parameter, an er
All Program refactoring, upgrade target (remarks, updates), and refactoring remarks
Start refactoring the entire program, by default7 # zbphp.com
Database:
1) No name specification. Use status instead of ispublic isok result to record the success and status fields.
2) changing status to numbers 0 indicates failure, and 1 indicates success. If t is used fo
Before I wrote a refactoring of a function, it was written about the refactoring of the call of the function, which is different, in order to write a function ( or interface ) that makes it better to call.1. Function renamingModify point: The name of the function does not prompt the function's purpose.Procedure: Modify the name of a functionIf you want to write a comment on a function, then you can write th
Mind Map
This article introduces how to re-organize your function to continue refactoring by taking on the above PHP miscellaneous "refactoring-improving the design of existing code. This chapter mainly focuses on Data Reconstruction. 1. argument: directly accessing the field or accessing the field through the function (accessor)
2. Modify array to object: When you see an array is similar to a data s
5.Introduce explaining Variable If you have a complicated expression,put the result of the expression, or par TS of the expression, in a temporary variable with a name that explains the purpose. introduce explaining Var Iable is particulaly valuable with conditional logic in which it are useful to take each clause of a condition and explain What the condition means a well-named temp. Another case are a long algorithm,in which each step in the Computa tion can be explained with a temp. mechanics
the code. Perform regression tests on your refactoring actions. Then make corrections or changes. Test again. Later, you may need to refactor more code to make your code change intent clearer. Perform another comprehensive test. Rebuild and change. Or change, and then refactor.You are not Refactoring for reconstruction, because you want to do other things, And Refactor
Imports Settings page via Project->project Properties...->java formating->
Figure 25 Setting the Package Threshold dialog box
The package import threshold specifies the threshold of the package by default, which is introduced by the wildcard character as an entire package after the import is optimized by 0.
You can also check the Always import classes entry and introduce each class with a separate import statement, which is equivalent to setting the package import threshold to infinity.
comment, after all, the comment may not be updated in time.
"Refactoring, improve the design of existing code," This is a classic, I believe many people have heard or read, read this book will find that the book is a lot of simple things, and many things are what we usually do, but the author summed them up. Rename field, for example, is an easy-to-understand na
This article is a computer Quality Pre-sale recommendation >>>>refactoring: Improving the design of existing codeWorld-class software development master Martin Fowler Immortal Classics, the general programmer advanced to the programmer must cultivate the secretEditor's recommendationthe immortal classics of software developmentA vivid exposition of the principles of refactoring and concrete practicesGeneral
:
Unfortunately, we have to end the eclipse automatic refactoring journey ahead of schedule. Eclipse almost cannot be restructured. Perhaps the automatic reconstruction tool called by Martin Fowler in the book is not limited to the idea of "reconstruction work assisted by tools. Art is the patent of mankind, and the dream of programming art will continue.
Interested readers can view the final code of manu
? Bad Smell! Have you read the rebuild book? What does it write? What is the value of this book? This article introduces how to reconstruct the technology? Tell you why rebuild? Error! The value of this book is that it lists the Bad Smell that should be restructured one by one, and gives the opinions on how to reconstruct and solve these Bad Smell problems, other
Reconstruction, in our
Program The design is really very important. Its role, or even magic, can make us
Code Vibrant and elegant. Because refactoring cannot be the syntax of the program language, there are few introductions to refactoring on the market, especially the authoritative book that truly makes a splash, we can only keep practicing and thinking in eve
Erich mentioned in the preface of refactoring:Code is read and modified much more times than it is written. The key to keeping code readable and easy to modify is refactoring.
What is the purpose of refactoring? The second chapter of the book has a special section for explanation. However, the first chapter presents a simple case to show a relatively complete rec
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.