Feeling refactored into a joke

       From the beginning of programming to the present, there are dozens or hundreds of lines of functions in the companies that I have been in, every project team I have been in. There are not a few people who think this is beautiful, and think it is "compact"; too many variables are not considered a problem, just mention it at the beginning of the function, thinking it is "more readable"; variable names are also very short, with one letter and two. The popularity of each letter is not considered a problem, and it may be thought that it does not affect reading, but instead makes the code shorter. If the code is nested too deeply, it is not considered a problem. It is opposed to splitting functions. It is not necessary to split the code that is not public. Whether it is split or not has basically nothing to do with the length of the function.
      I no longer believe that there are companies in China that strictly practice refactoring. I feel that most companies' code is written in this way.
       Even though I read Refactoring and thought I had a glimpse into it, I couldn't convince my colleagues unless they also read and agreed. In front of the classmates who think that refactoring is a broken muscle and a major overhaul that is carried out every once in a while, it is really not enough to directly instill the practice in the book. I said that variables should be close to the logic block, the principle of proximity, all mentioned that the top is not easy to read, and is equivalent to global variables, and should limit the scope; but they think that it is easier to read at the top. There was an argument over how to make it easier to read, and there was no way to explain it. Because with my current skill and expressive ability, I really have no way to explain why salt is salty and vinegar is sour.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326753375&siteId=291194637