Read someone else's code refactoring experience Feel good, special reprint, and so on their own experience after to add.http://www.sxt.cn/u/4647/blog/5584Briefly, code refactoring roughly includes the following:
CSS,JS is modular and is placed as much as possible in the same file to reduce the number of requests
Simplified and unified external framework with repetitive functions
Improve page loa
one or two fields within the incoming object.If a request is made to an existing object to replace a parameter, then you should activate the refactoring method replace Parameter with Method (292). In this case, an "existing object" may be a field within the class to which the function belongs, or it may be another parameter. You can also use Preserve Whole object (288) to collect a bunch of data from the same object and replace them with that object.
Recommendation 154: Don't overdo it, and experience the fun of refactoring in agileSometimes, we have to change the design of the software at any time:
If the project is for a large organization, different levels of software users will ask different needs, or as the key positions of staff turnover, the demand will change with the individual will.
If our competitors add new requirements, we also have to adjust the design for the new produc
of accomplishment, code comments are often too small and too simple. The decline of the human memory curve is steep and scary. After a period of time and then comments, it is very easy to "Forget words, more words and more.
I once saw Microsoft's code comments on the Internet. The details are amazing and I have learned a successful experience from Microsoft.
5. How to Use refactoring
Vs. NET 2005 includes a menu "
you tried to refactor a very old module, but you just looked at it and it was so disgusting. The document, the naming of strange functions and classes, etc. The whole module is like a tattered person with his feet. Although he can walk, he is already quite uncomfortable. In the face of this situation, the real Program personnel will not admit defeat, and they will accept the challenges for careful analysis, so they are afraid of rewriting. In the end, that module will be restructured by them,
View myselfArticleIndex Via http://www.cnblogs.com/seesea125/archive/2012/04/17/2453256.html
Motivation: Rename is the most basic and simple refactoring of refactoring, But This refactoring is also very important.CodeThe key first step for readability is "to become a real programmer, the level of name is crucial". If you see a function name, it cannot expres
"Please kindly advise on my code" is an irregular routine activity in our group. With code review and detail refactoring as the main line, you can freely express your opinions and suggestions, it is also a storm of thinking. It makes sense to summarize and record this activity. Today I launched 4 short codes, all of which are representative. Today, I will make a simple summary and share with you the reconstruction of one of the code snippets.
First, l
CSS Code refactoringhttp://www.cnblogs.com/aspnetjia/tag/The purpose of 125.CSS code refactoringWhen we write CSS code, not only do the page design effect, but also make the CSS code easy to manage, maintenance. We have two main purposes for the refactoring of CSS code:1. Improve Code Performance2, improve the maintainability of the CodeImprove Code PerformanceThere are two main points to improving the performance of CSS code:1, improve the load perfo
Tag: Log time () callback load Ted loader his instantiation initializationAjax refactoring can be broadly divided into the following 33 steps.Create a separate JS file with the name Ajaxrequest.js, and write the code needed to refactor Ajax in the fileThe specific code is as follows:var net = new Object (); To define a global variableWriting constructorsNet. Ajaxrequest = function (url,onload,onerror,method,params){This.req = null;This.onload = onload
Article Introduction: Semantic label of the actual combat significance.
I've collected some ideas, so let's hear them first,
Some people say:
"There is no need to think about semantics, as long as I write the code browser after running no problem on the line, anyway, the leadership does not care about these"
"Semantics is a generalization of the consortium, and I am very interested in the semantics of my code, but I always do not understand"
"This is not easy to say, semantic again go
In the process of object-oriented programming, clarify the responsibilities of this object. Class should be: do what you should do, do what you should do,
1. Move Method Move Function
Class behavior to achieve a single responsibility do not go beyond the Proxy: In your program, there is a function to communicate with another class outside of the resident class: Call the latter, or be called by the latter. Create a new function with similar behavior in the class most commonly referenced by this f
Simplify function calls
1. Pull Up Field move Up
The two subclasses have the same field. Move this field to the superclass.
If the child classes are developed separately or combined during the refactoring process, you will often find that they have repeated features, especially for fields that are more likely to be repeated. Such fields sometimes have similar names, but they are not absolutely the same. The only way to determine whether several field
Refactoring note-the bad taste of the Code (on), restructuring 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/42041757
In the refactoring entry, I briefly introduced the definition, why, and when to refactor the refactoring. I think you have a g
{ return set.numOfComponents}func (set *QuickUnionSet) IsConnected (p, q uint) bool { return set.Find(p) == set.Find(q)}
The author says he always wants to eliminate repetitive code when programming, and in other languages it can be done with class or macro, and he wants to know how to do better in the go language. in fact, here's another question: Is there a need for refactoring to eliminate duplicate code? Or, what kind of situation requires
This time to bring you a summary of the PHP code refactoring methods, PHP code refactoring considerations are what, the following is the actual case, take a look.
As PHP transforms from a simple scripting language into a mature programming language, the complexity of a typical PHP application's code base increases. To control the support and maintenance of these applications, we can use a variety of test t
Code refactoring is sometimes tedious, and string substitution is not only tedious, but also error-prone, with some tools available, PHP for example, REPHACTOR,SCISR and so on, but ready-made tools often mean inflexible So today I'm going to talk about the application of shell in code refactoring.
First of all, let's say we want to replace all the Foo_bar in the php file with Foobar, so we can do the follo
Yesterday interview, was asked a code refactoring, directly stunned ...Come back a little bit to see, the code refactoring has a little understanding ... is to let your own code has a better structure, more concise and easy to read it is a way to improve the quality of code it! Xcode provides several code refactoring capabilities, with rename (rename), Extract, C
Recently in learning Java, and C + + is a certain difference, the following are more easily confused than the overload, rewrite, refactoring, and its differences with C + +.
About overloading, overriding, and hiding references in C + +: http://blog.csdn.net/zhangjikuan/article/details/38447265
http://blog.csdn.net/zhangjikuan/article/details/38437851
Java:
Overloading: Overloads in Java are the same as C + +
Scope of action: in the same class
Specific
As an excellent developer, refactoring should become a habit, naturally using refactoring development patterns, and naturally optimizing and tweaking our code. It first requires us to master the development model of refactoring, that is, the development model of "small step Running", using the "two hats" design sequence, to develop our program. But as a beginner,
As a software developer, have you ever encountered such a situation: when reading other people's code, it feels messy and repetitive; or you may find many of the shortcomings when you go back to view your own code after one or two weeks. If so, congratulations. At least you are a thoughtful programmer and your realm is better than before. In this case, do you choose to rebuild it yourself? If you choose the latter, congratulations again. Not only do you have thoughts, but you are a programmer wh
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.